Email templates

Email templates: 5 operations of the ChaosDesk REST API.

Retrieves the collection of EmailTemplate resources.

GET/api/email_templates

Responses

  • 200EmailTemplate collection
  • 403Forbidden

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.

GET/api/email_templates/{key}

Parameters

keystringpathrequired
EmailTemplate identifier

Responses

  • 200EmailTemplate resource
  • 403Forbidden
  • 404Not 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

subjectstring
bodystring
preview_ticket_numberinteger | null
Preview only: ticket number to render against (defaults to the latest ticket).

Responses

  • 200EmailTemplate resource updated
  • 400Invalid input
  • 403Forbidden
  • 404Not found
  • 422An 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 deleted
  • 403Forbidden
  • 404Not 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

subjectstringrequired
bodystringrequired
preview_ticket_numberinteger | null
Preview only: ticket number to render against (defaults to the latest ticket).

Responses

  • 200EmailTemplate resource created
  • 400Invalid input
  • 403Forbidden
  • 422An 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"}'