Skip to main content
POST
cURL
An entity is a user, seat, agent or workspace inside one customer. Send customerId and your own entityId, with either or both of:
  • allowanceCredits: credits per billing period that only this entity can spend. It spends them before the customer’s shared credits. They’re granted while the customer has a plan (paid or free), for the plan’s billing period, so a customer without a plan gives its entities no allowance.
  • capCredits: the most this entity may draw from the customer’s shared credits and overage per billing period. Its own allowance doesn’t count against it. 0 lets it spend only its allowance.
Then pass entityId to check, track and reservations to spend as that entity. A track that would pass the cap returns 409 entity_cap_reached with capRemaining. The same call updates an entity: omitted fields keep their values and null clears one. A changed allowance applies to the current period at once; credits already spent stay spent. Calling it for a deleted entity’s ID restores it (created: true). The response is the entity with its balance, as Get an entity returns it. An unknown customer returns 404 customer_not_found. Needs the Customers permission at Write.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
customerId
string
required

Your ID for the customer, such as your user ID.

Required string length: 1 - 255
entityId
string
required

Your ID for the user, seat or workspace, unique within the customer.

Required string length: 1 - 255
name
string | null

A label for the entity, such as the user's name. Null clears it.

Required string length: 1 - 255
allowanceCredits
integer | null

Credits per billing period only this entity can spend, before the shared pool. Granted while the customer has a plan. Null: none.

Required range: x <= 2147483647
capCredits
integer | null

The most this entity may draw from the customer's shared credits and overage per billing period. Null: no cap.

Required range: 0 <= x <= 2147483647

Response

The entity, created, updated or restored

entityId
string
required
customerId
string
required
name
string | null
required
allowanceCredits
integer | null
required
capCredits
integer | null
required
Required range: x >= 0
createdAt
string<date-time>
required
availableCredits
integer
required

What the entity can spend now: its allowance left, plus the shared credits it may still draw under its cap.

Required range: x >= 0
allowanceRemaining
integer
required

Its own credits left this period, after its locks' holds: its allowance and the credits of any license seat it holds. 0 without either.

Required range: x >= 0
periodUsage
integer
required

Shared credits and overage it drew this period. Its allowance doesn't count.

Required range: x >= 0
capRemaining
integer | null
required

Shared credits it may still draw this period, after its locks' holds. Null without a cap.

Required range: x >= 0
heldCredits
integer
required

Credits its active locks hold.

Required range: x >= 0
periodStart
string<date-time>
required
periodEnd
string<date-time>
required
plans
object[]
required

The plans attached to the entity (POST /v1/billing/attach with entityId), its own grants and lifecycle, billed on the customer's bill.

created
boolean
required

True when the entity is new, or a deleted one restored.

seats
object[]

The license seats it holds, by seat plan (POST /v1/licenses/assign). Always sent.