Management API: Account

Last updated 2 November 2026

View .md

The caller's account, its regions, members and Agents. The overview covers what every operation shares: authentication, roles, errors, pagination, idempotency and If-Match.

Read the caller's account, membership and limits

GET /v1/account · CLI: tonbo account show

Needs account.read, which owner, admin and member hold. A narrowed key may call it.

Response

StatusAnswer
200The account
FieldTypeRequiredDescription
dataAccountyes
HeaderStatusDescription
ETag200Current resource version for optional conditional updates.
WWW-Authenticate401Authentication scheme required by this API.
Retry-After429Seconds before the client should retry.
Example 200 body
{
  "data": {
    "id": "3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
    "kind": "user",
    "name": "<name>",
    "member": {
      "kind": "user",
      "subject": "agent.3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
      "role": "owner"
    },
    "limits": {
      "buckets": 0
    }
  }
}

Errors

StatusCodeWhenSend againWhat to do
401exchange_requiredThe key acts as an Agent, and an Agent’s key is never sent itself.NoExchange the key for a token at the endpoint the answer’s token_endpoint names, and send the token as Authorization: Bearer. (more)
401unauthenticatedThe request carries no key or token, or one that is invalid, expired or revoked.NoSend a valid key, or a token that has not expired, as Authorization: Bearer. (more)
403forbiddenThe key’s role does not hold the capability the operation needs, the key is narrowed away from the resource, or the account already holds as many of the resource as it may.NoUse a key whose role holds the capability, or one that is not narrowed; delete what you no longer need, or ask for a higher limit. (more)
429rate_limitedThe key or the account sent more requests than its rate allows.After Retry-AfterWait for the seconds Retry-After names, then send the request again; spread requests out if it recurs. (more)

Retries

  • A read: sending it again changes nothing.
  • 429 carry Retry-After: wait that many seconds, then send the same request again.
Request
curl -sS "https://api.tonbo.dev/v1/account" \
  -H "Authorization: Bearer $TONBO_API_KEY"

List the regions new resources can be created in

GET /v1/regions · CLI: tonbo region list

Needs account.read, which owner, admin and member hold. A narrowed key may call it.

Response

StatusAnswer
200Regions
FieldTypeRequiredDescription
dataarray of Regionyes
HeaderStatusDescription
WWW-Authenticate401Authentication scheme required by this API.
Retry-After429Seconds before the client should retry.
Example 200 body
{
  "data": [
    {
      "id": "<id>",
      "url": "https://example.com",
      "default": false
    }
  ]
}

Errors

StatusCodeWhenSend againWhat to do
401exchange_requiredThe key acts as an Agent, and an Agent’s key is never sent itself.NoExchange the key for a token at the endpoint the answer’s token_endpoint names, and send the token as Authorization: Bearer. (more)
401unauthenticatedThe request carries no key or token, or one that is invalid, expired or revoked.NoSend a valid key, or a token that has not expired, as Authorization: Bearer. (more)
403forbiddenThe key’s role does not hold the capability the operation needs, the key is narrowed away from the resource, or the account already holds as many of the resource as it may.NoUse a key whose role holds the capability, or one that is not narrowed; delete what you no longer need, or ask for a higher limit. (more)
429rate_limitedThe key or the account sent more requests than its rate allows.After Retry-AfterWait for the seconds Retry-After names, then send the request again; spread requests out if it recurs. (more)

Retries

  • A read: sending it again changes nothing.
  • 429 carry Retry-After: wait that many seconds, then send the same request again.
Request
curl -sS "https://api.tonbo.dev/v1/regions" \
  -H "Authorization: Bearer $TONBO_API_KEY"

List the account's people and Agents with their roles

GET /v1/members · CLI: tonbo member list

Needs account.read, which owner, admin and member hold. A narrowed key may call it.

Parameters

