v5

latestSwagger 2.0MIT2026-08-03485217850.7 KB
user

Create an access token

post/users/{username}/tokens

Path parameters

usernamestring required

username of the user whose token is to be created

Request body

namestring required
scopesstring[]

Example request

{
  "scopes": [
    "all",
    "read:activitypub",
    "read:issue",
    "write:misc",
    "read:notification",
    "read:organization",
    "read:package",
    "read:repository",
    "read:user"
  ]
}

Response

AccessToken represents an API access token.

created_atstring date-time

The timestamp when the token was created

idinteger

The unique identifier of the access token

last_used_atstring date-time

The timestamp when the token was last used

namestring

The name of the access token

scopesstring[]

The scopes granted to this access token

sha1string

The SHA1 hash of the access token

token_last_eightstring

The last eight characters of the token