Email Templates
Delete an Email Template
Delete an e-mail, SMS or e-Boks template with DELETE /api/v2/{company}/emailTemplates/{id}/delete. Refused while presets, forms or cases still use it.
DELETE https://www.nextsign.dk/api/v2/{company}/emailTemplates/{id}/deleteDelete one of your templates. This cannot be undone. POST works too.
curl --request DELETE 'https://www.nextsign.dk/api/v2/{company}/emailTemplates/6731a2b4c5d6e7f8a9b0c1d2/delete' \
-H 'Authorization: Bearer YOUR_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
| Parameter | Meaning |
|---|---|
force | true: 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.