Skip to main content
POST
/
api
/
personal-access-tokens
Create token
curl --request POST \
  --url https://api.example.com/api/personal-access-tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "note": "Token used to generate releases",
  "allProjects": true,
  "expiry": "week",
  "projects": [],
  "permissions": []
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "note": "<string>",
  "permissions": [
    "owner"
  ],
  "allProjects": true,
  "projects": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "organisationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "version": "<string>",
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "key": "<string>",
      "protected": true
    }
  ],
  "user": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "email": "[email protected]",
    "type": "<string>",
    "status": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "isService": true
  },
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "token": "<string>",
  "expiresAt": "<string>"
}

Path Parameters

userId
string<uuid> | null
required

Service user ID to create token for (admin only)

Body

application/json
note
string
required

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

Required string length: 1 - 100
Example:

"Token used to generate releases"

allProjects
boolean
required

Indicates if token can be used for all projects.

expiry
enum<string>
required

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

Available options:
week,
month,
three_months,
year,
indefinite
projects
string<uuid>[]

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

permissions
enum<string>[]

List of permissions to grant to the token

Available options:
owner,
documents,
releases,
releases:manage,
releases:deploy,
releases:delete,
integrations:manage,
documents:full,
documents:view-content,
documents:edit-content,
documents:edit-view,
branches,
branches:create,
branches:merge,
branches:delete,
project:manage,
environments,
environments:manage,
environments:delete

Response

200 - application/json

Created personal access token with the generated token value

Created personal access token with the generated token value

id
string<uuid>
required

Unique identifier of the personal access token

note
string
required

Description or note for the token

permissions
enum<string>[]
required

List of permissions granted to this token

Available options:
owner,
documents,
releases,
releases:manage,
releases:deploy,
releases:delete,
integrations:manage,
documents:full,
documents:view-content,
documents:edit-content,
documents:edit-view,
branches,
branches:create,
branches:merge,
branches:delete,
project:manage,
environments,
environments:manage,
environments:delete
allProjects
boolean
required

Whether the token has access to all projects

projects
object[]
required

List of projects the token has access to

user
object
required

User who owns the token

createdAt
string
required

Timestamp when the token was created

updatedAt
string
required

Timestamp when the token was last updated

token
string
required

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

expiresAt
string | null

Timestamp when the token expires, null if indefinite