Reallocate Credit Balances
Prepaid, individual-billing families only. Sets every active sub-workspace’s wallet to an absolute balance; the net difference moves from or to the primary’s unallocated pot, which must be able to cover it. Top up on the primary first, then allocate. Not applicable to common-billing families, where the wallet is shared on the primary.
When to use
- Distributing a top-up made on the primary across clients or teams.
- Pulling unused balance back from one sub-workspace to fund another.
Request parameters
Rules
- The net amount moving out of the primary’s pot cannot exceed what the pot holds. Top up on the primary first, then allocate.
- A sub-workspace with a
0balance cannot place calls; sub-workspaces have no overdraft. - Every move is recorded in the workspace ledgers as a transfer, never as a charge.
Integration notes
- Authenticate with the primary workspace’s API key.
- Read the current wallets and
family.available_potfrom Get Sub-workspaces first, then send the full map. - Amounts in the response are decimal strings (
"5000.00"), unlike the read endpoints.
400 This family uses a shared balance; per-sub wallets do not exist. Allocate concurrency instead.Error responses
- 400:
Balance allocation applies to prepaid families only. - 400:
This family uses a shared balance; per-sub wallets do not exist. - 400:
allocations name workspaces that are not active sub-workspaces of this family: [...] - 400:
allocations must cover every active sub-workspace; missing: [...] - 400:
These allocations need 9000.00 from the primary's pot, which only holds 4000.00. Lower the allocations or add balance to the primary workspace first. - 401: Invalid or missing API key.
- 403:
Sub-workspaces are not enabled for this workspace. - 404:
Workspace is not a sub-workspace family parent.— the primary has no sub-workspaces yet. - 422: Empty map, negative value, or a key that is not a UUID.
Example
Headers
(Required) The API key of the PRIMARY workspace. A sub-workspace's key is refused with 400.
"7251cb4b-3373-43a4-844c-b27a1d45e0c9"
Body
(Required) sub_workspace_id -> the sub-workspace's NEW absolute balance (not a delta). Must include every active sub-workspace exactly once. Values >= 0, two decimals.
Response
Successful Response: The applied balances. Amounts are decimal strings.