NameInTypeRequiredDescription
cursorquerystringnoOpaque cursor tied to the original query shape. At least 1 characters.
limitqueryintegernoThe most items one page holds, 1 to 200; 50 when omitted. A page may hold fewer; read on with next_cursor until it is null. Default 50. 1 to 200.

Response

StatusAnswer
200Members
FieldTypeRequiredDescription
dataarray of Memberyes
next_cursorstring or nullyesOpaque cursor of the next page; null on the last page.
HeaderStatusDescription
WWW-Authenticate401Authentication scheme required by this API.
Retry-After429Seconds before the client should retry.
Example 200 body
{
  "data": [
    {
      "kind": "user",
      "subject": "agent.3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
      "role": "owner",
      "name": "<name>",
      "display_name": "<display_name>",
      "created_at": "2026-11-02T09:30:00.000Z"
    }
  ],
  "next_cursor": "<next_cursor>"
}

Errors

StatusCodeWhenSend againWhat to do
401exchange_requiredThe key acts as an Agent, and an Agent’s key is never sent itself.NoExchange the key for a token at the endpoint the answer’s token_endpoint names, and send the token as Authorization: Bearer. (more)
401unauthenticatedThe request carries no key or token, or one that is invalid, expired or revoked.NoSend a valid key, or a token that has not expired, as Authorization: Bearer. (more)
403forbiddenThe key’s role does not hold the capability the operation needs, the key is narrowed away from the resource, or the account already holds as many of the resource as it may.NoUse a key whose role holds the capability, or one that is not narrowed; delete what you no longer need, or ask for a higher limit. (more)
422validation_errorA parameter, header or body field breaks its rule; errors names each field.NoCorrect the fields errors names; the operation’s reference gives each one’s rule. (more)
429rate_limitedThe key or the account sent more requests than its rate allows.After Retry-AfterWait for the seconds Retry-After names, then send the request again; spread requests out if it recurs. (more)

Retries

  • A read: sending it again changes nothing.
  • 429 carry Retry-After: wait that many seconds, then send the same request again.
Request
curl -sS "https://api.tonbo.dev/v1/members" \
  -H "Authorization: Bearer $TONBO_API_KEY"

Change a member's role, or rename an Agent

PATCH /v1/members/{subject} · CLI: tonbo member update

Needs members.write, which owner and admin hold. A narrowed key may not.

Owners and admins give a person or an Agent another role; only an owner grants owner. name renames an Agent: it follows the Agent name rule and is unique among the account's active Agents (409 otherwise), and the Agent keeps its id, keys, home region and public hostname. A person's name belongs to their own profile, so name on a person is refused with 422 validation_error on the field name. Both fields in one request change together or not at all. People change members; an Agent's credential is refused with 403.

Parameters

NameInTypeRequiredDescription
subjectpathstringyesThe member to change, by the subject GET /v1/members lists: a person's user id, or agent.<agent id> for an Agent. Matches ^[a-z0-9._-]{1,64}$.

Request body

application/json, required. Unknown fields are refused.

At least one field.

FieldTypeRequiredDescription
roleone of "owner", "admin" or "member"noThe member's new role. Only an owner grants owner, and an account always keeps at least one person as owner.
namestringnoThe Agent's new name; refused for a person. 1 to 40 characters. Matches ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$.

Response

StatusAnswer
200The member
FieldTypeRequiredDescription
dataMemberyes
HeaderStatusDescription
WWW-Authenticate401Authentication scheme required by this API.
Retry-After429Seconds before the client should retry.
Example 200 body
{
  "data": {
    "kind": "user",
    "subject": "agent.3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
    "role": "owner",
    "name": "<name>",
    "display_name": "<display_name>",
    "created_at": "2026-11-02T09:30:00.000Z"
  }
}

Errors

