v1

latestOpenAPI 3.1.02026-07-261344388.3 KB
Personal access token

Create token

Create a new personal access token with specified permissions and project access.

post/api/users/service/{userId}/personal-access-tokens

Path parameters

userIdstring uuid nullable required

Service user ID to create token for (admin only)

Request body

notestring required

A descriptive note for the token (1-100 characters)

allProjectsboolean required

Indicates if token can be used for all projects.

projectsstring[]

List of projects where token can be used. Applicable if allProjects is false.

permissionsstring[]

List of permissions to grant to the token

expiry'week' | 'month' | 'three_months' | 'year' | 'indefinite' required

Token expiration period (week, month, three_months, year, or indefinite)

Example request

{
  "note": "Token used to generate releases"
}

Response

Created personal access token with the generated token value

idstring uuid required

Unique identifier of the personal access token

notestring required

Description or note for the token

permissionsstring[] required

List of permissions granted to this token

allProjectsboolean required

Whether the token has access to all projects

createdAtstring required

Timestamp when the token was created

updatedAtstring required

Timestamp when the token was last updated

expiresAtstring nullable

Timestamp when the token expires, null if indefinite

tokenstring required

The generated token value (only returned on create or regenerate)