Skip to content

Edit template

Updates an existing template. After the edit, the template returns to PENDING for Meta review.

Endpoint: PUT /v1/templates/{did}/{messageTemplateId}

Parameters

Path

ParameterTypeRequiredDescription
didstringYesTarget ID.
messageTemplateIdstringYesTemplate ID.

Body

FieldTypeRequiredDescription
namestringNoTemplate name.
languagestringNoLanguage code.
categorystringNoTemplate category.
componentsarrayYesFull components (replaced, no merge).
client_idnumberNoClient (requires BSP_CN for another client).
allow_button_url_changebooleanNoAllows migrating URL buttons.
optimization_specobjectNoBid cap (max price).
Only components is strictly required. name and language cannot be changed when editing: the API ignores them for Meta. If the template is APPROVED, the category cannot be changed either.

Request

curl --request PUT \
  --url 'https://api.chattigo.com/v1/templates/{did}/{messageTemplateId}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "category": "MARKETING",
    "components": [
      {
        "type": "HEADER",
        "format": "TEXT",
        "text": "Sale {{1}}",
        "example": { "header_text": ["Summer"] }
      },
      {
        "type": "BODY",
        "text": "Get {{1}} off",
        "example": { "body_text": [["50%"]] }
      }
    ]
  }'

Response

Success (200)

{
  "success": true,
  "changed": true
}

No changes (200)

If the edit introduces no real changes (e.g. same header_handle), the API detects differs()=false, skips the Meta PATCH and responds with changed: false and a message:

{
  "success": true,
  "changed": false,
  "message": "No changes detected — template already up to date"
}

The changed field lets you tell a “no-op” 200 (nothing was touched) apart from one where the template was actually updated in Meta.

Errors

CodeCase
400Failed edit rules or examples validation
403DID outside the hierarchy, or access to another client without BSP_CN
502External service unreachable