• Русский
  • AccessToken [v1]

    /auth/v1/accesstoken

    post Create an API Token

    Creates a new API access token for the current authenticated user. The token inherits the same permissions as the user and can be used for API authentication. It can be configured with an optional expiration time. If no expiration is set, the token will be permanent.

    Request Body

    AccessTokenRequest

    Response

    • 201 AccessToken: Successfully created access token
    • 401 : Unauthorized - Invalid or missing authentication credentials

    AccessTokenRequest

    • expiration: integer

      Token expiration timestamp in seconds. For permanent tokens, leave this field empty or omit it.

    • description: string

      Description of the token

    AccessToken

    • id: string

      Unique identifier of the token

    • token: string

      The access token in JWT format

    • timestamp: integer

      Token issuance timestamp in seconds

    • expiration: integer

      Token expiration timestamp in seconds

    • description: string

      Description of the token

    API usage

    Use this API to create an API token for the current authenticated user.

    Request example

    POST /auth/v1/accesstoken

    Request body:

    FieldTypeDescription
    descriptionstringToken description, required. Max 64 characters.
    expirationintegerToken expiration timestamp in seconds. If omitted, the backend uses configured default behavior.
    {
      "description": "ci token",
      "expiration": 1760000000
    }

    Response example

    {
      "id": "3f8b6c9f-8cb5-4f75-8f8d-2f2e4e0c0f89",
      "token": "eyJhbGciOiJSUzI1NiIs...",
      "timestamp": 1760000000,
      "expiration": 1760003600,
      "description": "ci token"
    }

    Notes

    • The token inherits the permissions of the current user.
    • description cannot be empty and must be 64 characters or fewer.
    • If expiration is omitted or 0, the backend uses the configured default value.