Add

  • POST
  • /user
  • /tokens

Add personal access token

Warning
You can't create tokens with scopes higher than those in the authorization token.
Info
If there are any IP or workspace restrictions saved in the authorization token, they will be copied to the created token. If you want to change the restrictions, an authorization token without restrictions must be used.

Request

REQUIRED SCOPES
TOKEN_MANAGE
POST PARAMETERS
namerequiredstring
The name/description of the access token
expires_ininteger
The token expiration time in days
expires_atstring
The token expiration date
scopesstring[]
The array of OAuth scopes granted to the token

Constraints: Unique items required

ip_restrictionsstring[]
The array of IP addresses that are allowed to use this token
workspace_restrictionsstring[]
The array of workspaces for which this token can be used

Response

RESPONSE BODY
urlread-onlystring
API endpoint to GET this object
html_urlread-onlystring
Web URL to view this object in Buddy.works
idstring
The ID of the access token
namestring
The name/description of the access token
tokenstring
The actual access token value. Only returned when creating a new token
expires_ininteger
The token expiration time in days
expires_atstring
The token expiration date
scopesstring[]
The array of OAuth scopes granted to the token

Constraints: Unique items required

ip_restrictionsstring[]
The array of IP addresses that are allowed to use this token
workspace_restrictionsstring[]
The array of workspaces for which this token can be used

Last modified on Jan 26, 2026

Request example

curl -X POST "https://api.buddy.works/user/tokens" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "name": "My API Token", "expires_in": 30, "scopes": [ "WORKSPACE", "REPOSITORY_READ" ], "ip_restrictions": [ "192.168.1.100", "10.0.0.0/8" ], "workspace_restrictions": [ "my-workspace" ] }'