API Tokens

Create API token

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 body

namestring required

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

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

Permission scope:

  • 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.

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

Changed in 3 of the 36 revisions of this API.38

    • removed the ADMIRAL_REQUIRED enum value from the code response property for the response status 400

      response-property-enum-value-removed

    • removed the ADMIRAL_REQUIRED enum value from the code response property for the response status 403

      response-property-enum-value-removed

    • removed the ADMIRAL_REQUIRED enum value from the code response property for the response status 409

      response-property-enum-value-removed

    • removed the ADMIRAL_REQUIRED enum value from the code response property for the response status 500

      response-property-enum-value-removed

    • added the non-success response with the status 409

      response-non-success-status-added

    • added the new PAID_REQUIRED enum value to the code response property for the response status 400

      response-property-enum-value-added

    • added the new PAID_REQUIRED enum value to the code response property for the response status 403

      response-property-enum-value-added

    • added the new PAID_REQUIRED enum value to the code response property for the response status 500

      response-property-enum-value-added

    • removed the PRO_REQUIRED enum value from the code response property for the response status 400

      response-property-enum-value-removed

    • removed the PRO_REQUIRED enum value from the code response property for the response status 403

      response-property-enum-value-removed

    • removed the PRO_REQUIRED enum value from the code response property for the response status 500

      response-property-enum-value-removed