Personal Access Tokens
Operations Summary
| Method | Endpoint | Description |
|---|---|---|
| Core CRUD | ||
| GET | /api/personal-access-tokens/ |
List Personal Access Tokens |
| GET | /api/personal-access-tokens/{uuid}/ |
Retrieve |
| POST | /api/personal-access-tokens/ |
Create a personal access token |
| DELETE | /api/personal-access-tokens/{uuid}/ |
Revoke a personal access token |
| Other Actions | ||
| GET | /api/personal-access-tokens/available_binding_targets/ |
List entity types the caller can bind each permission to |
| GET | /api/personal-access-tokens/available_scopes/ |
List available scopes for PAT creation |
| POST | /api/personal-access-tokens/{uuid}/rotate/ |
Rotate a personal access token |
Core CRUD
List Personal Access Tokens
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 | |
- API Source:
personal_access_tokens_list
1 2 3 4 5 6 7 8 9 10 | |
| Name | Type | Description |
|---|---|---|
page |
integer | A page number within the paginated result set. |
page_size |
integer | Number of results to return per page. |
200 -
The response body is an array of objects, where each object has the following structure:
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
name |
string | |
token_prefix |
string | |
scopes |
array of strings | |
allowed_scopes |
array of objects | |
allowed_scopes.type |
string | |
allowed_scopes.uuid |
string (uuid) | |
allowed_scopes.name |
string | |
expires_at |
string (date-time) | |
is_active |
boolean | |
last_used_at |
string (date-time) | |
last_used_ip |
any | An IPv4 or IPv6 address. |
use_count |
integer | |
created |
string (date-time) |
Retrieve
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
- API Source:
personal_access_tokens_retrieve
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
200 -
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
name |
string | |
token_prefix |
string | |
scopes |
array of strings | |
allowed_scopes |
array of objects | |
allowed_scopes.type |
string | |
allowed_scopes.uuid |
string (uuid) | |
allowed_scopes.name |
string | |
expires_at |
string (date-time) | |
is_active |
boolean | |
last_used_at |
string (date-time) | |
last_used_ip |
any | An IPv4 or IPv6 address. |
use_count |
integer | |
created |
string (date-time) |
Create a personal access token
1 2 3 4 5 6 7 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
- Model Source:
PersonalAccessTokenCreateRequest - API Source:
personal_access_tokens_create
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | ✓ | |
scopes |
array of strings | ✓ | |
allowed_scopes |
array of objects | Optional list of entity bindings restricting where this token can act. Empty list = no entity restriction. | |
allowed_scopes.type |
string | ✓ | |
allowed_scopes.uuid |
string (uuid) | ✓ | |
expires_at |
string (date-time) | ✓ |
201 -
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
name |
string | |
token |
string | Plaintext token — shown only once. |
scopes |
array of strings | |
allowed_scopes |
array of objects | |
allowed_scopes.type |
string | |
allowed_scopes.uuid |
string (uuid) | |
allowed_scopes.name |
string | |
expires_at |
string (date-time) | |
created |
string (date-time) |
Revoke a personal access token
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
- API Source:
personal_access_tokens_destroy
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
204 - No response body
Other Actions
List entity types the caller can bind each permission to
For each permission, which TYPE_MAP keys the caller could bind a PAT to.
Drives the create-PAT frontend's type picker. For staff users every type is offered for every permission (they bypass UserRole checks). For other users we return only types where they hold an active role granting the permission directly (the binding then inherits to descendants at request time).
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
| Name | Type | Description |
|---|---|---|
page |
integer | A page number within the paginated result set. |
page_size |
integer | Number of results to return per page. |
200 -
The response body is an array of objects, where each object has the following structure:
| Field | Type |
|---|---|
permission |
string |
types |
array of strings |
List available scopes for PAT creation
Return permissions the current user can delegate to a PAT.
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 | |
- API Source:
personal_access_tokens_available_scopes_list
1 2 3 4 5 6 7 8 9 10 | |
| Name | Type | Description |
|---|---|---|
page |
integer | A page number within the paginated result set. |
page_size |
integer | Number of results to return per page. |
200 -
The response body is an array of objects, where each object has the following structure:
| Field | Type |
|---|---|
permission |
string |
description |
string |
Rotate a personal access token
Atomically revoke the old token and create a new one with the same scopes and bindings.
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
- API Source:
personal_access_tokens_rotate
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| Name | Type | Required |
|---|---|---|
uuid |
string (uuid) | ✓ |
201 -
| Field | Type | Description |
|---|---|---|
uuid |
string (uuid) | |
name |
string | |
token |
string | Plaintext token — shown only once. |
scopes |
array of strings | |
allowed_scopes |
array of objects | |
allowed_scopes.type |
string | |
allowed_scopes.uuid |
string (uuid) | |
allowed_scopes.name |
string | |
expires_at |
string (date-time) | |
created |
string (date-time) |