Skip to content

platform.updatePlatformOrganizationCredits

PATCH
/v1/platform/organizations/{organizationId}/credits
curl --request PATCH \
--url https://example.com/v1/platform/organizations/example/credits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "enabled": true }'

Turns the credits of an organization on or off. While they are on, the organization can use the models of the platform only when its balance is more than 0.

organizationId
required
string
Media typeapplication/json
object
enabled
required
boolean

Example generated

{
"enabled": true
}

Success

Media typeapplication/json
object
enabled
required
boolean
balanceMicros
required
integer
>= -9007199254740991 <= 9007199254740991
grants
required
Array<object>
object
id
required
string
amountMicros
required
integer
>= -9007199254740991 <= 9007199254740991
note
required
string
createdBy
required
string
createdAt
required
string

Example generated

{
"enabled": true,
"balanceMicros": 1,
"grants": [
{
"id": "example",
"amountMicros": 1,
"note": "example",
"createdBy": "example",
"createdAt": "example"
}
]
}

AuthenticationRequired

Media typeapplication/json
object
_tag
required
string
Allowed values: AuthenticationRequired

Example

{
"_tag": "AuthenticationRequired"
}

@nmnmcc/ability/Authorizer/Forbidden | MembershipRequired | ForbiddenOrigin

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: Forbidden
action
required
string
kind
required
string
field
string
reason
string

Example

{
"_tag": "Forbidden"
}

OrganizationNotFound

Media typeapplication/json
object
_tag
required
string
Allowed values: OrganizationNotFound
organizationId
required
string

Example

{
"_tag": "OrganizationNotFound"
}

@nmnmcc/ability/Authorizer/Pending

Media typeapplication/json
object
_tag
required
string
Allowed values: Pending
ticket
required
string
reason
string

Example

{
"_tag": "Pending"
}

PlatformUnavailable | OrganizationStorageUnavailable | AuthenticationUnavailable | RequestFailed

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: PlatformUnavailable

Example

{
"_tag": "PlatformUnavailable"
}