Cloud

Create token

Create a token.

post/api/v1/tokens

Request body

expiresAtstring date-time nullable

The date and time the token expires.

namestring required

The name of the token.

permissionsTokenPermission[] required

The permissions of the token.

role'org:openmeter_read_only' | 'org:openmeter_read_write'

The assigned role of the token.

Example request

{
  "expiresAt": "2023-01-01T01:01:01.001Z",
  "name": "My Token",
  "role": "org:openmeter_read_only"
}

Response

The request has succeeded and a new resource has been created as a result.

createdAtstring date-time required

The date and time the token was created.

createdBystring required

The user that created the token.

expiresAtstring date-time nullable

The date and time the token expires.

idstring required

Readonly unique ULID identifier.

namestring required

The name of the token.

permissionsTokenPermission[] required

The permissions of the token.

role'org:openmeter_read_only' | 'org:openmeter_read_write'

The assigned role of the token.

tokenstring required

The token secret. Full secret is only visible when creating a new token. When listing tokens, the secret is redacted to the last 5 characters.

Example response

{
  "createdAt": "2023-01-01T01:01:01.001Z",
  "expiresAt": "2023-01-01T01:01:01.001Z",
  "id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
  "name": "My Token",
  "role": "org:openmeter_read_only"
}

Changes