Skip to content

personal_tokens_partial_update

PATCH
/api/personal-tokens/{id}/
curl --request PATCH \
--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 }'

Update (partial) a personal access token.

Parameters

request : Request The request object containing the token’s details.

Returns

Response A response containing the updated token’s information.

id
required
integer

A unique integer value identifying this Personal Access Token.

Serializer for the PersonalAccessToken model.

object
id
integer
name

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

string
<= 255 characters
token_preview

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
string format: date-time
last_used_at
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
}
Media typeapplication/json
object
code
required
string
>= 1 characters
message
required
string
>= 1 characters
details
required
Array<object>
object
parameter
string
nullable
code
string
nullable
message
string

Example

{
"code": "query_validation_error",
"message": "Invalid query parameters. Check the `details` property for more details.",
"details": [
{
"parameter": "is_active",
"code": "body_validation_error",
"message": "A revoked token cannot be modified."
}
]
}