Create Api Key
Create a personal access token (`ro_pat_...`) for this workspace. It acts as you, capped by your current role and by its scopes; send it as `Authorization: Bearer <key>` (no `X-Workspace-Id` needed). The key is in the response only once. Granting `admin` needs the admin role; at most `API_KEY_MAX_PER_WORKSPACE` (default 50) active keys per workspace.
API key access
/api/v1/workspaces/current/api-keysAccess token from /api/v1/auth/login, or an API key (ro_pat_..., RO-176) from /api/v1/workspaces/current/api-keys: the key implies its workspace and needs the route's scope. MCP connectors (/api/v1/mcp only) may use an OAuth access token (ro_oat_..., RO-284).
In: header
Header Parameters
Id of the workspace to act on (must be a member).
1 <= length <= 100Scopes to grant, e.g. leads:read, sequences:* (<resource>:* = read and write).
admin needs the admin role.
1 <= items <= 40Days until the key expires; null or absent: never.
int641 <= value <= 3650Response Body
curl -X POST "http://localhost:8000/api/v1/workspaces/current/api-keys" \ -H "X-Workspace-Id: string" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "scopes": [ "string" ] }'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"key_prefix": "string",
"scopes": [
"string"
],
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
"user_email": "string",
"active": true,
"created_at": "2019-08-24T14:15:22Z",
"expires_at": "2019-08-24T14:15:22Z",
"last_used_at": "2019-08-24T14:15:22Z",
"revoked_at": "2019-08-24T14:15:22Z",
"key": "ro_pat_Ab3dEfGhIjKlMnOpQrStUvWxYz0123456789abcdefg"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Rebuild Analytics
Queue a recomputation of this workspace's rollups for a day range from the raw events (admin+). One rebuild per workspace waits at a time: while one is queued or running, it is returned (`created: false`). AI cost metrics are not rebuilt.
List Api Keys
Your API keys in this workspace (admins and owners: every member's), newest first, revoked ones included, with the grantable scopes. Signed-in users only: an API key gets 403 here.