API tokens
API tokens: 3 operations of the ChaosDesk REST API.
- GET
/api/api_tokensList API tokens (own tokens; admins: all). - POST
/api/api_tokensCreate an API token. The plaintext `token` is only returned in this response. - DELETE
/api/api_tokens/{id}Revoke (delete) an API token.
List API tokens (own tokens; admins: all).
Responses
200ApiToken collection403Forbidden
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.
Request body application/json
namestringrequiredscopesstring[]readallows GET requests;writealso allows POST/PATCH/PUT/DELETE.expires_atstring | null (date-time)- Null means the token never expires.
Responses
201ApiToken resource created400Invalid input403Forbidden422An 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.
Parameters
idstringpathrequired- ApiToken identifier
Responses
204ApiToken resource deleted403Forbidden404Not found
Example request
curl -X DELETE "https://yourcompany.chaosdesk.io/api/api_tokens/{id}" \
-H "Authorization: Bearer $CHAOSDESK_TOKEN" \
-H "Accept: application/json"