personal_tokens_update
const url = 'https://example.com/api/personal-tokens/1/';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","scopes":"example","expires_at":"2026-04-15T12:00:00Z","is_active":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A unique integer value identifying this Personal Access Token.
Request Bodyrequired
Section titled “Request Bodyrequired”Serializer for the PersonalAccessToken model.
object
Descriptive name of the token (e.g., ‘CI/CD Pipeline’, ‘Mobile App’)
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.
List of permissions (e.g., [‘read’, ‘write’, ‘delete’])
Optional expiration date
Example generated
{ "name": "example", "scopes": "example", "expires_at": "2026-04-15T12:00:00Z", "is_active": true}Serializer for the PersonalAccessToken model.
object
Descriptive name of the token (e.g., ‘CI/CD Pipeline’, ‘Mobile App’)
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.
List of permissions (e.g., [‘read’, ‘write’, ‘delete’])
Optional expiration date
Example generated
name=example&scopes=example&expires_at=2026-04-15T12%3A00%3A00Z&is_active=trueSerializer for the PersonalAccessToken model.
object
Descriptive name of the token (e.g., ‘CI/CD Pipeline’, ‘Mobile App’)
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.
List of permissions (e.g., [‘read’, ‘write’, ‘delete’])
Optional expiration date
Responses
Section titled “Responses”Serializer for the PersonalAccessToken model.
object
Descriptive name of the token (e.g., ‘CI/CD Pipeline’, ‘Mobile App’)
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.
List of permissions (e.g., [‘read’, ‘write’, ‘delete’])
Optional expiration date
Example generated
{ "name": "example", "scopes": "example", "expires_at": "2026-04-15T12:00:00Z", "is_active": true}
