personal_tokens_list
GET
/api/personal-tokens/
const url = 'https://example.com/api/personal-tokens/';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/ \ --header 'Authorization: Bearer <token>'ViewSet to manage Personal Access Tokens.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”ordering
string
Which field to use when ordering the results.
page
integer
A page number within the paginated result set.
search
string
A search term.
Responses
Section titled “Responses”Media typeapplication/json
object
count
required
integer
next
string format: uri
previous
string format: uri
results
required
Array<object>
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
{ "count": 123, "next": "http://api.example.org/accounts/?page=4", "previous": "http://api.example.org/accounts/?page=2"}
