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 still uses 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 in any state that pins it. A live workflow or an unsent
broadcast would otherwise fail later and somewhere else. Change the
workflow or unsent broadcast, or delete the broadcast, then retry. A
broadcast that has gone out cannot be changed, and deleting it also
deletes its send records. One that is sending or paused cannot be deleted
until it finishes or is cancelled.
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