personal_tokens_retrieve
GET
/api/personal-tokens/{id}/
const url = 'https://example.com/api/personal-tokens/1/';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/personal-tokens/1/ \ --header 'Authorization: Bearer <token>'ViewSet to manage Personal Access Tokens.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
A unique integer value identifying this Personal Access Token.
Responses
Section titled “Responses”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
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
expires_at
Optional expiration date
string format: date-time
is_active
boolean
Example generated
{ "name": "example", "scopes": "example", "expires_at": "2026-04-15T12:00:00Z", "is_active": true}
