Delete a template
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, scheduled
or failed). 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.
The layout that is the org's default layout cannot be deleted, so there
is always one to start from: it is refused with 422 and
validation_code: default_layout_not_deletable. Make another layout, or
the built-in one, the default first.
Path parameters
slug string required Template name (e.g. welcome).
Responses
Errors follow the RFC 7807 problem format — see the error reference.
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 expected_content_hash carries the row's current content_hash; a delete blocked by a live dependent carries referenced_by. application/problem+json validation_failed Problem. When the refusal is about a
reference — a segment key, template slug, topic or attribute name the
organization does not have — it additionally carries validation_code,
field, line/column, missing, candidates and next_step, so a
client can correct the call without a second round of guessing. See
ValidationProblem.
application/problem+json code is internal_error. The
request_id field can be quoted to SendOps support to investigate.
application/problem+json