v7

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-013764062.2 MB
Service Accounts

Create a token for a service account.

Enterprise feature

Creates a new token for the service account identified by the id.

post/api/admin/service-account/{id}/token

Path parameters

idstring required

Request body

descriptionstring required

The PAT's description.

expiresAtstring date-time required

The PAT's expiration date.

Example request

{
  "description": "user:xyzrandomstring",
  "expiresAt": "2023-04-19T08:15:14.000Z"
}

Response

The resource was successfully created.

idinteger required

The PAT's ID. PAT IDs are incrementing integers. In other words, a more recently created PAT will always have a higher ID than an older one.

secretstring

The token used for authentication. It is automatically generated by Unleash when the PAT is created and that is the only time this property is returned.

createdAtstring date-time required

The date and time of when the PAT was created.

seenAtstring date-time nullable

When the PAT was last seen/used to authenticate with. null if it has not been used yet.

userIdinteger

The ID of the user this PAT belongs to.

descriptionstring required

The PAT's description.

expiresAtstring date-time required

The PAT's expiration date.

Example response

{
  "id": 1,
  "secret": "user:xyzrandomstring",
  "createdAt": "2023-04-19T08:15:14.000Z",
  "seenAt": "2023-04-19T08:15:14.000Z",
  "userId": 1337,
  "description": "user:xyzrandomstring",
  "expiresAt": "2023-04-19T08:15:14.000Z"
}