API Reference
API Tokens
Reading the metadata of the organization's API keys.
The API tokens endpoints read the organization's API keys: their names, scopes, routers and creators. They never return a key's secret, carry no ETag, and have no writes; keys are created and revoked on the API Keys page. See API Key.
| Method | Path | Description | Scope |
|---|---|---|---|
| GET | /v1/api-tokens | List API keys. Paginated. | api_tokens:read |
| GET | /v1/api-tokens/{id} | Get one API key. | api_tokens:read |
| Field | Type |
|---|---|
id | string |
The key id, prefixed tok_. | |
name | string |
| The key name. | |
description | string or null |
| The key description. | |
key_prefix | string |
| The start of the key, to recognize it. | |
enabled | boolean |
| Whether the key works. | |
expires_at | string or null |
| When the key expires, or null for never. | |
scopes | array or null |
| The scopes, or null for full control. | |
router_ids | array or null |
| The routers the key is limited to, or null for every router. | |
agent_id | string or null |
| The agent the key belongs to, if any. | |
created_by | object or null |
| The person, API key or machine identity that created it. | |
created_at | string |
| When the key was created. | |
| Code | Status | Meaning |
|---|---|---|
api_token_not_found | 404 | No API key has that id in the organization. |
Was this helpful?