For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create an API token for a user

The token value is returned only in this response and cannot be retrieved later.

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
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?