API reference
Templates
How these fit together: the Templates guide.
List templates
get
Lists WhatsApp templates (or SMS / email templates, with channel=sms / channel=email), newest first.
One channel at a time, filtered by status, name and language. A live key lists live templates only; a test key lists the test templates (livemode: false) and the live ones. Status changes Meta makes later arrive as template.updated events.
Access: an organization key with the templates:read scope.
Query parameters
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.channelstringWhich channel’s templates. Omitted means
whatsapp, as before SMS existed.One of
whatsappsmsemailstatusstringOne of
draftpendingapprovedrejectedpauseddisableddeletedin_appealnamestringExact template name.
languagestringExact language code.
Response 200PublicTemplatePage
dataPublicTemplate[]RequiredIts fields are listed under Get template
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403ENTITLEMENT_MESSAGING_DISABLED — the organization does not have messaging; API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/templates' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"category": "UTILITY",
"channel": "whatsapp",
"components": [
{}
],
"createdAt": "2026-11-05T10:00:00.000Z",
"email": {
"category": "transactional",
"html": "HTML",
"subject": "Your order {{order}} is confirmed",
"text": "TEXT"
},
"id": "ID",
"language": "en",
"livemode": true,
"metaTemplateId": "META_TEMPLATE_ID",
"name": "order_confirmation",
"object": "template",
"parameterFormat": "positional",
"previousCategory": "PREVIOUS_CATEGORY",
"qualityScore": "QUALITY_SCORE",
"rejectionReason": "REJECTION_REASON",
"sms": {
"dltCategory": "transactional",
"dltTemplateId": "1107161234567890123",
"text": "Dear {#var#}, your order {#var#} has shipped. -ACME"
},
"status": "draft",
"updatedAt": "2026-11-05T10:00:00.000Z",
"variables": [
{
"component": "header",
"example": "#1001",
"format": "IMAGE",
"index": 1,
"name": "var1",
"param": "order_id",
"subType": "url"
}
]
}
],
"nextCursor": "NEXT_CURSOR"
}Create template
post
Submits a WhatsApp template to Meta for review (pending until Meta decides), records an SMS template’s DLT registration, or creates an email template (approved at once).
Meta’s verdict on a WhatsApp template arrives later as template.updated; an email template’s variables are the {{name}} placeholders its content uses. A test key’s template is a test template, reviewed by the sandbox and never sent to Meta or DLT, so it needs no WhatsApp connection and only test sends may use it. Refused with 409 WHATSAPP_NOT_CONNECTED when no WhatsApp account is connected and 409 CONFLICT for a name and language (or an SMS DLT template id) already taken. On 503 META_UNAVAILABLE the submission may still have reached Meta: POST /v1/templates/sync shows whether it did before you submit again.
Access: an organization key with the templates:write scope.
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
categorystringWhatsApp: required. Either case is accepted; the documented spelling is canonical (what responses answer).
One of
MARKETINGUTILITYAUTHENTICATIONmarketingutilityauthenticationchannelstringOne of
whatsappsmsemaildefault "whatsapp"
componentsobject[]WhatsApp (required): Meta’s components (HEADER, BODY, FOOTER, BUTTONS), with an example for every variable. Checked against Meta’s template rules before submission.
dltCategorystringSMS (required): the TRAI category it is registered under.
One of
transactionalservice_implicitservice_explicitpromotionaldltTemplateIdstringSMS: the content template id DLT issued (digits). Without it the template is a draft and cannot be sent.
emailPublicEmailTemplateContentEmail (required): the subject, text and/or HTML, and the category. Its variables are the
{{name}}placeholders it uses.4 fields of
emailcategorystringRequiredDecides consent on every send: marketing needs an opt-in and carries the unsubscribe footer; transactional needs no opt-in and is refused by an opt-out.
One of
transactionalmarketinghtmlstringThe HTML body (≤ 256 KB). Sanitized when saved, and again when a send fills its placeholders (values are HTML-escaped).
<style>blocks andclasssurvive, so MJML and React Email output works.at most 262144 characters
subjectstringRequiredOne line.
{{name}}placeholders (a letter, then letters, digits or underscores) are filled byPOST /v1/messagesvariables.at most 998 characters
textstringThe plain-text body. Derived from
htmlwhen absent; at least one of the two.at most 100000 characters
languagestringRequirednamestringRequiredLowercase letters, digits and underscores (Meta’s rule).
parameterFormatstring{{1}}or{{first_name}}parameters.One of
positionalnameddefault "positional"
textstringSMS (required): the text exactly as registered on DLT, with {#var#} (or a typed {#numeric#}, {#url#}, {#urlott#}, {#cbn#}, {#email#}, {#alphanumeric#}) where values go.
at most 2000 characters
variablesstring[]SMS: one name per placeholder, in order — what
POST /v1/messagesfills them by. Omitted: var1, var2, …
Response 201PublicTemplate
Its fields are listed under Get template.
Errors
400VALIDATION_FAILED — the fields do not fit the channel (an SMS template needs text and dltCategory, its {#var#} placeholders DLT ones; an email template needs email.subject, email.text or email.html, and email.category — a one-line subject, HTML ≤ 256 KB that is not empty once sanitized, at most 50 {{name}} variables), or a WhatsApp template breaks one of Meta’s template rules (named).META_<code>(orHTTP_<status>when Meta named no code) — Meta refused it;messagecarries Meta’s reason andfbtraceIdits trace id.401API_KEY_INVALID — missing, unknown, revoked or expired key.403ENTITLEMENT_MESSAGING_DISABLED — the organization does not have messaging; API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.409WHATSAPP_NOT_CONNECTED, or CONFLICT — a template with this name and language (or, for SMS, this DLT template id) already exists. IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running.422IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429MESSAGING_RATE_LIMITED — Meta is throttling template requests (retryAfterMs); or RATE_LIMITED — this key’s own limit (Retry-After).500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).503META_UNAVAILABLE — Meta could not be reached or did not answer in time. The submission may still have reached Meta:POST /v1/templates/syncshows whether it did before you submit again. SERVICE_UNAVAILABLE — the stored WhatsApp credential could not be read (reconnect the account).
curl -X POST 'https://api.trovacast.com/v1/templates' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"channel": "sms",
"name": "order_shipped",
"language": "en",
"dltCategory": "service_implicit",
"dltTemplateId": "1107161234567890123",
"text": "Dear {#var#}, your order {#var#} has shipped. -ACME",
"variables": [
"name",
"order"
]
}'{
"category": "UTILITY",
"channel": "whatsapp",
"components": [
{}
],
"createdAt": "2026-11-05T10:00:00.000Z",
"email": {
"category": "transactional",
"html": "HTML",
"subject": "Your order {{order}} is confirmed",
"text": "TEXT"
},
"id": "ID",
"language": "en",
"livemode": true,
"metaTemplateId": "META_TEMPLATE_ID",
"name": "order_confirmation",
"object": "template",
"parameterFormat": "positional",
"previousCategory": "PREVIOUS_CATEGORY",
"qualityScore": "QUALITY_SCORE",
"rejectionReason": "REJECTION_REASON",
"sms": {
"dltCategory": "transactional",
"dltTemplateId": "1107161234567890123",
"text": "Dear {#var#}, your order {#var#} has shipped. -ACME"
},
"status": "draft",
"updatedAt": "2026-11-05T10:00:00.000Z",
"variables": [
{
"component": "header",
"example": "#1001",
"format": "IMAGE",
"index": 1,
"name": "var1",
"param": "order_id",
"subType": "url"
}
]
}Sync templates
post
Re-reads every template from Meta and reconciles local copies.
Reads the connected WhatsApp account’s template listing and answers what changed: templates imported from Meta (created), local ones that changed (updated) and ones Meta no longer lists (retired). When the listing is too long to read in one sync, complete is false and nothing is retired. Use it after a 503 META_UNAVAILABLE on a create or edit to see whether the request reached Meta. Refused with 409 WHATSAPP_NOT_CONNECTED, and for a test key (422 TEST_MODE_UNSUPPORTED: a sync writes live templates).
Access: an organization key with the templates:write scope.
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Response 200PublicTemplateSyncResult
completebooleanRequiredFalse when the listing was too long to read in one sync; nothing was retired then.
createdintegerRequiredTemplates imported from Meta.
objectstringRequiredOne of
template_syncretiredintegerRequiredLocal templates Meta no longer lists.
updatedintegerRequiredLocal templates that changed.
Errors
400META_<code>(orHTTP_<status>when Meta named no code) — Meta refused it;messagecarries Meta’s reason andfbtraceIdits trace id. VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403ENTITLEMENT_MESSAGING_DISABLED — the organization does not have messaging; API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.409WHATSAPP_NOT_CONNECTED — no connected WhatsApp account. IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running.422IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429MESSAGING_RATE_LIMITED — Meta is throttling template requests (retryAfterMs); or RATE_LIMITED — this key’s own limit (Retry-After).500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).503META_UNAVAILABLE — Meta could not be reached or did not answer in time; nothing changed here, so syncing again is safe. SERVICE_UNAVAILABLE — the stored WhatsApp credential could not be read (reconnect the account).
curl -X POST 'https://api.trovacast.com/v1/templates/sync' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"complete": true,
"created": 1,
"object": "template_sync",
"retired": 1,
"updated": 1
}Get template
get
Retrieves a template.
The template as it stands — its status, content and variables — on any channel. A live key reads live templates only; a test key also reads test templates.
Access: an organization key with the templates:read scope.
Path parameters
templateIdstringRequired
Response 200PublicTemplate
Show the 19 fieldsHide the fields
categorystringRequiredMeta’s current category (it may re-categorize after approval; see
previousCategory).channelstringRequiredOne of
whatsappemailsmscomponentsobject[]RequiredMeta’s component array, as submitted or synced.
createdAtstring (date-time)RequiredemailPublicTemplateEmail | nullRequiredEmail templates only; null otherwise.
4 fields of
emailcategorystringRequiredWhat a send of it is by default (a marketing template is always marketing).
One of
transactionalmarketinghtmlstring | nullRequiredThe HTML body as sanitized when it was saved; null without one.
subjectstringRequiredThe subject line, with
{{name}}placeholders.textstringRequiredThe plain-text body (derived from the HTML when the template was created without one).
idstring (uuid)RequiredlanguagestringRequiredlivemodebooleanRequiredFalse for a test template: created with a test key (
tc_test_…), reviewed by the sandbox (never by Meta or DLT) and sendable by test sends only. A test key lists both its test templates and the live ones; a live key lists live templates only.metaTemplateIdstring | nullRequirednamestringRequiredobjectstringRequiredOne of
templateparameterFormatstringRequiredOne of
positionalnamedpreviousCategorystring | nullRequiredqualityScorestring | nullRequiredrejectionReasonstring | nullRequiredsmsPublicTemplateSms | nullRequiredSMS templates only; null otherwise.
3 fields of
smsdltCategorystringRequiredThe TRAI category it is registered under (decides consent, the promotional window and the route).
One of
transactionalservice_implicitservice_explicitpromotionaldltTemplateIdstring | nullRequiredThe content template id DLT issued; null while the template is a draft.
textstringRequiredThe text exactly as registered on DLT.
statusstringRequiredOne of
draftpendingapprovedrejectedpauseddisableddeletedin_appealupdatedAtstring (date-time)RequiredvariablesPublicTemplateVariable[]RequiredThe variables
POST /v1/messagesmust fill, byname(var1…, named parameters,header_*,button{i}_var1,button{i}_code), in the order they appear.7 fields of
variablescomponentstringRequiredWhere the value lands. SMS and email values are
body.One of
headerbodybuttonexamplestringThe sample value submitted with the template.
formatstringWhatsApp
header: a media header, whose value is an https link to the file.One of
IMAGEVIDEODOCUMENTindexintegerWhatsApp
button: the button’s position (0-based). SMS: the placeholder’s position in the DLT text.namestringRequiredThe key
POST /v1/messagesnames the value by invariables.paramstringWhatsApp named templates: Meta’s own parameter name. SMS: the DLT placeholder type the value must fit (
var,numeric,url, … — the{#…#}of the registered text).subTypestringWhatsApp
button: a URL button’s suffix, or a coupon code to copy.One of
urlcopy_code
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403ENTITLEMENT_MESSAGING_DISABLED — the organization does not have messaging; API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such template.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/templates/TEMPLATE_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"category": "UTILITY",
"channel": "whatsapp",
"components": [
{}
],
"createdAt": "2026-11-05T10:00:00.000Z",
"email": {
"category": "transactional",
"html": "HTML",
"subject": "Your order {{order}} is confirmed",
"text": "TEXT"
},
"id": "ID",
"language": "en",
"livemode": true,
"metaTemplateId": "META_TEMPLATE_ID",
"name": "order_confirmation",
"object": "template",
"parameterFormat": "positional",
"previousCategory": "PREVIOUS_CATEGORY",
"qualityScore": "QUALITY_SCORE",
"rejectionReason": "REJECTION_REASON",
"sms": {
"dltCategory": "transactional",
"dltTemplateId": "1107161234567890123",
"text": "Dear {#var#}, your order {#var#} has shipped. -ACME"
},
"status": "draft",
"updatedAt": "2026-11-05T10:00:00.000Z",
"variables": [
{
"component": "header",
"example": "#1001",
"format": "IMAGE",
"index": 1,
"name": "var1",
"param": "order_id",
"subType": "url"
}
]
}Update template
patch
Edits a template: a WhatsApp template’s components (or a rejected or paused one’s category), back to Meta for review; or an SMS template’s DLT registration.
A WhatsApp edit goes to Meta first and puts the template back into review: it answers pending and is not sendable until Meta’s verdict arrives as template.updated; Meta’s own edit limits come back as 400 META_<code>. An edit Meta accepted counts against Meta’s allowance, so a retry with the same Idempotency-Key after a 5xx replays that answer rather than reaching Meta again: read the template before editing again. Refused with 409 TEMPLATE_NOT_EDITABLE for a WhatsApp template that is not approved, rejected or paused, an email template, or a test template (delete it and create it again); a test key naming a live template with 422 TEST_MODE_UNSUPPORTED.
Access: an organization key with the templates:write scope.
Path parameters
templateIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
categorystringWhatsApp: a new category for a rejected or paused template. Meta never changes an approved template’s category (400). Either case is accepted; the documented spelling is canonical (what responses answer).
One of
MARKETINGUTILITYAUTHENTICATIONmarketingutilityauthenticationcomponentsobject[]WhatsApp: the complete new component set (HEADER, BODY, FOOTER, BUTTONS), with an example for every variable. Meta replaces all components with these, so send the ones that stay too. Checked against Meta’s template rules before it is sent.
dltCategorystringSMS: the TRAI category. Like
text, a change to an approved template needs the newdltTemplateId.One of
transactionalservice_implicitservice_explicitpromotionaldltTemplateIdstring | nullSMS: the content template id DLT issued (digits);
nullclears it, which only a draft may be without.statusstringSMS:
approvedsays the text is registered (it needs adltTemplateId);pausedordisabledstops sends of it;draftis everything before registration. A WhatsApp template’s status is Meta’s verdict and cannot be set.One of
draftapprovedpauseddisabledtextstringSMS: the new text, exactly as registered on DLT. An approved template’s text changes only with the new registration’s
dltTemplateId(or withstatus: "draft").at most 2000 characters
variablesstring[]SMS: one name per placeholder, in order. Omitted with a new
text: var1, var2, …
Response 200PublicTemplate
Its fields are listed under Get template.
Errors
400VALIDATION_FAILED — a field of the other channel, nothing to change, a broken Meta template rule (named), a new category for an approved WhatsApp template, or an SMS registration rule (an approved template’s new text needs its new dltTemplateId).META_<code>(orHTTP_<status>when Meta named no code) — Meta refused it;messagecarries Meta’s reason andfbtraceIdits trace id. Meta’s own edit limits (an approved template at most once in 24 hours and 10 times in 30 days) come back this way.401API_KEY_INVALID — missing, unknown, revoked or expired key.403ENTITLEMENT_MESSAGING_DISABLED — the organization does not have messaging; API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such template.409TEMPLATE_NOT_EDITABLE — a WhatsApp template that is not approved, rejected or paused (statussays which), one never submitted to Meta, or an email template; WHATSAPP_NOT_CONNECTED; CONFLICT — the template changed while this request ran (reload it). IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running.422IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429MESSAGING_RATE_LIMITED — Meta is throttling template requests (retryAfterMs); or RATE_LIMITED — this key’s own limit (Retry-After).500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).503META_UNAVAILABLE — Meta could not be reached or did not answer in time. The edit may still have reached Meta:POST /v1/templates/syncre-reads it before you edit again. SERVICE_UNAVAILABLE — the stored WhatsApp credential could not be read (reconnect the account).
curl -X PATCH 'https://api.trovacast.com/v1/templates/TEMPLATE_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"dltTemplateId": "1107161234567890123",
"text": "Dear {#var#}, your order {#var#} is out for delivery. -ACME",
"variables": [
"name",
"order"
]
}'{
"category": "UTILITY",
"channel": "whatsapp",
"components": [
{}
],
"createdAt": "2026-11-05T10:00:00.000Z",
"email": {
"category": "transactional",
"html": "HTML",
"subject": "Your order {{order}} is confirmed",
"text": "TEXT"
},
"id": "ID",
"language": "en",
"livemode": true,
"metaTemplateId": "META_TEMPLATE_ID",
"name": "order_confirmation",
"object": "template",
"parameterFormat": "positional",
"previousCategory": "PREVIOUS_CATEGORY",
"qualityScore": "QUALITY_SCORE",
"rejectionReason": "REJECTION_REASON",
"sms": {
"dltCategory": "transactional",
"dltTemplateId": "1107161234567890123",
"text": "Dear {#var#}, your order {#var#} has shipped. -ACME"
},
"status": "draft",
"updatedAt": "2026-11-05T10:00:00.000Z",
"variables": [
{
"component": "header",
"example": "#1001",
"format": "IMAGE",
"index": 1,
"name": "var1",
"param": "order_id",
"subType": "url"
}
]
}Delete template
delete
Deletes the template at Meta and retires it (status deleted); idempotent. An SMS or email template is deleted outright and answered as it was, with status deleted.
A retired WhatsApp template stays readable, and messages that used it keep their reference; one Meta no longer has is retired all the same. Deleting a deleted template answers it as it is. A test key deletes only test templates (a live one is refused with 422 TEST_MODE_UNSUPPORTED). Refused with 409 WHATSAPP_NOT_CONNECTED when the template is at Meta and no account is connected to delete it with.
Access: an organization key with the templates:write scope.
Path parameters
templateIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Response 200PublicTemplate
Its fields are listed under Get template.
Errors
400META_<code>(orHTTP_<status>when Meta named no code) — Meta refused it;messagecarries Meta’s reason andfbtraceIdits trace id. VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403ENTITLEMENT_MESSAGING_DISABLED — the organization does not have messaging; API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such template.409WHATSAPP_NOT_CONNECTED — the template is at Meta and no WhatsApp account is connected to delete it with; CONFLICT — the template changed while this request ran. IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running.422IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429MESSAGING_RATE_LIMITED — Meta is throttling template requests (retryAfterMs); or RATE_LIMITED — this key’s own limit (Retry-After).500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).503META_UNAVAILABLE — Meta could not be reached or did not answer in time; the template is kept as it was here, and deleting again is safe (one Meta no longer has is retired all the same). SERVICE_UNAVAILABLE — the stored WhatsApp credential could not be read (reconnect the account).
curl -X DELETE 'https://api.trovacast.com/v1/templates/TEMPLATE_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"category": "UTILITY",
"channel": "whatsapp",
"components": [
{}
],
"createdAt": "2026-11-05T10:00:00.000Z",
"email": {
"category": "transactional",
"html": "HTML",
"subject": "Your order {{order}} is confirmed",
"text": "TEXT"
},
"id": "ID",
"language": "en",
"livemode": true,
"metaTemplateId": "META_TEMPLATE_ID",
"name": "order_confirmation",
"object": "template",
"parameterFormat": "positional",
"previousCategory": "PREVIOUS_CATEGORY",
"qualityScore": "QUALITY_SCORE",
"rejectionReason": "REJECTION_REASON",
"sms": {
"dltCategory": "transactional",
"dltTemplateId": "1107161234567890123",
"text": "Dear {#var#}, your order {#var#} has shipped. -ACME"
},
"status": "draft",
"updatedAt": "2026-11-05T10:00:00.000Z",
"variables": [
{
"component": "header",
"example": "#1001",
"format": "IMAGE",
"index": 1,
"name": "var1",
"param": "order_id",
"subType": "url"
}
]
}