Create sub-account
Create a new sub-account (project) with its own API key. All charges are billed to the parent team's balance. Use creditLimit to set a spending cap. The sub-account's API key is returned only in the creation response. Requires a parent project API key; sub-account API keys receive HTTP 403.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Body
application/json
namestringrequiredName of the sub-account.
Limitsmax length 200externalIdstringExternal reference ID for your own tracking.
creditLimitintegerSpending cap in cents. When reached, messages from this sub-account will be blocked. Omit or set to 0 for no limit.
Limitsmin 0metadataobject
Responses
201Sub-account created.
subAccountobjectrequired9 properties
idstringrequirednamestringrequiredexternalIdstringExternal reference ID set by the parent account.
statusstringrequiredactiveandinactiveare set with PATCH.pending_deletionis read-only: the sub-account was deactivated with DELETE, its API keys are revoked, and it is removed after 14 days.One ofactiveinactivepending_deletiontotalSpentintegerrequiredTotal amount spent by this sub-account in cents.
creditLimitintegerSpending cap in cents. When reached, messages from this sub-account will be blocked.
metadataobjectapiKeystringAPI key for the sub-account. Only returned on creation.
createdAtstring<date-time>required
400Invalid request.
codestringrequiredmessagestringrequireddetailsobject
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobject
403Forbidden. Sub-account API keys cannot manage sub-accounts.
codestringrequiredmessagestringrequireddetailsobject
409A sub-account with this `externalId` already exists in the team.
codestringrequiredmessagestringrequireddetailsobject