Skip to content

List templates

Lists the client’s templates, one per template with its assigned campaigns and channels, with pagination and filters.

Endpoint: GET /v1/templates

Parameters

Query

ParameterTypeRequiredDescription
statestringNoStatus filter (APPROVED, PENDING, …).
searchstringNoSearch by name.
categorystringNoCategory filter.
langstringNoLanguage filter.
didstringNoDID filter.
namestringNoExact name.
template_meta_idstringNoMeta template ID.
activebooleanNoActive/inactive filter.
deletedbooleanNoDeletion state. true → only deleted templates. false or omitted → excludes deleted.
campaign_namestringNoExact campaign name (allows fetching Unassigned).
fieldsstringNoFields to return per template (CSV). Whitelist: id, waba_id, client_id, active, namespace, meta_template, channel_campaigns. Omitted returns all.
size / limitnumberNoPage size.
pagenumberNoPage number.
client_idnumberConditionalClient whose templates are listed.
channel_idsstringNoChannel filter (CSV).
quality_scoresstringNoQuality filter (CSV).

Request

curl --request GET \
  --url 'https://api.chattigo.com/v1/templates?fields=id,waba_id,namespace,meta_template,channel_campaigns&size=10&page=1' \
  --header 'Authorization: Bearer <token>'

Response

Success (200)

{
  "data": [
    {
      "id": "664a1b2c3d4e5f6000000001",
      "active": true,
      "client_id": 1001,
      "namespace": "abc_123",
      "waba_id": "123456789012345",
      "meta_template": {
        "id": "7890123456789012",
        "name": "welcome",
        "language": "es",
        "status": "APPROVED",
        "category": "UTILITY",
        "components": [{ "type": "BODY", "text": "Hola {{1}}" }],
        "quality_score": { "score": "HIGH" }
      },
      "channel_campaigns": [
        {
          "campaign_id": 123,
          "campaign_name": "Camp 1",
          "channels": [
            { "channel_id": 456, "did": "5731...", "type": "WHATSAPP" }
          ]
        }
      ]
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 20,
  "paging": null
}

total, page and pageSize are always returned regardless of the fields filter. Templates with no assigned campaign are returned with channel_campaigns: [].

Direct-message templates: the regular listing excludes templates with isDirectMessage: true. Only regular templates are returned (isDirectMessage set to false or absent).

Empty fields omitted: within meta_template, fields that do not apply are omitted from the response: example when empty ({}), format/text/buttons when null, and previous_category, quality_score and rejected_reason when empty. Example: a BODY-only template with no rejection does not include rejected_reason in meta_template.

Errors

CodeCase
400agent without campaigns (token without BSP_CN and no campaigns)
400client_id is required (token with BSP_CN without client_id)
400invalid client_id: <value> (the client_id value is not numeric)
403BSP_CN permission required for cross-client access (token without BSP_CN sending a client_id different from its own token)