Crear/enviar plantilla a aprobación
POST /api/templates/submitEnvía una plantilla de WhatsApp a revisión de Meta. La aprobación es asíncrona: el estado final llega por webhook a /chat/updateTemplateStatus. Requiere scope templates:manage.
Request body
Section titled “Request body”| Field | Type | Description | |
|---|---|---|---|
channel_id | string | required | channel_id del canal (prefijo nk_). Example: "nk_dvzobn7m4h4y". |
template_data | object | required | Definición de la plantilla en el formato de Meta: { 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 | Código de Meta (200 = aceptada a revisión). Example: 200. |
status | PENDING · APPROVED · REJECTED | optional | Estado inicial de la plantilla. Example: "PENDING". |
id_external | string | optional | Id de la plantilla en Meta. Example: "123456789". |
name | string | optional | Nombre de la plantilla. Example: "bienvenida". |
message | string | optional | Mensaje de error de Meta, si externalCode != 200. |