API Tokens

POST /users/me/token #

Create token for me

Creates a token for the authenticated user. Store the returned token securely: it is the credential sent in the Authorization header for subsequent API calls.

Request body

name string

Responses

  • 201 Resource created successfully X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 404 Entity not found
cURL
curl -X POST \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  -H "Content-Type: application/json" \
  https://yourmantishubname.mantishub.io/api/rest/users/me/token \
  -d '{
    "name": "string"
}'
Request body · application/json
{
    "name": "string"
}
POST /users/{user_id}/token #

Create token for user

Creates a token for another user. This requires permission to impersonate that user and cannot target a user with a higher access level than the caller.

Parameters

Name In Type Description
user_id required path integer The user ID e.g. 5

Request body

name string

Responses

  • 201 Resource created successfully X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 404 Entity not found
cURL
curl -X POST \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  -H "Content-Type: application/json" \
  https://yourmantishubname.mantishub.io/api/rest/users/5/token \
  -d '{
    "name": "string"
}'
Request body · application/json
{
    "name": "string"
}
DELETE /users/me/token/{id} #

Delete token for me

Parameters

Name In Type Description
id required path integer

Responses

  • 204 Operation completed successfully with no response body X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 404 Entity not found
cURL
curl -X DELETE \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/users/me/token/1
DELETE /users/{user_id}/token/{id} #

Delete token for user

Parameters

Name In Type Description
user_id required path integer The user ID e.g. 5
id required path integer

Responses

  • 204 Operation completed successfully with no response body X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 404 Entity not found
cURL
curl -X DELETE \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/users/5/token/1