List the authenticated user's access tokens
const url = 'https://gitea.example.com/api/v1/users/example/tokens';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
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://gitea.example.com/api/v1/users/example/tokens \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Username of to user whose access tokens are to be listed
Query Parameters
Section titled “Query Parameters”Page number of results to return (1-based)
Page size of results
Responses
Section titled “Responses”AccessTokenList represents a list of API access token.
object
The timestamp when the token was created
The description of the token
Whether the token is disabled
The timestamp when the token stops working, absent if it never does
The unique identifier of the access token
The kind of the token: classic or fine_grained
The timestamp when the token was last used
The name of the access token
The user or organization a fine-grained token is limited to
The repository selection of a fine-grained token: public, all or selected
The selected repositories of a fine-grained token, as owner/name
The scopes granted to this access token
The SHA1 hash of the access token
The last eight characters of the token
Examplegenerated
[ { "created_at": "2026-04-15T12:00:00Z", "description": "example", "disabled": true, "expires_at": "2026-04-15T12:00:00Z", "id": 1, "kind": "example", "last_used_at": "2026-04-15T12:00:00Z", "name": "example", "owner": "example", "repo_selection": "example", "repositories": [ "example" ], "scopes": [ "example" ], "sha1": "example", "token_last_eight": "example" }]APIForbiddenError is a forbidden error response