- 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 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"
]
}'