דלג לתוכן הראשי
GET
/
whatsapp
/
templates
curl -g "https://YOUR_PROJECT.texterchat.com/server/api/v2/whatsapp/templates" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
[
  {
    "_id": "6891bb93481ccea320113a91",
    "name": "bulk_marketing_272",
    "title": "<string>",
    "created": 123,
    "updatedAt": "2023-11-07T05:31:56Z",
    "departments": [
      "<string>"
    ],
    "isDefault": true,
    "setBotNode": "<string>",
    "bot": "<string>",
    "replyText": "<string>",
    "responsibleAgent": "<string>",
    "responsibleDepartment": "<string>",
    "attachedFile": {
      "name": "<string>",
      "url": "<string>"
    },
    "provider": "<string>",
    "channelInfo": {
      "accountId": "972586640430"
    },
    "provider_template": {
      "name": "<string>",
      "category": "MARKETING",
      "localizations": [
        {
          "rejectionReason": "NONE",
          "language": "he",
          "components": [
            {
              "text": "<string>",
              "example": {
                "header_handle": [
                  "<string>"
                ],
                "body_text": [
                  [
                    "<string>"
                  ]
                ]
              },
              "buttons": [
                {
                  "text": "<string>",
                  "url": "<string>",
                  "phone_number": "<string>",
                  "flow_id": "<string>",
                  "navigate_screen": "<string>",
                  "example": {
                    "url": "<string>"
                  }
                }
              ]
            }
          ],
          "metadata": {},
          "createdAt": "2023-11-07T05:31:56Z",
          "lastUpdated": "2023-11-07T05:31:56Z",
          "qualityScore": {
            "score": "<string>",
            "reasons": [
              "High block rate"
            ]
          }
        }
      ],
      "metadata": {}
    },
    "defaults": {},
    "localizationDrafts": {}
  }
]

הרשאות

Authorization
string
header
נדרש

API token generated in Texter: gear icon → Developers → API Tokens. When creating a token, assign it the scopes required by the endpoints you plan to call - each endpoint lists its required scopes.

פרמטרי שאילתה

hasHeader
enum<string>

When true, returns only templates that include a header. When false, excludes all templates that contain a header

אפשרויות זמינות:
true,
false
accountId
string

Filters results to templates belonging to the specified account

includeAll
enum<string>

When true, returns all templates including pending and rejected

אפשרויות זמינות:
true,
false
syncFresh
enum<string>

When true, triggers a real-time synchronization with the WhatsApp API before returning the list. Requires accountId to be set (to prevent performance overhead)

אפשרויות זמינות:
true,
false

תגובה

An array of the matching template objects. Field-by-field reference: The Template object

_id
string

Unique identifier of the template in Texter

דוגמה:

"6891bb93481ccea320113a91"

name
string

Internal template name (also used as the template ID in API calls)

דוגמה:

"bulk_marketing_272"

title
string

Human-readable title shown in Texter's UI

usage
enum<string>

How this template is intended to be sent: inbox (1-to-1) or bulk (broadcast)

אפשרויות זמינות:
inbox,
bulk
chatStatus
enum<integer>

Status the chat moves to after the recipient replies to this template

אפשרויות זמינות:
0,
1,
2,
3,
4
created
number

When the template was created (epoch ms)

updatedAt
string<date-time>
departments
string[]

Department IDs allowed to use this template. Can be empty

isDefault
boolean

Whether this is the default template for the account. Only one template can be default

setBotNode
string

Bot node to trigger after reply, if chatStatus routes to bot

bot
string

Specific bot to run after reply, if chatStatus routes to bot

replyText
string

Text automatically sent when the recipient replies to the template

responsibleAgent
string

Agent (email) the chat is assigned to after the recipient replies

responsibleDepartment
string

Department ID the chat is assigned to after the recipient replies

attachedFile
object

File automatically sent when the recipient replies, when configured

provider
string

Channel adapter that owns this template (relevant when multiple WhatsApp account types are connected)

channelInfo
object

The channel account this template belongs to

provider_template
object

The template as registered with WhatsApp

defaults
object

Default send values by language code, prefilled when sending the template if the caller does not provide overrides

localizationDrafts
object

Map of language code to draft localization (created but not yet submitted/approved)