Skip to content

personal_tokens_list

GET
/api/personal-tokens/
curl --request GET \
--url https://example.com/api/personal-tokens/ \
--header 'Authorization: Bearer <token>'

ViewSet to manage Personal Access Tokens.

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.

Media typeapplication/json
object
count
required
integer
next
string format: uri
nullable
previous
string format: uri
nullable
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
<= 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

{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2"
}