Create a new API token scoped to this organization
POST /api/v2/organizations/{organization}/tokens
POST
/api/v2/organizations/{organization}/tokens
Authorizations
Parameters
Path Parameters
organization
required
string
Organization identifier
Example
test-orgRequest Body required
object
name
required
Name for the token
string
My CI token preset
Preset scope bundle
string
content_management scopes
Individual scopes (mutually exclusive with preset)
Array<string>
[ "projects:read", "content:write"] projects
Project IDs to restrict this token to
Array<integer>
expires_in
Token expiration period
string
90dResponses
201
Token created. The plain token is returned once and cannot be retrieved again.
object
token
The plain text token (shown once)
string
id
Token ID
integer
name
string
scopes
Array<string>
projects
Array<integer>
preset
string
expires_at
string format: date-time
created_at
string format: date-time
400
Bad request.
object
message
required
Error message
string
The requested resource was not found error
required
Error flag
boolean
true{ "message": "The requested resource was not found", "error": true}403
Access is forbidden.
object
message
required
Error message
string
The requested resource was not found error
required
Error flag
boolean
true{ "message": "The requested resource was not found", "error": true}422
Validation error.
object
message
required
Error message
string
The requested resource was not found error
required
Error flag
boolean
true{ "message": "The requested resource was not found", "error": true}