API tokens

API tokens: 3 operations of the ChaosDesk REST API.

List API tokens (own tokens; admins: all).

GET/api/api_tokens

Responses

  • 200ApiToken collection
  • 403Forbidden

Example request

curl -X GET "https://yourcompany.chaosdesk.io/api/api_tokens" \
  -H "Authorization: Bearer $CHAOSDESK_TOKEN" \
  -H "Accept: application/json"

Create an API token. The plaintext `token` is only returned in this response.

POST/api/api_tokens

Request body application/json

namestringrequired
scopesstring[]
read allows GET requests; write also allows POST/PATCH/PUT/DELETE.
expires_atstring | null (date-time)
Null means the token never expires.

Responses

  • 201ApiToken resource created
  • 400Invalid input
  • 403Forbidden
  • 422An error occurred

Example request

curl -X POST "https://yourcompany.chaosdesk.io/api/api_tokens" \
  -H "Authorization: Bearer $CHAOSDESK_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"string"}'

Revoke (delete) an API token.

DELETE/api/api_tokens/{id}

Parameters

idstringpathrequired
ApiToken identifier

Responses

  • 204ApiToken resource deleted
  • 403Forbidden
  • 404Not found

Example request

curl -X DELETE "https://yourcompany.chaosdesk.io/api/api_tokens/{id}" \
  -H "Authorization: Bearer $CHAOSDESK_TOKEN" \
  -H "Accept: application/json"