v4

latestOpenAPI 3.0.3raw.githubusercontent.com2026-06-279228.8 KB
Access Tokens

Create access token

Creates a new API key with the specified name, description, expiration, and permissions.

Prerequisite: Authentication must be enabled before calling this endpoint. Call PATCH /auth/enabled with {"enabled": true} using an admin JWT first. If auth_enabled is false, the server rejects this request with 403 Forbidden and the message "API key management API requires auth_enabled=true".

Permission model

Access token permissions use a bitmask model.

NameValueMeaning
read1Read access
write2Write access
admin4Admin access

admin is an independent permission bit. It does not automatically grant read or write.

Common combinations:

BitmaskPermission stringMeaning
1readRead only
2writeWrite only
4adminAdmin only
5read,adminRead and admin
6write,adminWrite and admin
7read,write,adminRead, write, and admin

The create-token API accepts the canonical comma-separated permission names, and the server stores them as the corresponding bitmask.

When using an admin JWT, the server uses the persisted JWT secret from server_params.btr. If ACTIAN_VECTORAI_JWT_SECRET is set at startup, that value overrides the persisted secret and is saved for subsequent restarts.

post/auth/api_key

Headers

Authorizationstring required

Admin JWT or admin access token. Format Bearer <admin-jwt-or-access-token>.

Request body

namestring required

Human-readable name for the token.

descriptionstring

Optional description of the token's intended use.

will_expireboolean

Whether the token expires. When false, the token is valid indefinitely.

expires_in_secondsinteger

Number of seconds until the token expires. Only applies when will_expire is true.

permissionstring required

Comma-separated permission names. Valid values are read, write, admin, or any combination.

Example request

{
  "permission": "read,admin"
}

Response

Token created successfully.

idinteger

Unique identifier for the access token.

namestring

Human-readable name for the token.

descriptionstring

Description of the token's intended use.

api_keystring

The raw API key value. Store this securely, as it cannot be retrieved after creation.

created_atstring date-time

Timestamp when the token was created, in RFC 3339 UTC format.

expired_atstring date-time nullable

Timestamp when the token expires, in RFC 3339 UTC format. null when will_expire is false.

will_expireboolean

Whether the token has an expiration date.

permissionstring

Comma-separated permission names assigned to the token.

All 9 operations