Create an API token for a user
post
Authorizations
defguard_sessionstringRequired
Path parameters
usernamestringRequired
Name of the user.
Body
namestringRequired
Responses
201
API token created. Its value is returned only here.
application/json
objectOptional
400
Invalid token name.
application/json
401
Session is missing or invalid.
application/json
403
Requires admin privileges and an active enterprise license.
application/json
404
User not found.
application/json
500
Unable to create API token.
application/json
post/api/v1/user/{username}/api_token
POST /api/v1/user/{username}/api_token HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 22
{
"name": "ci-pipeline"
}{
"token": "dg-4vJqXk9wR2mNpL7sT1yZbH3cD8fG5aQe"
}Last updated
Was this helpful?