v7

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-013764062.2 MB
API tokens

Create API token

Create an API token of a specific type: one of client, admin, frontend, backend.

post/api/admin/api-tokens

Request body

expiresAtstring date-time

The time when this token should expire.

typestring required

A client or frontend token. Must be one of the strings "client" (deprecated), "backend" (preferred over "client") or "frontend" (not case sensitive).

environmentstring

The environment that the token should be valid for. Defaults to "default"

projectstring

The project that the token should be valid for. Defaults to "*" meaning every project. This property is mutually incompatible with the projects property. If you specify one, you cannot specify the other.

projectsstring[]

A list of projects that the token should be valid for. This property is mutually incompatible with the project property. If you specify one, you cannot specify the other.

tokenNamestring required

The name of the token.

Example request

{
  "expiresAt": "2023-07-04T11:26:24+02:00",
  "type": "frontend",
  "environment": "development",
  "project": "project-851",
  "projects": [
    "project-851",
    "project-852"
  ],
  "tokenName": "token-64522"
}

Response

The resource was successfully created.

secretstring nullable

The token used for authentication.

tokenNamestring required

A unique name for this particular token

type'client' | 'admin' | 'frontend' | 'backend' required

The type of API token

environmentstring

The environment the token has access to.

projectstring

The project this token belongs to.

projectsstring[] required

The list of projects this token has access to. If the token has access to specific projects they will be listed here. If the token has access to all projects it will be represented as [*]

expiresAtstring date-time nullable

The token's expiration date. NULL if the token doesn't have an expiration set.

createdAtstring date-time required

When the token was created.

seenAtstring date-time nullable

When the token was last seen/used to authenticate with. NULL if the token has not yet been used for authentication.

aliasstring nullable

Alias is no longer in active use and will often be NULL. It's kept around as a way of allowing old proxy tokens created with the old metadata format to keep working.

secureboolean nullable

True if using the new api token format. This means copy token will no longer work

Example response

{
  "secret": "project:environment.xyzrandomstring",
  "tokenName": "some-user",
  "type": "client",
  "environment": "development",
  "project": "developerexperience",
  "projects": [
    "developerexperience",
    "enterprisegrowth"
  ],
  "expiresAt": "2023-04-19T08:15:14.000Z",
  "createdAt": "2023-04-19T08:15:14.000Z",
  "seenAt": "2023-04-19T08:15:14.000Z",
  "alias": "randomid-or-some-alias",
  "secure": true
}