דלג לתוכן הראשי
POST
/
whatsapp
/
templates
/
{accountId}
curl --request POST \
  --url https://{projectID}.texterchat.com/server/api/v2/whatsapp/templates/{accountId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "Example Template",
  "category": "MARKETING",
  "chatStatus": 1,
  "usage": "inbox"
}
'
{
  "_id": "690868f7962e17ab3033f91b",
  "name": "inbox_marketing_95",
  "channelInfo": {
    "name": "whatsapp",
    "accountId": "972509876543"
  },
  "chatStatus": 1,
  "created": 1762158839563,
  "departments": [],
  "isDefault": false,
  "localizationDrafts": {},
  "provider_template": {
    "name": "inbox_marketing_95",
    "category": "MARKETING",
    "localizations": [],
    "metadata": {}
  },
  "title": "Example Template",
  "updatedAt": "2025-11-03T08:33:59.563Z",
  "usage": "inbox"
}

הרשאות

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.

פרמטרי נתיב

accountId
string
נדרש

The account ID of the channel in Texter. For WhatsApp channels this is the phone number connected to the account (e.g. 972586640430)

גוף

application/json
title
string
נדרש

Internal title shown in Texter

category
enum<string>
נדרש

WhatsApp template category. WhatsApp may adjust this value upon submission based on the template's semantic classification

אפשרויות זמינות:
MARKETING,
UTILITY
chatStatus
enum<integer>
נדרש

The chat status after the recipient replies to the template: 0 = BOT, 1 = PENDING, 2 = ASSIGNED, 3 = RESOLVED

אפשרויות זמינות:
0,
1,
2,
3
usage
enum<string>
נדרש

Whether this template is intended to be sent individually (inbox) or in bulk (bulk)

אפשרויות זמינות:
inbox,
bulk
name
string

The template name (which serves as its ID). Auto-generated if not specified. Must be unique per account. Only letters, numbers and underscores are allowed

Pattern: ^[a-zA-Z0-9_]+$
isDefault
boolean

Defaults to false. Only one template can be the default

departments
string[]

Department IDs that have access to this template

setBotNode
string

If chatStatus is 0 (BOT), the bot starts running from this specific node when the recipient replies. Must be an existing node in the channel's bot

responsibleAgent
string

Assign the chat to this agent (agent email in Texter) after the recipient replies. Can't be combined with responsibleDepartment

responsibleDepartment
string

Assign the chat to this department (department ID from Texter) after the recipient replies. Can't be combined with responsibleAgent

replyText
string

Text sent automatically when the recipient replies to the template

תגובה

The newly created template object. Field-by-field reference: The Template object

A WhatsApp template in Texter, including internal behavior (chat routing rules, departments, defaults) and provider state (WhatsApp approval status, localized content)

_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)