API Tokens

Create API token

Changed on

Generates a new scoped API token. The full token is only returned in the creation response and cannot be retrieved again. Requires admin role.

Note: API tokens cannot create other API tokens.

post/api/api-tokens

Request

  • Base URL
    https://localhost:1852
  • URL
    https://localhost:1852/api/api-tokens
  • Auth
    HTTP bearer

Request body

namestring required

Human-readable token name. Must be unique among the user's active tokens.

scope'observe-only' | 'read-only' | 'deploy-only' | 'full-admin' required

Permission scope:

  • observe-only - exactly five read-only observation endpoints; requires an expiry
  • read-only - GET requests only
  • deploy-only - Read + stack deploy/stop/restart operations
  • full-admin - All operations (except license, user, and token management)
expires_in30 | 60 | 90 | 365 | null nullable

Token lifetime in days. Use null for no expiry. Required when scope is observe-only, where null is rejected.

Example request

{
  "name": "CI/CD Deploy Token",
  "expires_in": 90
}

Response

Token created. The token field contains the full JWT. Save it now; it will not be shown again.

idinteger required
tokenstring required

Full JWT token. Store securely — this is the only time it's returned.

Changes

    • info

      added the new observe-only enum value to the request property

    • info

      removed the ADMIRAL_REQUIRED enum value from the response property for the response status

    • info

      removed the ADMIRAL_REQUIRED enum value from the response property for the response status

    • info

      removed the ADMIRAL_REQUIRED enum value from the response property for the response status

    • info

      removed the ADMIRAL_REQUIRED enum value from the response property for the response status