Create template
Creates a WhatsApp message template in the given DID.
Endpoint: POST /v1/templates/{did}
Parameters
Path
| Parameter | Type | Required | Description |
|---|---|---|---|
did | string | Yes | Target ID. |
Query
| Parameter | Type | Required | Description |
|---|---|---|---|
client_id | number | No | Client. Requires BSP_CN if it differs from the token. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name (unique per WABA). |
language | string | Yes | Language code: es, en_US, pt_BR… |
category | string | Yes | MARKETING, UTILITY or AUTHENTICATION. |
components | array | Yes | Components: HEADER, BODY, FOOTER, BUTTONS. |
parameter_format | string | No | Format of the BODY placeholders: only positional (default, {{1}}). named ({{name}}) is not supported in api-bsp-chattigo, in either creation or send; placeholders must be positional ({{1}}, {{2}}, …). Defaults to positional when omitted. |
client_id | number | No | Client (requires BSP_CN for another client). |
channel_campaigns | object | No | Automatic channel/campaign assignment. |
optimization_spec | object | No | Bid cap (max price): bid_amount, bid_strategy, bid_country_multiplier_overrides. |
allow_button_url_change | boolean | No | Migrates URL buttons to the dynamic format (url-mapper redirect). |
allow_category_change | boolean | No | Allows Meta to recategorize the template automatically. |
add_security_recommendation | boolean | No | AUTHENTICATION: appends the “For your security…” line. |
code_expiration_minutes | number | No | AUTHENTICATION: OTP code validity (default 10 min, 30s–15min). |
message_send_ttl_seconds | number | No | Delivery validity (TTL) in seconds. Passed directly to Meta. Ranges: AUTHENTICATION 30–900, UTILITY 30–43200, MARKETING 43200–2592000. -1 = 30 days (auth/utility only). |
country | string | No | Country code for max-price (dynamic); if omitted it is resolved from the did. |
Request
curl --request POST \
--url 'https://api.chattigo.com/v1/templates/{did}' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "test_promo",
"language": "es",
"category": "MARKETING",
"components": [
{
"type": "BODY",
"text": "¡Oferta exclusiva {{1}}! You get {{2}}% off.",
"example": { "body_text": [["Customer", "30"]] }
}
]
}'Response
Success (200)
The response is the passthrough of Meta’s body (deserialized into dto.CreateResponse). It contains only the fields Meta returns on create:
{
"id": "114002218302594",
"status": "PENDING",
"category": "MARKETING"
}Errors
| Code | Case |
|---|---|
400 | did is required, failed component/example validation, invalid media |
400 | header_source and header_handle mutually exclusive |
400 | URL de media no HTTPS o IP privada (bloqueada por seguridad) |
403 | DID outside the WABA hierarchy, or access to another client without BSP_CN |
413 | Multipart exceeds the maximum size |
502 | External service unreachable |
Notes
- After a successful create, the template is registered and the creation event is fired.
- The
filemode requiresmultipart/form-datawithtemplateandfileparts. AUTHENTICATION(OTP) templates useOTPbuttons withotp_type:COPY_CODE,ONE_TAPorZERO_TAP.parameter_formataccepts onlypositional({{1}}): creating or sending asnamed/parameter_nameis not supported in api-bsp-chattigo. Placeholders must be positional ({{1}},{{2}}, …).