Create and submit a template for approval
POST /api/templates/submitSubmits a WhatsApp template to Meta for review. Approval is asynchronous: the final status arrives by webhook at /chat/updateTemplateStatus. Requires the templates:manage scope.
Request body
Section titled “Request body”| Field | Type | Description | |
|---|---|---|---|
channel_id | string | required | channel_id of the channel (nk_ prefix). Example: "nk_dvzobn7m4h4y". |
template_data | object | required | Template definition in Meta’s format: { name, language, category, components }. Example: {"name":"bienvenida","language":"es","category":"MARKETING","components":[{"type":"BODY","text":"Hola {{1}}, bienvenido.","example":{"body_text":[["Juan"]]}}]}. |
Responses
Section titled “Responses”| Status | Description | Schema |
|---|---|---|
200 | — | SubmitTemplateResponseDto |
Example
Section titled “Example”curl -X POST https://api.neike.dev/api/templates/submit \ -H "x-neike-api-key: whk_live_…" \ -H "Content-Type: application/json" \ -d '{ "channel_id": "nk_dvzobn7m4h4y", "template_data": { "name": "bienvenida", "language": "es", "category": "MARKETING", "components": [ { "type": "BODY", "text": "Hola {{1}}, bienvenido.", "example": { "body_text": [ [ "Juan" ] ] } } ] } }'SubmitTemplateResponseDto
Section titled “SubmitTemplateResponseDto”| Field | Type | Description | |
|---|---|---|---|
externalCode | number | required | Meta code (200 = accepted for review). Example: 200. |
status | PENDING · APPROVED · REJECTED | optional | Initial status of the template. Example: "PENDING". |
id_external | string | optional | Template id in Meta. Example: "123456789". |
name | string | optional | Template name. Example: "bienvenida". |
category | MARKETING · UTILITY · AUTHENTICATION | optional | Category under which Meta registered the template, if it returned one. |
message | string | optional | Meta error message, if externalCode != 200. |