StatusCodeWhenSend againWhat to do
401exchange_requiredThe key acts as an Agent, and an Agent’s key is never sent itself.NoExchange the key for a token at the endpoint the answer’s token_endpoint names, and send the token as Authorization: Bearer. (more)
401unauthenticatedThe request carries no key or token, or one that is invalid, expired or revoked.NoSend a valid key, or a token that has not expired, as Authorization: Bearer. (more)
403forbiddenThe key’s role does not hold the capability the operation needs, the key is narrowed away from the resource, or the account already holds as many of the resource as it may.NoUse a key whose role holds the capability, or one that is not narrowed; delete what you no longer need, or ask for a higher limit. (more)
404not_foundNo live resource of the key’s account has that name or id, or the key is narrowed away from it.NoCheck the name, and that the key belongs to the account that holds it; list the resources to see what exists. (more)
409conflictThe name is held by another live resource of the account, the Idempotency-Key already created another resource or one since deleted, or the resource’s current state does not allow the change. detail says which, and errors names the field.NoPick another name or a new Idempotency-Key, or read the resource again and act on its current state. (more)
422validation_errorA parameter, header or body field breaks its rule; errors names each field.NoCorrect the fields errors names; the operation’s reference gives each one’s rule. (more)
429rate_limitedThe key or the account sent more requests than its rate allows.After Retry-AfterWait for the seconds Retry-After names, then send the request again; spread requests out if it recurs. (more)

Retries

  • It takes no Idempotency-Key; its description above says what sending it again does.
  • 429 carry Retry-After: wait that many seconds, then send the same request again.
Request
curl -sS -X PATCH "https://api.tonbo.dev/v1/members/<subject>" \
  -H "Authorization: Bearer $TONBO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Create an Agent, an identity with a role in the account

POST /v1/agents · CLI: tonbo agent create

Needs agents.create, which owner and admin hold. A narrowed key may not.

Owners and admins create Agents; only an owner grants owner. A replay with the same Idempotency-Key returns the Agent the first request created.

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringyesA value you choose for this one creation, 1 to 255 characters, such as a new UUID. Send a new one for each resource you create, and the same one only to retry that request after a timeout or a lost answer: the retry answers what the first request created, in its current state, and never creates a second. A key reused for a different database, stream or Machine answers 409. 1 to 255 characters.

Request body

application/json, required. Unknown fields are refused.

FieldTypeRequiredDescription
namestringyesThe Agent's name; 409 when an active Agent of the account has it. 1 to 40 characters. Matches ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$.
roleone of "owner", "admin" or "member"noThe Agent's role; member when omitted. Only an owner grants owner. Default "member".
regionstringnoThe Agent's home region; the only open region when omitted.

Response

StatusAnswer
201The Agent
FieldTypeRequiredDescription
dataAccountAgentyes
HeaderStatusDescription
WWW-Authenticate401Authentication scheme required by this API.
Retry-After429Seconds before the client should retry.
Example 201 body
{
  "data": {
    "id": "3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
    "subject": "agent.3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
    "name": "<name>",
    "role": "owner",
    "region": "<region>",
    "created_at": "2026-11-02T09:30:00.000Z"
  }
}

Errors

StatusCodeWhenSend againWhat to do
401exchange_requiredThe key acts as an Agent, and an Agent’s key is never sent itself.NoExchange the key for a token at the endpoint the answer’s token_endpoint names, and send the token as Authorization: Bearer. (more)
401unauthenticatedThe request carries no key or token, or one that is invalid, expired or revoked.NoSend a valid key, or a token that has not expired, as Authorization: Bearer. (more)
403forbiddenThe key’s role does not hold the capability the operation needs, the key is narrowed away from the resource, or the account already holds as many of the resource as it may.NoUse a key whose role holds the capability, or one that is not narrowed; delete what you no longer need, or ask for a higher limit. (more)
409idempotency_conflictThe Idempotency-Key was already sent with a different request.NoSend the request with a new Idempotency-Key, or send the request the key was first used for. (more)
409conflictThe name is held by another live resource of the account, the Idempotency-Key already created another resource or one since deleted, or the resource’s current state does not allow the change. detail says which, and errors names the field.NoPick another name or a new Idempotency-Key, or read the resource again and act on its current state. (more)
422validation_errorA parameter, header or body field breaks its rule; errors names each field.NoCorrect the fields errors names; the operation’s reference gives each one’s rule. (more)
429rate_limitedThe key or the account sent more requests than its rate allows.After Retry-AfterWait for the seconds Retry-After names, then send the request again; spread requests out if it recurs. (more)

