Email templates
Email templates: 5 operations of the ChaosDesk REST API.
- GET
/api/email_templatesRetrieves the collection of EmailTemplate resources. - GET
/api/email_templates/{key}Retrieves a EmailTemplate resource. - PATCH
/api/email_templates/{key}Updates the EmailTemplate resource. - DELETE
/api/email_templates/{key}Removes the EmailTemplate resource. - POST
/api/email_templates/{key}/previewCreates a EmailTemplate resource.
Retrieves the collection of EmailTemplate resources.
Responses
200EmailTemplate collection403Forbidden
Example request
curl -X GET "https://yourcompany.chaosdesk.io/api/email_templates" \
-H "Authorization: Bearer $CHAOSDESK_TOKEN" \
-H "Accept: application/json" Retrieves a EmailTemplate resource.
Parameters
keystringpathrequired- EmailTemplate identifier
Responses
200EmailTemplate resource403Forbidden404Not found
Example request
curl -X GET "https://yourcompany.chaosdesk.io/api/email_templates/{key}" \
-H "Authorization: Bearer $CHAOSDESK_TOKEN" \
-H "Accept: application/json" Updates the EmailTemplate resource.
PATCH/api/email_templates/{key}
Parameters
keystringpathrequired- EmailTemplate identifier
Request body application/merge-patch+json
subjectstringbodystringpreview_ticket_numberinteger | null- Preview only: ticket number to render against (defaults to the latest ticket).
Responses
200EmailTemplate resource updated400Invalid input403Forbidden404Not found422An error occurred
Example request
curl -X PATCH "https://yourcompany.chaosdesk.io/api/email_templates/{key}" \
-H "Authorization: Bearer $CHAOSDESK_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/merge-patch+json" \
-d '{"subject":"string","body":"string"}' Removes the EmailTemplate resource.
DELETE/api/email_templates/{key}
Parameters
keystringpathrequired- EmailTemplate identifier
Responses
204EmailTemplate resource deleted403Forbidden404Not found
Example request
curl -X DELETE "https://yourcompany.chaosdesk.io/api/email_templates/{key}" \
-H "Authorization: Bearer $CHAOSDESK_TOKEN" \
-H "Accept: application/json" Creates a EmailTemplate resource.
POST/api/email_templates/{key}/preview
Parameters
keystringpathrequired- EmailTemplate identifier
Request body application/json
subjectstringrequiredbodystringrequiredpreview_ticket_numberinteger | null- Preview only: ticket number to render against (defaults to the latest ticket).
Responses
200EmailTemplate resource created400Invalid input403Forbidden422An error occurred
Example request
curl -X POST "https://yourcompany.chaosdesk.io/api/email_templates/{key}/preview" \
-H "Authorization: Bearer $CHAOSDESK_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"subject":"string","body":"string"}'