The account an API token belongs to, and the token itself. GET /v1
needs no token, so it also serves as a health check. See
Authentication for how tokens
and scopes work.
On this page: Account object, Token object, Show the API's version and links, Show the token's account, Show the calling token, Revoke the calling token.
The Account object
| Field | Type | Description |
|---|---|---|
id | string | The account's slug. Never changes. |
name | string | The account's name. |
contact_email_override | string or null | When set, the only address that gets cluster notifications and billing email. null to use the default. |
created_at | string (date-time) | When it was created. |
The Token object
| Field | Type | Description |
|---|---|---|
key | string | The token's public half: <key> in bonsai_<key>_<secret>. The dashboard lists tokens by it. |
name | string or null | The token's name, or null. |
account | object | The account the token belongs to. |
account.id | string | The account's ID. |
account.name | string | The account's name. |
scopes | array of strings | The scopes the token holds. See Scopes. |
expires_at | string (date-time) or null | null for a token that never expires. |
created_at | string (date-time) | When it was created. |
Show the API's version and links
GET /v1
- Token: none needed.
Needs no token, so it also serves as a health check. Rate-limited by IP address.
Example request
Response
200 OK. The API's name, version and links.
| Field | Type | Description |
|---|---|---|
name | string | Bonsai API. |
version | string | This contract's info.version. |
docs_url | string (URL) | The API reference. |
openapi_url | string (URL) | This contract as JSON. |
tokens_url | string (URL) | The dashboard's API Tokens page, where a token is made by hand. It names no account: it opens the signed-in person's default account. |
Errors
| Status | Codes |
|---|---|
429 | rate_limited |
Show the token's account
GET /v1/account
- Scope:
account:read
What the dashboard's account settings show every member. No billing or payment details.
Example request
Response
200 OK. The account. Returns an Account object.
Errors
| Status | Codes |
|---|---|
401 | unauthorized |
403 | missing_scope |
429 | rate_limited, too_many_failed_authentications |
Show the calling token
GET /v1/token
- Scope: none. Any valid token can call it.
Its key, scopes and expiry. Needs no scope; a token only ever reaches itself.
Example request
Response
200 OK. The token. Returns a Token object.
Errors
| Status | Codes |
|---|---|
401 | unauthorized |
429 | rate_limited, too_many_failed_authentications |
Revoke the calling token
DELETE /v1/token
- Scope: none. Any valid token can call it.
As revoking it in the dashboard does. Needs no scope; a token only ever reaches itself. Every later request with it is a 401.
Example request
Response
204 No Content. Revoked.
Errors
| Status | Codes |
|---|---|
401 | unauthorized |
429 | rate_limited, too_many_failed_authentications |
Ready to power your search with AI?
Launch a fully managed Elasticsearch or OpenSearch cluster, with built-in vector search and AI capabilities.