> ## Documentation Index
> Fetch the complete documentation index at: https://help.texterchat.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Template Message

> Send an existing, approved template message to a recipient. You can provide dynamic variables, header media, and metadata about the recipient, and you can override predefined behaviors such as the action performed after the recipient replies.

**Required token scopes:** `Send template messages`

**Phone number formats:** `to` is flexible - `0521234567`, `972521234567`, `+972 52-123-4567` etc. are all accepted and normalized.

**Unsubscribed recipients:** if the recipient unsubscribed from template messages, the message is **not** sent and the API responds with HTTP 200, `success: false` and an explanatory `error` (e.g. `"Recipient unsubscribed from template messages on ..."`).

All status values, type enums and the ID cheat sheet: [Enums & Common Fields](/he/api-reference/enums).


## OpenAPI

````yaml he/api-reference/openapi.json POST /whatsapp/templates/send
openapi: 3.1.0
info:
  title: Texter API V2
  version: 2.0.0
  description: >-
    The **Texter API** lets your developers control the Texter platform
    programmatically:


    - Manage and send your WhatsApp template messages

    - Retrieve chats by ID or by various filters

    - Assign and resolve conversations

    - Send session messages into active chats

    - Manage labels

    - Monitor and resolve channel health issues

    - Subscribe to real-time webhook events

    - Manage quick replies (coming soon)


    For any questions please contact [Texter
    Support](https://wa.me/972586640430).
  contact:
    name: Texter Support
    url: https://wa.me/972586640430
servers:
  - url: https://{projectID}.texterchat.com/server/api/v2
    description: Your Texter environment. Replace projectID with your project subdomain
    variables:
      projectID:
        default: demo
        description: >-
          Your unique project subdomain. If your environment URL is
          https://demo.texterchat.com, your projectID is "demo"
security:
  - bearerAuth: []
tags:
  - name: Manage Templates
    description: >-
      Create, localize, submit, update, delete and send WhatsApp template
      messages, and retrieve approved templates for your connected WhatsApp
      accounts.


      **Suggested token for this group** - create one API token with the scopes:
      *Send template messages*, *View template messages*, *Manage WhatsApp
      templates*, *Manage all chats*, *List all chats* (the last two also cover
      the Templates Subscriptions group). Each endpoint below also lists the
      exact scopes it needs.
  - name: Templates Subscriptions
    description: >-
      Manage recipient subscriptions for WhatsApp template messages -
      unsubscribe or resubscribe recipients, and list unsubscribed users across
      all channels or for a specific account.


      **Suggested token for this group** - scopes: *Manage all chats*, *List all
      chats*. Each endpoint below also lists the exact scopes it needs.
  - name: Messages
    description: >-
      Retrieve message history from a chat, or send new session messages - text,
      media, buttons, lists, contact cards and locations - within the active
      WhatsApp 24-hour session window.


      **Suggested token for this group** - scopes: *Send session message*, *View
      all chats*. Each endpoint below also lists the exact scopes it needs.
  - name: Chats
    description: >-
      Fetch chat details, search conversations, update chat properties, assign
      or resolve chats, and manage their CRM metadata.


      **Suggested token for this group** - scopes: *Manage all chats*, *List all
      chats*, *Send session message*. Each endpoint below also lists the exact
      scopes it needs.
  - name: Labels
    description: >-
      Create and edit labels, assign or remove them from chats, retrieve label
      data, or delete labels from your inbox.


      **Suggested token for this group** - scopes: *Manage labels*, *Manage all
      chats* (needed for managing labels on chats). Each endpoint below also
      lists the exact scopes it needs.
  - name: Channels
    description: >-
      Monitor and maintain the health of connected messaging channels - retrieve
      active channel health problems, filter them by severity or account, and
      mark issues as resolved.


      **Suggested token for this group** - scopes: *Manage channels*. Each
      endpoint below also lists the exact scopes it needs.
  - name: Quick Replies
    description: >-
      Manage quick replies - prepared messages agents can send into matching
      chats with one click. Quick replies marked with `aiQuickReply` client
      metadata appear as **AI suggestions** in the Texter inbox (see Create
      Quick Reply for the full flow).


      **Suggested token for this group** - scopes: *View quick replies*, *Manage
      quick replies*. Each endpoint below also lists the exact scopes it needs.
  - name: Files
    description: >-
      Generate public access links to media files stored in Texter.


      **Suggested token for this group** - scopes: *View all files*, *View all
      chats* (both required). Each endpoint below also lists the exact scopes it
      needs.
  - name: Subscribe to Events
    description: >-
      Register webhooks for events occurring in your Texter environment. Under
      the hood this uses **Scenarios** - a workflow automation feature within
      Texter. To make integration easy, pre-defined templates are provided:
      import a scenario JSON, plug in your webhook URL and user UID, and the
      subscription is active.


      See the **Webhook Events** pages for the payload your URL receives for
      each event.


      **Suggested token for this group** - scopes: *View scenarios*, *Create
      scenarios*, *Delete scenarios*, *Activate/inactivate scenarios*, *Manage
      scenarios on behalf of user*. Each endpoint below also lists the exact
      scopes it needs.


      If the provided templates don't satisfy your needs, contact [Texter
      Support](https://wa.me/972586640430) and we'll gladly help modify any
      triggers, conditions or actions for your webhook.
  - name: Scenarios (Advanced)
    description: >-
      Full programmatic control over scenarios for advanced automations: create
      scenarios from scratch, copy them, edit drafts, publish revisions, inspect
      execution runs, and discover the available building blocks (events,
      conditions, loaders, actions). For plain webhook subscriptions, the
      **Subscribe to Events** group with its ready-made templates is the simpler
      path.


      **Suggested token for this group** - scopes: *View scenarios*, *Create
      scenarios*, *Edit scenarios*, *Delete scenarios*, *Activate/inactivate
      scenarios*, *Manage scenarios on behalf of user*, *View scenarios runs*.
      Each endpoint below also lists the exact scopes it needs.
paths:
  /whatsapp/templates/send:
    post:
      tags:
        - Manage Templates
      summary: Send Template Message
      description: >-
        Send an existing, approved template message to a recipient. You can
        provide dynamic variables, header media, and metadata about the
        recipient, and you can override predefined behaviors such as the action
        performed after the recipient replies.


        **Required token scopes:** `Send template messages`



        **Phone number formats:** `to` is flexible - `0521234567`,
        `972521234567`, `+972 52-123-4567` etc. are all accepted and normalized.


        **Unsubscribed recipients:** if the recipient unsubscribed from template
        messages, the message is **not** sent and the API responds with HTTP
        200, `success: false` and an explanatory `error` (e.g. `"Recipient
        unsubscribed from template messages on ..."`).


        All status values, type enums and the ID cheat sheet: [Enums & Common
        Fields](/he/api-reference/enums).
      operationId: send-template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                templateName:
                  type: string
                  pattern: ^[a-zA-Z0-9_-]+$
                  description: The template's unique name (ID) to send
                to:
                  type: string
                  description: Recipient's phone number
                from:
                  type: string
                  description: >-
                    The sender's WhatsApp account number. If not provided while
                    multiple channels exist, the template is sent from the
                    default channel
                language:
                  type: string
                  description: >-
                    Template localization code to send (e.g. `en`, `he`).
                    Auto-selected when the template has a single localization
                body:
                  type: array
                  items:
                    type: string
                  description: >-
                    Values for template body variables (`{{1}}`, `{{2}}`, ...)
                    in order. **Required if the template includes variables.**
                    Values must not contain line breaks, tabs, or 5+ consecutive
                    spaces
                header:
                  type: object
                  description: >-
                    Header media to use when sending (overrides the template
                    default): `type` + `url`, plus `filename` for documents
                  properties:
                    type:
                      type: string
                      enum:
                        - image
                        - video
                        - document
                    url:
                      type: string
                      description: Public HTTP(S) URL of the media file (for media types)
                    filename:
                      type: string
                      description: >-
                        File name displayed to the recipient. Only for type
                        `document`
                setChat:
                  type: object
                  description: Data to update on the chat when sending
                  properties:
                    crmData:
                      description: >-
                        Key-value object (or JSON string) containing CRM fields
                        to merge into the chat
                      oneOf:
                        - type: object
                          additionalProperties: true
                        - type: string
                buttons:
                  type: array
                  description: >-
                    Button payload values. **Required if the template includes a
                    variable in a URL button** (inject the variable value) **or
                    was made with a Flow form**. Non-English values for URL
                    payloads should be URL-encoded
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - url
                          - flow
                          - quick_reply
                          - voice_call
                        description: Type of the button
                      payload:
                        type: string
                        description: >-
                          Value to inject into the URL variable, or the Flow ID
                          from Business Manager
                      flow_id:
                        type: string
                      flow_action:
                        type: string
                        enum:
                          - navigate
                          - data_exchange
                      navigate_screen:
                        type: string
                      flow_token:
                        type: string
                      mode:
                        type: string
                        enum:
                          - draft
                          - published
                    required:
                      - type
                      - payload
                replyAction:
                  type: object
                  description: >-
                    Defines behavior after the recipient replies (overrides the
                    template defaults)
                  properties:
                    chatStatus:
                      description: >-
                        Status after reply: `BOT`, `ASSIGNED` or `RESOLVED`
                        (numeric values `0`, `2`, `3` also accepted). `PENDING`
                        is not allowed here
                      oneOf:
                        - type: string
                          enum:
                            - BOT
                            - ASSIGNED
                            - RESOLVED
                        - type: integer
                          enum:
                            - 0
                            - 2
                            - 3
                    responsibleAgent:
                      type: string
                      description: Assigns the chat to a specific agent (email or UID)
                    responsibleDepartment:
                      type: string
                      description: Assigns the chat to a department (department ID)
                    replyText:
                      type: string
                      description: Text message automatically sent after the client replies
                    setBotNode:
                      type: string
                      minLength: 1
                      description: >-
                        Bot node to start from after the client replies (only
                        when `chatStatus` is `BOT`)
                    bot:
                      type: string
                      description: >-
                        Specific bot to run after the client replies (only when
                        `chatStatus` is `BOT`)
                    expirationTime:
                      type: integer
                      minimum: 10
                      maximum: 31536000
                      description: >-
                        Time in seconds after which the reply action expires (10
                        seconds to 1 year). Defaults to 24 hours
                sessionMessage:
                  type: object
                  description: >-
                    Attempt to send as a regular **session message** instead of
                    a template when the 24-hour window is open (no template fee)
                  properties:
                    enabled:
                      type: boolean
                    options:
                      type: object
                      properties:
                        omitHeader:
                          type: boolean
                          description: Omit the header when sending as a session message
                        omitFooter:
                          type: boolean
                          description: Omit the footer when sending as a session message
                  required:
                    - enabled
                bulkReportTitle:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Groups individual API calls into a single entry in the Bulk
                    Reports dashboard. Use a consistent title across multiple
                    requests to aggregate their statistics under one report
                saveBody:
                  type: array
                  items:
                    type: string
                  description: >-
                    Replace the actual template parameters in the database with
                    these values (useful for sensitive data like OTP codes)
                ignoreExcessParameters:
                  type: boolean
                  description: >-
                    If true, extra parameters in `body` are ignored instead of
                    failing the request
                whitespaceAbsentParameters:
                  type: boolean
                  description: >-
                    Replace missing parameters with a single whitespace instead
                    of failing
                skipHeaderFileURLCheck:
                  type: boolean
                  description: >-
                    Skip validation (HEAD request) of header media URL
                    accessibility
                skipChatConditions:
                  type: object
                  description: >-
                    Skip sending entirely when the chat is currently in one of
                    the given statuses
                  properties:
                    statuses:
                      type: array
                      items:
                        $ref: '#/components/schemas/ChatStatus'
                skipReplyActionChatConditions:
                  type: object
                  description: >-
                    Skip applying the reply action when the chat is currently in
                    one of the given statuses
                  properties:
                    statuses:
                      type: array
                      items:
                        $ref: '#/components/schemas/ChatStatus'
              required:
                - templateName
                - to
            examples:
              Simple template:
                value:
                  templateName: inbox_marketing_98
                  to: '972521234567'
              Template with parameters:
                value:
                  templateName: bulk_marketing_93
                  to: '+972521234567'
                  body:
                    - John
                    - '2'
              Template with image header:
                value:
                  templateName: inbox_utility_119
                  to: '0521234567'
                  header:
                    type: image
                    url: >-
                      https://storage.googleapis.com/texter-public-files/customers/ninja/texter-logo.png
              Template with document header:
                value:
                  templateName: inbox_marketing_137
                  to: '0521234567'
                  header:
                    type: document
                    filename: Welcome To Texter
                    url: >-
                      https://storage.googleapis.com/texter-public-files/customers/ninja/texter-api.pdf
              Template with CRM data:
                value:
                  templateName: inbox_marketing_87
                  to: 052-1234567
                  setChat:
                    crmData:
                      leadId: 123072
                      leadName: John Doe
              Template with dynamic URL button:
                value:
                  templateName: bulk_marketing_269
                  to: '972521234567'
                  buttons:
                    - type: url
                      payload: dynamic_url
              Override reply action:
                value:
                  templateName: inbox_utility_42
                  to: '972521234567'
                  replyAction:
                    chatStatus: ASSIGNED
                    responsibleAgent: demo@texterchat.com
                    replyText: Thanks! An agent will be with you shortly.
                    expirationTime: 86400
              Prefer session message when possible:
                value:
                  templateName: inbox_marketing_98
                  to: '972521234567'
                  sessionMessage:
                    enabled: true
                    options:
                      omitHeader: true
                      omitFooter: true
              Flow form template:
                value:
                  templateName: appointment_booking
                  to: '972521234567'
                  buttons:
                    - type: flow
                      payload: '24029016663366476'
              Specific sender + bulk report:
                value:
                  templateName: bulk_marketing_93
                  to: '972521234567'
                  from: '972586640430'
                  body:
                    - John
                    - '2'
                  bulkReportTitle: June newsletter
              Route the reply to a department:
                value:
                  templateName: inbox_utility_42
                  to: '972521234567'
                  replyAction:
                    chatStatus: ASSIGNED
                    responsibleDepartment: customer_service
                    replyText: תודה! מעבירים אותך לצוות שירות הלקוחות.
              OTP with hidden parameters:
                value:
                  templateName: otp_code
                  to: '972521234567'
                  body:
                    - '845112'
                  saveBody:
                    - '******'
              Skip if an agent is already handling the chat:
                value:
                  templateName: bulk_marketing_93
                  to: '972521234567'
                  body:
                    - John
                    - '2'
                  skipChatConditions:
                    statuses:
                      - PENDING
                      - ASSIGNED
              Skip only the reply action for active chats:
                value:
                  templateName: inbox_utility_42
                  to: '972521234567'
                  replyAction:
                    chatStatus: BOT
                    setBotNode: campaign_followup
                  skipReplyActionChatConditions:
                    statuses:
                      - ASSIGNED
              Send a specific language:
                value:
                  templateName: inbox_marketing_95
                  to: '+12025550123'
                  language: en_US
                  body:
                    - John
              Lenient parameter handling:
                value:
                  templateName: bulk_marketing_93
                  to: '972521234567'
                  body:
                    - John
                    - '2'
                    - extra-ignored
                  ignoreExcessParameters: true
                  whitespaceAbsentParameters: true
                  skipHeaderFileURLCheck: true
      responses:
        '200':
          description: >-
            The result of the send operation. Note: an unsubscribed recipient
            also returns HTTP 200 but with `success: false`
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the template message was successfully sent
                  text:
                    type: string
                    description: >-
                      The final rendered message text after inserting all
                      variable values
                  sentAsSessionMessage:
                    type: boolean
                    description: >-
                      Whether the message was sent as a session message instead
                      of a template message
                  messageId:
                    type: string
                    description: Unique identifier of the message created in Texter
                  error:
                    type: string
                    description: Error description, present when `success` is false
              examples:
                Sent successfully:
                  value:
                    success: true
                    text: |-
                      Hi John.
                      This is an example of a template body with 2 variables.
                    sentAsSessionMessage: false
                    messageId: 690883c5962e17ab3033f92f
                Recipient unsubscribed:
                  value:
                    success: false
                    error: >-
                      Recipient unsubscribed from template messages on Mon Nov
                      03 2025 10:12:31 GMT+0000
        '400':
          description: Validation error or template not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendErrorResponse'
              example:
                error: Template "nonexistent_template" not found
                success: false
        '401':
          description: Missing or invalid token, or missing required scope
components:
  schemas:
    ChatStatus:
      type: integer
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
      description: >-
        Chat status: `0` = BOT (handled by bot), `1` = PENDING (waiting for an
        agent), `2` = ASSIGNED (shown as "Taken" in Texter), `3` = RESOLVED, `4`
        = BULK
    SendErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
        success:
          type: boolean
          example: false
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        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.

````