> For the complete documentation index, see [llms.txt](https://docs.zenfinder.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zenfinder.ai/reference/templates.md).

# Templates

Message template CRUD (create/list/read/edit/delete).

## GET /{zbaId}/message\_templates

> List message templates for a ZBA

```json
{"openapi":"3.0.3","info":{"title":"ZenFinder Business API","version":"1.0"},"tags":[{"name":"Templates","description":"Message template CRUD (create/list/read/edit/delete)."}],"servers":[{"url":"https://api.zenfinder.ai/business/v1.0","description":"Production"}],"security":[{"bearerAuth":["zenfinder_business_management"]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"zf_live_...","description":"API key minted from Business Manager, sent as `Authorization: Bearer\n<key>`. Scopes: `zenfinder_business_messaging`,\n`zenfinder_business_management`.\n"}},"parameters":{"ZbaId":{"name":"zbaId","in":"path","required":true,"description":"The ZenFinder Business Account id. Must match the token's own `zbaId`.","schema":{"type":"string"}}},"schemas":{"TemplateSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]},"correct_category":{"type":"string","nullable":true,"description":"Set if the classifier recategorised the template from its declared category."},"status":{"type":"string","enum":["PENDING","APPROVED","REJECTED","PAUSED","DISABLED"]},"quality_score":{"type":"string"},"rejection_reason":{"type":"string","nullable":true}}},"Error":{"type":"object","description":"Graph/WhatsApp-Cloud-API-compatible error envelope. Numeric `code`\nvalues are reused verbatim from the WhatsApp Cloud API:\n\n| Code | HTTP | Meaning |\n|---|---|---|\n| 0 | 401 | AuthException |\n| 3 | 403 | Capability or permissions issue |\n| 10 | 403 | Permission denied |\n| 100 | 400 | Invalid parameter |\n| 190 | 401 | Access token invalid or expired |\n| 200 | 403 | Permission denied (missing scope / not authorised for this resource) |\n| 130429 | 429 | Rate limit hit |\n| 131000 | 500 | Something went wrong |\n| 131008 | 400 | Required parameter is missing |\n| 131009 | 400 | Parameter value is not valid |\n| 131016 | 503 | Service unavailable |\n| 131021 | 400 | Recipient cannot be sender |\n| 131026 | 400 | Message undeliverable |\n| 131037 | 403 | Display name not approved |\n| 131042 | 402 | Business eligibility payment issue (insufficient wallet balance) |\n| 131047 | 400 | Re-engagement message (service window closed — send a template) |\n| 131048 | 400 | Spam rate limit hit |\n| 131049 | 400 | Per-user marketing message limit reached |\n| 131050 | 400 | User stopped marketing messages (opted out) |\n| 131051 | 400 | Unsupported message type |\n| 131052 | 400 | Media download error |\n| 131053 | 400 | Media upload error |\n| 132000 | 400 | Template parameter count mismatch |\n| 132001 | 400 | Template does not exist / not approved |\n| 132005 | 400 | Template hydrated text too long |\n| 132007 | 400 | Template format character policy violated |\n| 132012 | 400 | Template parameter format mismatch |\n| 132015 | 400 | Template is paused |\n| 132016 | 400 | Template is disabled |\n| 133010 | 400 | Sender not registered |\n","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"integer"},"error_subcode":{"type":"integer","nullable":true},"error_data":{"type":"object","properties":{"messaging_product":{"type":"string"},"details":{"type":"string"}}},"zen_trace_id":{"type":"string"}}}}}},"responses":{"Unauthorized":{"description":"Missing, malformed, revoked or expired Bearer token (codes `0`, `190`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Token lacks the required scope, or isn't authorised for this sender/ZBA/media (codes `3`, `10`, `200`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Management-endpoint rate limit reached (code `130429`). Retry after the number of seconds in the `Retry-After` header.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"DefaultError":{"description":"Unexpected error (code `131000`) or upstream unavailability (`131016`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/{zbaId}/message_templates":{"get":{"operationId":"listTemplates","tags":["Templates"],"summary":"List message templates for a ZBA","parameters":[{"$ref":"#/components/parameters/ZbaId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSummary"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/DefaultError"}}}}}}
```

## Create a message template

> Runs synchronous, deterministic "Stage A" validation (structure,\
> char limits, parameter sequencing, button rules, a regulated-vertical\
> keyword screen). On success the template is stored \`PENDING\`; an\
> async LLM classifier (Stage B/C) then approves, rejects or\
> recategorises it — poll \`GET .../message\_templates/{id}\` or subscribe\
> to the \`message\_template\_status\_update\` webhook for the outcome.<br>

```json
{"openapi":"3.0.3","info":{"title":"ZenFinder Business API","version":"1.0"},"tags":[{"name":"Templates","description":"Message template CRUD (create/list/read/edit/delete)."}],"servers":[{"url":"https://api.zenfinder.ai/business/v1.0","description":"Production"}],"security":[{"bearerAuth":["zenfinder_business_management"]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"zf_live_...","description":"API key minted from Business Manager, sent as `Authorization: Bearer\n<key>`. Scopes: `zenfinder_business_messaging`,\n`zenfinder_business_management`.\n"}},"parameters":{"ZbaId":{"name":"zbaId","in":"path","required":true,"description":"The ZenFinder Business Account id. Must match the token's own `zbaId`.","schema":{"type":"string"}}},"schemas":{"TemplateCreate":{"type":"object","required":["name","language","category","components"],"properties":{"name":{"type":"string","pattern":"^[a-z0-9_]{1,512}$","description":"Lowercase letters, digits, underscore only."},"language":{"type":"string","description":"e.g. 'en' or 'en_US'."},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]},"parameter_format":{"type":"string","enum":["POSITIONAL","NAMED"],"default":"POSITIONAL"},"components":{"type":"array","description":"Exactly one BODY (required); at most one each of HEADER, FOOTER,\nBUTTONS. AUTHENTICATION templates must include exactly one OTP\nbutton and cannot contain URLs, media headers, or emoji.\nCOPY_CODE buttons are MARKETING-only. Content referencing a\nregulated vertical (lending, gambling, forex/crypto, health\nclaims) is hard-rejected before any LLM review.\n","items":{"$ref":"#/components/schemas/TemplateComponent"}}}},"TemplateComponent":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS"]},"format":{"type":"string","enum":["TEXT","IMAGE","VIDEO","DOCUMENT","LOCATION"],"description":"HEADER only; defaults to TEXT."},"text":{"type":"string","description":"BODY (<=1024 chars, required), HEADER TEXT (<=60), or FOOTER (<=60, no parameters allowed)."},"buttons":{"type":"array","description":"BUTTONS component only. Max 10 total; same-type buttons must be consecutive.","items":{"type":"object","properties":{"type":{"type":"string","enum":["QUICK_REPLY","URL","PHONE_NUMBER","COPY_CODE","OTP","FLOW"]},"text":{"type":"string","maxLength":25},"url":{"type":"string","format":"uri","description":"URL buttons must use https. Max 2 URL buttons."}}}}}},"Error":{"type":"object","description":"Graph/WhatsApp-Cloud-API-compatible error envelope. Numeric `code`\nvalues are reused verbatim from the WhatsApp Cloud API:\n\n| Code | HTTP | Meaning |\n|---|---|---|\n| 0 | 401 | AuthException |\n| 3 | 403 | Capability or permissions issue |\n| 10 | 403 | Permission denied |\n| 100 | 400 | Invalid parameter |\n| 190 | 401 | Access token invalid or expired |\n| 200 | 403 | Permission denied (missing scope / not authorised for this resource) |\n| 130429 | 429 | Rate limit hit |\n| 131000 | 500 | Something went wrong |\n| 131008 | 400 | Required parameter is missing |\n| 131009 | 400 | Parameter value is not valid |\n| 131016 | 503 | Service unavailable |\n| 131021 | 400 | Recipient cannot be sender |\n| 131026 | 400 | Message undeliverable |\n| 131037 | 403 | Display name not approved |\n| 131042 | 402 | Business eligibility payment issue (insufficient wallet balance) |\n| 131047 | 400 | Re-engagement message (service window closed — send a template) |\n| 131048 | 400 | Spam rate limit hit |\n| 131049 | 400 | Per-user marketing message limit reached |\n| 131050 | 400 | User stopped marketing messages (opted out) |\n| 131051 | 400 | Unsupported message type |\n| 131052 | 400 | Media download error |\n| 131053 | 400 | Media upload error |\n| 132000 | 400 | Template parameter count mismatch |\n| 132001 | 400 | Template does not exist / not approved |\n| 132005 | 400 | Template hydrated text too long |\n| 132007 | 400 | Template format character policy violated |\n| 132012 | 400 | Template parameter format mismatch |\n| 132015 | 400 | Template is paused |\n| 132016 | 400 | Template is disabled |\n| 133010 | 400 | Sender not registered |\n","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"integer"},"error_subcode":{"type":"integer","nullable":true},"error_data":{"type":"object","properties":{"messaging_product":{"type":"string"},"details":{"type":"string"}}},"zen_trace_id":{"type":"string"}}}}}},"responses":{"BadRequest":{"description":"Invalid, missing, or semantically rejected parameters (codes `100`, `131008`, `131009`, `131021`, `131026`, `131037`, `131047`–`131053`, `132000`–`132016`, `133010`, etc. — see `Error` schema).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing, malformed, revoked or expired Bearer token (codes `0`, `190`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Token lacks the required scope, or isn't authorised for this sender/ZBA/media (codes `3`, `10`, `200`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Management-endpoint rate limit reached (code `130429`). Retry after the number of seconds in the `Retry-After` header.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"DefaultError":{"description":"Unexpected error (code `131000`) or upstream unavailability (`131016`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/{zbaId}/message_templates":{"post":{"operationId":"createTemplate","tags":["Templates"],"summary":"Create a message template","description":"Runs synchronous, deterministic \"Stage A\" validation (structure,\nchar limits, parameter sequencing, button rules, a regulated-vertical\nkeyword screen). On success the template is stored `PENDING`; an\nasync LLM classifier (Stage B/C) then approves, rejects or\nrecategorises it — poll `GET .../message_templates/{id}` or subscribe\nto the `message_template_status_update` webhook for the outcome.\n","parameters":[{"$ref":"#/components/parameters/ZbaId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreate"}}}},"responses":{"200":{"description":"Accepted for review","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["PENDING"]},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/DefaultError"}}}}}}
```

## DELETE /{zbaId}/message\_templates

> Delete a template (by name, all languages) or a single template (by id)

```json
{"openapi":"3.0.3","info":{"title":"ZenFinder Business API","version":"1.0"},"tags":[{"name":"Templates","description":"Message template CRUD (create/list/read/edit/delete)."}],"servers":[{"url":"https://api.zenfinder.ai/business/v1.0","description":"Production"}],"security":[{"bearerAuth":["zenfinder_business_management"]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"zf_live_...","description":"API key minted from Business Manager, sent as `Authorization: Bearer\n<key>`. Scopes: `zenfinder_business_messaging`,\n`zenfinder_business_management`.\n"}},"parameters":{"ZbaId":{"name":"zbaId","in":"path","required":true,"description":"The ZenFinder Business Account id. Must match the token's own `zbaId`.","schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"Invalid, missing, or semantically rejected parameters (codes `100`, `131008`, `131009`, `131021`, `131026`, `131037`, `131047`–`131053`, `132000`–`132016`, `133010`, etc. — see `Error` schema).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing, malformed, revoked or expired Bearer token (codes `0`, `190`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Token lacks the required scope, or isn't authorised for this sender/ZBA/media (codes `3`, `10`, `200`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Management-endpoint rate limit reached (code `130429`). Retry after the number of seconds in the `Retry-After` header.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"DefaultError":{"description":"Unexpected error (code `131000`) or upstream unavailability (`131016`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","description":"Graph/WhatsApp-Cloud-API-compatible error envelope. Numeric `code`\nvalues are reused verbatim from the WhatsApp Cloud API:\n\n| Code | HTTP | Meaning |\n|---|---|---|\n| 0 | 401 | AuthException |\n| 3 | 403 | Capability or permissions issue |\n| 10 | 403 | Permission denied |\n| 100 | 400 | Invalid parameter |\n| 190 | 401 | Access token invalid or expired |\n| 200 | 403 | Permission denied (missing scope / not authorised for this resource) |\n| 130429 | 429 | Rate limit hit |\n| 131000 | 500 | Something went wrong |\n| 131008 | 400 | Required parameter is missing |\n| 131009 | 400 | Parameter value is not valid |\n| 131016 | 503 | Service unavailable |\n| 131021 | 400 | Recipient cannot be sender |\n| 131026 | 400 | Message undeliverable |\n| 131037 | 403 | Display name not approved |\n| 131042 | 402 | Business eligibility payment issue (insufficient wallet balance) |\n| 131047 | 400 | Re-engagement message (service window closed — send a template) |\n| 131048 | 400 | Spam rate limit hit |\n| 131049 | 400 | Per-user marketing message limit reached |\n| 131050 | 400 | User stopped marketing messages (opted out) |\n| 131051 | 400 | Unsupported message type |\n| 131052 | 400 | Media download error |\n| 131053 | 400 | Media upload error |\n| 132000 | 400 | Template parameter count mismatch |\n| 132001 | 400 | Template does not exist / not approved |\n| 132005 | 400 | Template hydrated text too long |\n| 132007 | 400 | Template format character policy violated |\n| 132012 | 400 | Template parameter format mismatch |\n| 132015 | 400 | Template is paused |\n| 132016 | 400 | Template is disabled |\n| 133010 | 400 | Sender not registered |\n","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"integer"},"error_subcode":{"type":"integer","nullable":true},"error_data":{"type":"object","properties":{"messaging_product":{"type":"string"},"details":{"type":"string"}}},"zen_trace_id":{"type":"string"}}}}}}},"paths":{"/{zbaId}/message_templates":{"delete":{"operationId":"deleteTemplate","tags":["Templates"],"summary":"Delete a template (by name, all languages) or a single template (by id)","parameters":[{"$ref":"#/components/parameters/ZbaId"},{"name":"name","in":"query","description":"Deletes every language variant of this template name. Mutually exclusive with `hsm_id`.","schema":{"type":"string"}},{"name":"hsm_id","in":"query","description":"Deletes a single template by id. Mutually exclusive with `name`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"type":"integer","description":"Present when deleting by name — count of language variants removed."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/DefaultError"}}}}}}
```

## GET /{zbaId}/message\_templates/{templateId}

> Read a single template

```json
{"openapi":"3.0.3","info":{"title":"ZenFinder Business API","version":"1.0"},"tags":[{"name":"Templates","description":"Message template CRUD (create/list/read/edit/delete)."}],"servers":[{"url":"https://api.zenfinder.ai/business/v1.0","description":"Production"}],"security":[{"bearerAuth":["zenfinder_business_management"]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"zf_live_...","description":"API key minted from Business Manager, sent as `Authorization: Bearer\n<key>`. Scopes: `zenfinder_business_messaging`,\n`zenfinder_business_management`.\n"}},"parameters":{"ZbaId":{"name":"zbaId","in":"path","required":true,"description":"The ZenFinder Business Account id. Must match the token's own `zbaId`.","schema":{"type":"string"}},"TemplateId":{"name":"templateId","in":"path","required":true,"description":"Natural-key template id: `{zba_id}_{name}_{language}`.","schema":{"type":"string"}}},"schemas":{"Template":{"allOf":[{"$ref":"#/components/schemas/TemplateSummary"},{"type":"object","properties":{"zba_id":{"type":"string"},"parameter_format":{"type":"string","enum":["POSITIONAL","NAMED"]},"components":{"type":"array","items":{"$ref":"#/components/schemas/TemplateComponent"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}]},"TemplateSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]},"correct_category":{"type":"string","nullable":true,"description":"Set if the classifier recategorised the template from its declared category."},"status":{"type":"string","enum":["PENDING","APPROVED","REJECTED","PAUSED","DISABLED"]},"quality_score":{"type":"string"},"rejection_reason":{"type":"string","nullable":true}}},"TemplateComponent":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS"]},"format":{"type":"string","enum":["TEXT","IMAGE","VIDEO","DOCUMENT","LOCATION"],"description":"HEADER only; defaults to TEXT."},"text":{"type":"string","description":"BODY (<=1024 chars, required), HEADER TEXT (<=60), or FOOTER (<=60, no parameters allowed)."},"buttons":{"type":"array","description":"BUTTONS component only. Max 10 total; same-type buttons must be consecutive.","items":{"type":"object","properties":{"type":{"type":"string","enum":["QUICK_REPLY","URL","PHONE_NUMBER","COPY_CODE","OTP","FLOW"]},"text":{"type":"string","maxLength":25},"url":{"type":"string","format":"uri","description":"URL buttons must use https. Max 2 URL buttons."}}}}}},"Error":{"type":"object","description":"Graph/WhatsApp-Cloud-API-compatible error envelope. Numeric `code`\nvalues are reused verbatim from the WhatsApp Cloud API:\n\n| Code | HTTP | Meaning |\n|---|---|---|\n| 0 | 401 | AuthException |\n| 3 | 403 | Capability or permissions issue |\n| 10 | 403 | Permission denied |\n| 100 | 400 | Invalid parameter |\n| 190 | 401 | Access token invalid or expired |\n| 200 | 403 | Permission denied (missing scope / not authorised for this resource) |\n| 130429 | 429 | Rate limit hit |\n| 131000 | 500 | Something went wrong |\n| 131008 | 400 | Required parameter is missing |\n| 131009 | 400 | Parameter value is not valid |\n| 131016 | 503 | Service unavailable |\n| 131021 | 400 | Recipient cannot be sender |\n| 131026 | 400 | Message undeliverable |\n| 131037 | 403 | Display name not approved |\n| 131042 | 402 | Business eligibility payment issue (insufficient wallet balance) |\n| 131047 | 400 | Re-engagement message (service window closed — send a template) |\n| 131048 | 400 | Spam rate limit hit |\n| 131049 | 400 | Per-user marketing message limit reached |\n| 131050 | 400 | User stopped marketing messages (opted out) |\n| 131051 | 400 | Unsupported message type |\n| 131052 | 400 | Media download error |\n| 131053 | 400 | Media upload error |\n| 132000 | 400 | Template parameter count mismatch |\n| 132001 | 400 | Template does not exist / not approved |\n| 132005 | 400 | Template hydrated text too long |\n| 132007 | 400 | Template format character policy violated |\n| 132012 | 400 | Template parameter format mismatch |\n| 132015 | 400 | Template is paused |\n| 132016 | 400 | Template is disabled |\n| 133010 | 400 | Sender not registered |\n","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"integer"},"error_subcode":{"type":"integer","nullable":true},"error_data":{"type":"object","properties":{"messaging_product":{"type":"string"},"details":{"type":"string"}}},"zen_trace_id":{"type":"string"}}}}}},"responses":{"Unauthorized":{"description":"Missing, malformed, revoked or expired Bearer token (codes `0`, `190`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Token lacks the required scope, or isn't authorised for this sender/ZBA/media (codes `3`, `10`, `200`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BadRequest":{"description":"Invalid, missing, or semantically rejected parameters (codes `100`, `131008`, `131009`, `131021`, `131026`, `131037`, `131047`–`131053`, `132000`–`132016`, `133010`, etc. — see `Error` schema).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Management-endpoint rate limit reached (code `130429`). Retry after the number of seconds in the `Retry-After` header.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"DefaultError":{"description":"Unexpected error (code `131000`) or upstream unavailability (`131016`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/{zbaId}/message_templates/{templateId}":{"get":{"operationId":"getTemplate","tags":["Templates"],"summary":"Read a single template","parameters":[{"$ref":"#/components/parameters/ZbaId"},{"$ref":"#/components/parameters/TemplateId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/BadRequest"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/DefaultError"}}}}}}
```

## Edit a template (re-enters review)

> \`name\` and \`language\` are immutable and carried over from the\
> existing template regardless of what's in the body. Editing resets\
> \`status\` to \`PENDING\` and re-runs the full validation + classification\
> pipeline, and makes a fresh appeal available if the new version is\
> later rejected.<br>

```json
{"openapi":"3.0.3","info":{"title":"ZenFinder Business API","version":"1.0"},"tags":[{"name":"Templates","description":"Message template CRUD (create/list/read/edit/delete)."}],"servers":[{"url":"https://api.zenfinder.ai/business/v1.0","description":"Production"}],"security":[{"bearerAuth":["zenfinder_business_management"]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"zf_live_...","description":"API key minted from Business Manager, sent as `Authorization: Bearer\n<key>`. Scopes: `zenfinder_business_messaging`,\n`zenfinder_business_management`.\n"}},"parameters":{"ZbaId":{"name":"zbaId","in":"path","required":true,"description":"The ZenFinder Business Account id. Must match the token's own `zbaId`.","schema":{"type":"string"}},"TemplateId":{"name":"templateId","in":"path","required":true,"description":"Natural-key template id: `{zba_id}_{name}_{language}`.","schema":{"type":"string"}}},"schemas":{"TemplateCreate":{"type":"object","required":["name","language","category","components"],"properties":{"name":{"type":"string","pattern":"^[a-z0-9_]{1,512}$","description":"Lowercase letters, digits, underscore only."},"language":{"type":"string","description":"e.g. 'en' or 'en_US'."},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]},"parameter_format":{"type":"string","enum":["POSITIONAL","NAMED"],"default":"POSITIONAL"},"components":{"type":"array","description":"Exactly one BODY (required); at most one each of HEADER, FOOTER,\nBUTTONS. AUTHENTICATION templates must include exactly one OTP\nbutton and cannot contain URLs, media headers, or emoji.\nCOPY_CODE buttons are MARKETING-only. Content referencing a\nregulated vertical (lending, gambling, forex/crypto, health\nclaims) is hard-rejected before any LLM review.\n","items":{"$ref":"#/components/schemas/TemplateComponent"}}}},"TemplateComponent":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS"]},"format":{"type":"string","enum":["TEXT","IMAGE","VIDEO","DOCUMENT","LOCATION"],"description":"HEADER only; defaults to TEXT."},"text":{"type":"string","description":"BODY (<=1024 chars, required), HEADER TEXT (<=60), or FOOTER (<=60, no parameters allowed)."},"buttons":{"type":"array","description":"BUTTONS component only. Max 10 total; same-type buttons must be consecutive.","items":{"type":"object","properties":{"type":{"type":"string","enum":["QUICK_REPLY","URL","PHONE_NUMBER","COPY_CODE","OTP","FLOW"]},"text":{"type":"string","maxLength":25},"url":{"type":"string","format":"uri","description":"URL buttons must use https. Max 2 URL buttons."}}}}}},"Error":{"type":"object","description":"Graph/WhatsApp-Cloud-API-compatible error envelope. Numeric `code`\nvalues are reused verbatim from the WhatsApp Cloud API:\n\n| Code | HTTP | Meaning |\n|---|---|---|\n| 0 | 401 | AuthException |\n| 3 | 403 | Capability or permissions issue |\n| 10 | 403 | Permission denied |\n| 100 | 400 | Invalid parameter |\n| 190 | 401 | Access token invalid or expired |\n| 200 | 403 | Permission denied (missing scope / not authorised for this resource) |\n| 130429 | 429 | Rate limit hit |\n| 131000 | 500 | Something went wrong |\n| 131008 | 400 | Required parameter is missing |\n| 131009 | 400 | Parameter value is not valid |\n| 131016 | 503 | Service unavailable |\n| 131021 | 400 | Recipient cannot be sender |\n| 131026 | 400 | Message undeliverable |\n| 131037 | 403 | Display name not approved |\n| 131042 | 402 | Business eligibility payment issue (insufficient wallet balance) |\n| 131047 | 400 | Re-engagement message (service window closed — send a template) |\n| 131048 | 400 | Spam rate limit hit |\n| 131049 | 400 | Per-user marketing message limit reached |\n| 131050 | 400 | User stopped marketing messages (opted out) |\n| 131051 | 400 | Unsupported message type |\n| 131052 | 400 | Media download error |\n| 131053 | 400 | Media upload error |\n| 132000 | 400 | Template parameter count mismatch |\n| 132001 | 400 | Template does not exist / not approved |\n| 132005 | 400 | Template hydrated text too long |\n| 132007 | 400 | Template format character policy violated |\n| 132012 | 400 | Template parameter format mismatch |\n| 132015 | 400 | Template is paused |\n| 132016 | 400 | Template is disabled |\n| 133010 | 400 | Sender not registered |\n","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"integer"},"error_subcode":{"type":"integer","nullable":true},"error_data":{"type":"object","properties":{"messaging_product":{"type":"string"},"details":{"type":"string"}}},"zen_trace_id":{"type":"string"}}}}}},"responses":{"BadRequest":{"description":"Invalid, missing, or semantically rejected parameters (codes `100`, `131008`, `131009`, `131021`, `131026`, `131037`, `131047`–`131053`, `132000`–`132016`, `133010`, etc. — see `Error` schema).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing, malformed, revoked or expired Bearer token (codes `0`, `190`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Token lacks the required scope, or isn't authorised for this sender/ZBA/media (codes `3`, `10`, `200`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Management-endpoint rate limit reached (code `130429`). Retry after the number of seconds in the `Retry-After` header.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"DefaultError":{"description":"Unexpected error (code `131000`) or upstream unavailability (`131016`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/{zbaId}/message_templates/{templateId}":{"post":{"operationId":"editTemplate","tags":["Templates"],"summary":"Edit a template (re-enters review)","description":"`name` and `language` are immutable and carried over from the\nexisting template regardless of what's in the body. Editing resets\n`status` to `PENDING` and re-runs the full validation + classification\npipeline, and makes a fresh appeal available if the new version is\nlater rejected.\n","parameters":[{"$ref":"#/components/parameters/ZbaId"},{"$ref":"#/components/parameters/TemplateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreate"}}}},"responses":{"200":{"description":"Accepted for re-review","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["PENDING"]},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/DefaultError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zenfinder.ai/reference/templates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
