v7

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-013764062.2 MB
Projects

Create a project API token.

Endpoint that allows creation of project API tokens for the specified project.

post/api/admin/projects/{projectId}/api-tokens

Path parameters

projectIdstring required

Request body

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

expiresAtstring date-time

The date and time when the token should expire. The date should be in ISO 8601 format.

tokenNamestring required

A unique name for this particular token

Example request

{
  "type": "frontend",
  "environment": "development",
  "expiresAt": "2023-10-01T00:00:00Z",
  "tokenName": "some-user"
}

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
}