NextSign API
Email Templates

Delete a Message Template

Delete a message template with DELETE /v3/api/message-templates/{id}. Refused while presets, forms or cases still use it.

DELETE https://api.nextsign.dk/v3/api/message-templates/{id}

Delete one of your templates. This cannot be undone.

curl --request DELETE 'https://api.nextsign.dk/v3/api/message-templates/6731a2b4c5d6e7f8a9b0c1d2' \
  --header "Authorization: Bearer $NEXTSIGN_API_KEY"

While it is in use

A template that is still in use is not deleted. That means a preset, a form (its template, a role's template or the webflow template), or a case that can still send (open or draft). Deleting it would make all of those send the standard texts without anyone noticing. The answer is 409:

{
  "error": "template-in-use",
  "message": "presets, forms or cases that can still send use this template; they would fall back to the standard texts. Delete with force to do it anyway.",
  "usedBy": { "presets": 1, "forms": 0, "openOrDraftCases": 2 }
}

Add ?force=true to delete it anyway.

Query parameters

ParameterMeaning
forcetrue: delete even while in use. Default false

Response

200 OK:

{
  "deleted": true,
  "template": { "id": "6731a2b4c5d6e7f8a9b0c1d2", "name": "Underskrift via SMS", "type": "sms" },
  "usedBy": { "presets": 0, "forms": 0, "openOrDraftCases": 0 }
}

An id that is not one of your templates answers 404 template-not-found.