Get the currently authenticated token
GET
/token
const url = 'https://gitea.com/api/v1/token';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.com/api/v1/token \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”CurrentAccessToken represents the currently authenticated access token.
Media typeapplication/json
CurrentAccessToken represents the metadata of the currently authenticated token.
object
created_at
The timestamp when the token was created
string format: date-time
id
The unique identifier of the access token
integer format: int64
last_used_at
The timestamp when the token was last used
string format: date-time
name
The name of the access token
string
scopes
The scopes granted to this access token
Array<string>
user
UserMeta represents minimal user information for the token owner.
object
id
The unique identifier of the user
integer format: int64
login
The username of the user
string
Examplegenerated
{ "created_at": "2026-04-15T12:00:00Z", "id": 1, "last_used_at": "2026-04-15T12:00:00Z", "name": "example", "scopes": [ "example" ], "user": { "id": 1, "login": "example" }}