API Tokens

Create an API token

Changed on

Generates a new API token for automation or CI/CD use. The token belongs to the caller unless user_email names someone else, which requires gateway:api_token:manage. Its permissions must be within the owner's current role.

post/api-tokens

Request

  • Base URL: /api/v1 (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/v1/api-tokens
  • Auth: one of:
    • API key in header Cookie
    • API key in header X-CSRF-Token

Request body

expires_atstring

Optional expiry; the token stops working after this time

namestring required
permissionsstring[]

Explicit permissions (overrides role)

rolestring

Role shortcut (viewer, ops, deployer, cicd, admin)

user_emailstring

Response

OK

idinteger required
namestring required
permissionsstring[] required
tokenstring required

Changes