Retries

  • Send a new Idempotency-Key with each request and the same one when you send it again: a repeat answers what the first request did, and the key reused for a different request answers 409 (see Idempotency).
  • 429 carry Retry-After: wait that many seconds, then send the same request again.
Request
curl -sS "https://api.tonbo.dev/v1/agents" \
  -H "Authorization: Bearer $TONBO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name":"<name>"}'

Objects

Account

FieldTypeRequiredDescription
idstring (uuid)yesThe account's id; a database's and a stream's URL name it after the region's origin.
kindone of "user" or "organization"yesuser for a person's own account, organization for an organization's.
namestringyesThe account's name as the console shows it.
memberobjectyesThe caller's own membership.
member.kindone of "user" or "agent"yesuser when the key acts as a person, agent when it acts as an Agent.
member.subjectstringyesWho the key acts as, a user id or agent.<agent id>. Matches ^[a-z0-9._-]{1,64}$.
member.roleone of "owner", "admin" or "member"yesThe caller's current role, which decides what the key may do.
limitsobjectyesHow much of each resource the account may hold.
limits.bucketsintegeryesLive buckets the account may hold. At least 0.
Example Account
{
  "id": "3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
  "kind": "user",
  "name": "<name>",
  "member": {
    "kind": "user",
    "subject": "agent.3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
    "role": "owner"
  },
  "limits": {
    "buckets": 0
  }
}

AccountAgent

FieldTypeRequiredDescription
idstring (uuid)yesThe Agent's id.
subjectstringyesagent.<id>, the Agent as a member: name it as member to create a key for the Agent, and in PATCH /v1/members/{subject}. Matches ^[a-z0-9._-]{1,64}$.
namestringyesThe Agent's name.
roleone of "owner", "admin" or "member"yesThe Agent's role.
regionstringyesThe Agent's home region, fixed at creation.
created_atstring (date-time)yesWhen the Agent was created.
Example AccountAgent
{
  "id": "3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
  "subject": "agent.3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
  "name": "<name>",
  "role": "owner",
  "region": "<region>",
  "created_at": "2026-11-02T09:30:00.000Z"
}

Member

FieldTypeRequiredDescription
kindone of "user" or "agent"yesuser for a person, agent for an Agent.
subjectstringyesThe member's id in the account, which PATCH /v1/members/{subject} names. Matches ^[a-z0-9._-]{1,64}$.
roleone of "owner", "admin" or "member"yesThe member's role.
namestring or nullyesA person's username, or the Agent's name; null when the person has none.
display_namestring or nullyesA person's display name, or the Agent's name; null when the person has none.
created_atstring (date-time)yesWhen the person or Agent joined the account.
Example Member
{
  "kind": "user",
  "subject": "agent.3f1c2a9e-5b7d-4c8e-9f10-2a3b4c5d6e7f",
  "role": "owner",
  "name": "<name>",
  "display_name": "<display_name>",
  "created_at": "2026-11-02T09:30:00.000Z"
}

Region

FieldTypeRequiredDescription
idstringyesThe region's id, which a creation names as region. Matches ^[a-z]{2}-[a-z]+-[0-9]$.
urlstring (uri)yesThe origin of the data plane in this region; a database's URL is this origin, the account id and the database name, and a bucket's is this origin and the bucket name.
defaultbooleanyesWhether a database goes to this region when its creation names none.
Example Region
{
  "id": "<id>",
  "url": "https://example.com",
  "default": false
}