Skip to main content
PATCH
Reallocate Credit Limits
Set every sub-workspace’s credit limit in one call, and optionally the family total. Postpaid families in individual billing mode only.

When to use

  • Splitting the family’s credit limit across clients or teams.
  • Raising one client’s limit at month end while keeping the total unchanged.

Request parameters

Rules

  • A sub-workspace’s limit cannot go below what it has already used this month.
  • The sum of all allocations cannot exceed the family total. Allocating less than the total is allowed; the remainder stays with the primary.
  • What remains with the primary must still cover the primary’s own utilized amount.

Integration notes

  • Authenticate with the primary workspace’s API key.
  • Read the current limits and usage from Get Sub-workspaces first, then send the full map.
  • Amounts in the response are decimal strings ("200000.00"), unlike the read endpoints.
In a common-billing family there are no per-sub-workspace limits: every charge utilizes the primary’s single credit limit. This endpoint returns 400 This family uses common billing; per-sub credit limits do not exist. Allocate concurrency instead.

Error responses

  • 400: Credit-limit reallocation applies to postpaid families only.
  • 400: This family uses common billing; per-sub credit limits do not exist.
  • 400: Allocations must cover every active sub-workspace exactly once. Missing: [...]; unknown: [...].
  • 400: Credit limit 100.00 for sub-workspace 'Mumbai Collections' is below its utilized amount 34210.50.
  • 400: The total credit limit across sub-workspaces must not exceed the parent workspace's credit limit (500000.00); allocations sum to 600000.00.
  • 400: These allocations would leave the primary workspace with 1000.00, below its already-utilized 12500.00. Lower the sub-workspace limits or raise the primary credit limit.
  • 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

X-API-KEY
string
required

(Required) The API key of the PRIMARY workspace. A sub-workspace's key is refused with 400.

Example:

"7251cb4b-3373-43a4-844c-b27a1d45e0c9"

Body

application/json
allocations
object
required

(Required) sub_workspace_id -> new credit limit. Must include every active sub-workspace exactly once. Values >= 0, two decimals.

parent_credit_limit
number

(Optional) New family total (the primary's credit limit). Omit to keep the current total.

Required range: x >= 0
Example:

500000

Response

Successful Response: The applied limits. Amounts are decimal strings.

parent_workspace_id
string
Example:

"2f9a1c44-7e88-4bb1-9a01-5d3c2e7f6a11"

parent_credit_limit
string

The family total, as a decimal string.

Example:

"500000.00"

allocations
object
Example:
primary
object