entities
Delete a template
DELETE /v1/templates/{slug}
Auth required
api.templates.manage
Deletes a managed template and its version history, and removes it from the org's SES account on a best-effort basis.
A template something live still sends is refused with 409 conflict,
and the dependents are named in referenced_by as {kind, key, name}:
a workflow that is not archived and contains a send of this template,
or a broadcast that pins it and has not gone out yet (draft or
scheduled). Both would otherwise fail later and somewhere else — the
workflow mid-journey, one contact at a time; the broadcast at its
scheduled send. Repoint or remove the dependent, then retry.
Path parameters
slug string required Template name (e.g. welcome).
Responses
Errors follow the RFC 7807 problem format — see the error reference.
204 Template deleted (no content)
401 Missing, malformed, or unknown API key application/problem+json
403 Either the credential lacks the required scope (
code: invalid_scope), or it is bound to the test environment and this operation is irreversible (code: test_environment_forbidden). Branch on code: the first is fixed by granting the scope, the second only by using a live credential. See the "Live and test credentials" section of the API description. application/problem+json 404 Resource not found application/problem+json
409 The write was refused by a state rule. Three cases, told apart by the extension members on the Problem: a stale
expected_content_hash carries the row's current content_hash; a delete blocked by a live dependent carries referenced_by. application/problem+json 429 Per-org rate limit exceeded application/problem+json
500 Unexpected server-side failure. The
code is internal_error. The
request_id field can be quoted to SendOps support to investigate.
application/problem+json