Sub-Accounts
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.
POST
/
v1
/
sub-accounts
curl --request POST \
--url https://api.zavu.dev/v1/sub-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Client ABC"
}
'{
"subAccount": {
"id": "<string>",
"name": "Client ABC",
"status": "active",
"totalSpent": 123,
"createdAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"creditLimit": 123,
"metadata": {},
"apiKey": "<string>"
}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "conflict",
"message": "A sub-account with this externalId already exists"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Name of the sub-account.
Maximum string length:
200Example:
"Client ABC"
External reference ID for your own tracking.
Spending cap in cents. When reached, messages from this sub-account will be blocked. Omit or set to 0 for no limit.
Required range:
x >= 0Response
Sub-account created.
Show child attributes
Show child attributes
⌘I
curl --request POST \
--url https://api.zavu.dev/v1/sub-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Client ABC"
}
'{
"subAccount": {
"id": "<string>",
"name": "Client ABC",
"status": "active",
"totalSpent": 123,
"createdAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"creditLimit": 123,
"metadata": {},
"apiKey": "<string>"
}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "conflict",
"message": "A sub-account with this externalId already exists"
}