Skip to content

personal_tokens_update

PUT
/api/personal-tokens/{id}/
curl --request PUT \
--url https://example.com/api/personal-tokens/1/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "scopes": "example", "expires_at": "2026-04-15T12:00:00Z", "is_active": true }'

ViewSet to manage Personal Access Tokens.

id
required
integer

A unique integer value identifying this Personal Access Token.

Serializer for the PersonalAccessToken model.

object
id
required
integer
name
required

Descriptive name of the token (e.g., ‘CI/CD Pipeline’, ‘Mobile App’)

string
<= 255 characters
token_preview
required

Return a preview of the token, which is the first 12 characters of the token key.

Parameters

obj : PersonalAccessToken The PersonalAccessToken object to generate the preview for.

Returns

str A string containing the token preview.

string
scopes

List of permissions (e.g., [‘read’, ‘write’, ‘delete’])

created_at
required
string format: date-time
last_used_at
required
string format: date-time
nullable
expires_at

Optional expiration date

string format: date-time
nullable
is_active
boolean

Example generated

{
"name": "example",
"scopes": "example",
"expires_at": "2026-04-15T12:00:00Z",
"is_active": true
}
Media typeapplication/json

Serializer for the PersonalAccessToken model.

object
id
required
integer
name
required

Descriptive name of the token (e.g., ‘CI/CD Pipeline’, ‘Mobile App’)

string
<= 255 characters
token_preview
required

Return a preview of the token, which is the first 12 characters of the token key.

Parameters

obj : PersonalAccessToken The PersonalAccessToken object to generate the preview for.

Returns

str A string containing the token preview.

string
scopes

List of permissions (e.g., [‘read’, ‘write’, ‘delete’])

created_at
required
string format: date-time
last_used_at
required
string format: date-time
nullable
expires_at

Optional expiration date

string format: date-time
nullable
is_active
boolean

Example generated

{
"name": "example",
"scopes": "example",
"expires_at": "2026-04-15T12:00:00Z",
"is_active": true
}