Skip to content

Create template

Creates a WhatsApp message template in the given DID.

Endpoint: POST /v1/templates/{did}

Parameters

Path

ParameterTypeRequiredDescription
didstringYesTarget ID.

Query

ParameterTypeRequiredDescription
client_idnumberNoClient. Requires BSP_CN if it differs from the token.

Body

FieldTypeRequiredDescription
namestringYesTemplate name (unique per WABA).
languagestringYesLanguage code: es, en_US, pt_BR
categorystringYesMARKETING, UTILITY or AUTHENTICATION.
componentsarrayYesComponents: HEADER, BODY, FOOTER, BUTTONS.
parameter_formatstringNoFormat 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_idnumberNoClient (requires BSP_CN for another client).
channel_campaignsobjectNoAutomatic channel/campaign assignment.
optimization_specobjectNoBid cap (max price): bid_amount, bid_strategy, bid_country_multiplier_overrides.
allow_button_url_changebooleanNoMigrates URL buttons to the dynamic format (url-mapper redirect).
allow_category_changebooleanNoAllows Meta to recategorize the template automatically.
add_security_recommendationbooleanNoAUTHENTICATION: appends the “For your security…” line.
code_expiration_minutesnumberNoAUTHENTICATION: OTP code validity (default 10 min, 30s–15min).
message_send_ttl_secondsnumberNoDelivery validity (TTL) in seconds. Passed directly to Meta. Ranges: AUTHENTICATION 30–900, UTILITY 30–43200, MARKETING 43200–2592000. -1 = 30 days (auth/utility only).
countrystringNoCountry 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

CodeCase
400did is required, failed component/example validation, invalid media
400header_source and header_handle mutually exclusive
400URL de media no HTTPS o IP privada (bloqueada por seguridad)
403DID outside the WABA hierarchy, or access to another client without BSP_CN
413Multipart exceeds the maximum size
502External service unreachable

Notes

  • After a successful create, the template is registered and the creation event is fired.
  • The file mode requires multipart/form-data with template and file parts.
  • AUTHENTICATION (OTP) templates use OTP buttons with otp_type: COPY_CODE, ONE_TAP or ZERO_TAP.
  • parameter_format accepts only positional ({{1}}): creating or sending as named/parameter_name is not supported in api-bsp-chattigo. Placeholders must be positional ({{1}}, {{2}}, …).