Skip to content
OCTAVIIUS DOCSCore & Studio 0.2.83
Integrations / 0.2.83

API keys: scope, lifecycle and revocation

Bearer authentication, database and object grants, expiration and application secret rotation.

Application identity and scope

An API key represents an application identity with its own grant set. It does not implicitly inherit the creator’s permissions. Cursor continuity requires the same authentication identity across query, fetch, cancel and close. Rotation must therefore preserve active workflows or arrange their closure before revocation.

Create the key as admin

In Studio Administration → API keys, supply a name and 1..32 grants. Each grant names a database and mode: read or read_write with a nonempty object list, or dbo for the entire database. system is always forbidden. At most 256 non-revoked keys are allowed; an expired non-revoked key still counts. Serialized grant data are limited to 4,000 characters.

The octk_… secret is returned only at creation. Later listing shows an ID, prefix, scope and dates, not the secret. With an admin session, POST /api/keys/create accepts the following JSON; choose an expiry in the future at creation time.

JSON
{
  "name": "application-lecture",
  "expires": "2027-01-31T23:59:59Z",
  "grants": [{"database": "Atelier", "mode": "read",
              "tables": ["dbo.Ventes", "dbo.Clients"]}]
}

Use and restrict the key

Send Authorization: Bearer <secret> to /api/v1/query, /api/v1/fetch, /api/v1/cancel and /api/v1/close. Use the same key throughout a cursor’s lifetime. Every join/subquery source must be authorized. read_write adds writes on listed objects; dbo enables database DDL without server privileges.

Keys do not replace a user session for private notebooks or account administration. Procedures and dynamic SQL do not bypass permission checks on executed statements. Key scopes are separate from account GRANT rules.

Revocation and rotation

Create a new key, deploy it through the application secret store, verify it, then revoke the old key. Admin-session POST /api/keys/revoke receives { "id": "key-id" }. Expired or revoked keys are rejected; applications must treat this as authentication failure and release resources. Do not retry a write under a new identity without knowing whether the earlier write was published.