Editar un template existente
Templates
PATCH /v1/templates/{id}
Edit an existing template: components, category, language, or status.
PATCH
Editar un template existente
Updates an existing template. Internally syncs the changes with Meta when applicable (for example when editing
Same shape as
components or category). Only send the fields you want to change; the rest stays as-is.
Endpoint
Required scope
templates:update
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer kbai_pk_<token> |
Content-Type | Yes | application/json |
Path params
| Param | Type | Description |
|---|---|---|
id | string | Internal ObjectId of the template. This is the id returned by GET /v1/templates and POST /v1/templates. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
channel_id | string | Yes | ObjectId of the channel that owns the template. Required by upstream to validate ownership. |
name | string | No | New name. Lowercase letters, numbers, and underscores only. Max 512. |
language | string | No | Language code. Max 10. |
category | string | No | MARKETING, UTILITY, or AUTHENTICATION. |
parameter_format | string | No | NAMED or POSITIONAL. |
components | array | No | Replaces the components list. Same structure as in POST /v1/templates. |
status | string | No | Status to force locally (PAUSED, DISABLED, etc.). Use with care. |
metadata | object | No | Free-form metadata. |
Example request
Response
200 OK
POST /v1/templates. If the edit triggered a fresh Meta review, status may sit in IN_REVIEW or PENDING until Meta approves it again.
400 / 401 / 403 / 404 / 409 / 429
Common cases:400 BAD_REQUEST: body validation.403 FORBIDDENwithcode: INSUFFICIENT_SCOPE: the PAT does not havetemplates:update.404 NOT_FOUND: the template does not exist or does not belong to your tenant.409 CONFLICT: Meta rejected the edit because the template is not in an editable state.502 UPSTREAM_ERROR: generic error from Meta.detailsdescribes the cause.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Path Parameters
ObjectId del template
Body
application/json
ObjectId del canal WhatsApp dueño del template (requerido por upstream).
Maximum string length:
512Maximum string length:
10Available options:
MARKETING, UTILITY, AUTHENTICATION Available options:
NAMED, POSITIONAL Available options:
PENDING, IN_REVIEW, REJECTED, APPROVED, PAUSED, DISABLED, IN_APPEAL