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

# Send template

> Sends one approved WhatsApp template to a single recipient with the variable values supplied by your application. Use this endpoint for transactional or campaign messages that must follow a Meta-approved template, including optional header media and button values.



## OpenAPI

````yaml /openapi.json post /templates/{id}/send
openapi: 3.1.0
info:
  title: Wachat API
  version: v1
  description: >-
    Wachat REST API. Authenticate with a workspace API key: send it as
    `Authorization: Bearer <key>`. Generate keys in the dashboard under
    Developers / API.
servers:
  - url: https://crm.wachat.net/api/v1
security:
  - http: []
tags:
  - name: Message
    description: >-
      Send a single WhatsApp message — text, media (image / video / document /
      audio) or a location pin — to one number, then read its delivery status or
      your message history. A file can be attached directly as a multipart
      `media` field or referenced by a public URL.
  - name: Template
    description: >-
      Create, list and manage your approved WhatsApp templates, and send a
      template to one number with your own header, body variables and button
      values. Use this for utility / marketing sends that need a pre-approved
      template — including one with a PDF / document header (pass the file's
      public URL as the header, e.g. from the Media endpoint).
  - name: Media
    description: >-
      Upload a file once (multipart / form-data, field name `file`, up to 16 MB)
      and get back a hosted public URL you can reuse across sends — for example
      a PDF to use as a document-header on a template, or an image on a message.
  - name: Contact
    description: >-
      Full create / read / update / delete over your contacts and leads,
      including search by number, tags and custom attributes.
  - name: ContactGroup
    description: >-
      Organise contacts into groups: create groups, list them, and add or remove
      members — handy for targeting broadcasts and campaigns.
  - name: Broadcast
    description: >-
      Send the same message to many contacts at once and track each broadcast's
      progress and per-recipient delivery.
  - name: Campaign
    description: >-
      Create, start, pause and monitor drip / marketing campaigns and their
      recipients.
  - name: Scheduled
    description: >-
      Schedule a WhatsApp send for a future time, list upcoming scheduled
      messages, and cancel one before it goes out.
  - name: AutoReply
    description: >-
      Manage keyword auto-replies — the automatic responses that fire when an
      inbound message matches a rule.
  - name: Flow
    description: >-
      Enroll a contact into an automation flow (chatbot) and manage your flows
      through the API.
  - name: Device
    description: >-
      List the WhatsApp numbers / devices connected to your workspace and check
      each one's connection status.
  - name: Webhook
    description: >-
      Register and manage webhook endpoints so Wachat POSTs real-time events
      (message received / sent / delivered / read / failed, plus campaign and
      contact events) to your server. When you set a signing secret each
      delivery carries an HMAC-SHA256 signature header you can verify.
  - name: Deal
    description: >-
      Manage sales-pipeline deals — create, list, update and move deals between
      stages.
  - name: Conversation
    description: >-
      Read your workspace inbox: list chat threads (conversations) and fetch the
      messages inside a thread.
  - name: Account
    description: Read your account details, plan, limits and message-credit usage.
paths:
  /templates/{id}/send:
    post:
      tags:
        - Template
      summary: Send template
      description: >-
        Sends one approved WhatsApp template to a single recipient with the
        variable values supplied by your application. Use this endpoint for
        transactional or campaign messages that must follow a Meta-approved
        template, including optional header media and button values.
      operationId: v1.templates.send
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                to:
                  type: string
                  description: >-
                    Recipient phone in international format — digits or +E.164
                    (e.g. 919812345678). Required.
                  maxLength: 32
                device_id:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Optional sender selector: baileys:<device_id>,
                    waba:<config_id>,

                    or twilio:<config_id>. Blank uses the workspace default.
                  maxLength: 64
                header_text:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Value for a {{1}} in a TEXT header. Only for text-header
                    templates.
                  maxLength: 1024
                header_media_url:
                  type:
                    - string
                    - 'null'
                  format: uri
                  description: >-
                    Public https URL for an IMAGE / VIDEO / DOCUMENT header.
                    Only for media-header templates.
                  maxLength: 2048
                header_media:
                  type:
                    - string
                    - 'null'
                  format: binary
                  contentMediaType: application/octet-stream
                  description: >-
                    OR attach the header file (PDF / image / video) directly in
                    ONE multipart/form-data

                    request — field name `header_media`, up to 16 MB. We host it
                    and use it as the header,

                    so you don't need a separate upload call. Takes precedence
                    over header_media_url.
                  maxLength: 16384
                header_filename:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Display filename the recipient sees for a DOCUMENT header
                    (e.g. "Invoice-2045.pdf").

                    Optional — when you attach header_media we default it to the
                    uploaded file's own name.
                  maxLength: 255
                body:
                  type:
                    - array
                    - 'null'
                  description: >-
                    BODY variables, positional -> {{1}}, {{2}}, ... Send a list
                    ["John","12345"]

                    or a 1-indexed map {"1":"John","2":"12345"}. Omit if the
                    body has no variables.
                  items:
                    type:
                      - string
                      - 'null'
                    maxLength: 1024
                buttons:
                  type:
                    - array
                    - 'null'
                  description: >-
                    Dynamic button parameters, one object per variable button,
                    e.g. [{"index":0,"sub_type":"url","value":"ORDER123"}].
                  items:
                    type: object
                    properties:
                      index:
                        type:
                          - integer
                          - 'null'
                        description: Zero-based position of the button in the template.
                        minimum: 0
                      sub_type:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Button kind: "url" (dynamic URL suffix) or
                          "quick_reply" (payload).
                        maxLength: 32
                      value:
                        type:
                          - string
                          - 'null'
                        description: The dynamic value — URL suffix or quick-reply payload.
                        maxLength: 2048
              required:
                - to
      responses:
        '201':
          description: Resource created successfully.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          wamid:
                            type:
                              - string
                              - 'null'
                          status:
                            type: string
                            const: sent
                          template_id:
                            type: integer
                          template_name:
                            type: string
                          to:
                            anyOf:
                              - type: 'null'
                              - type: array
                                items: {}
                              - type: string
                              - type: object
                        required:
                          - wamid
                          - status
                          - template_id
                          - template_name
                          - to
                      meta:
                        type: string
                    required:
                      - data
                      - meta
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          status:
                            type: string
                            const: sent
                          template_id:
                            type: integer
                          template_name:
                            type: string
                          to:
                            anyOf:
                              - type: 'null'
                              - type: array
                                items: {}
                              - type: string
                              - type: object
                          provider:
                            type: string
                            const: baileys
                          message_id:
                            type:
                              - string
                              - 'null'
                        required:
                          - status
                          - template_id
                          - template_name
                          - to
                          - provider
                          - message_id
                      meta:
                        type: string
                    required:
                      - data
                      - meta
        '404':
          description: Request failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        const: template_not_found
                      message:
                        type: string
                        const: Template not found in this workspace.
                      details:
                        type: string
                    required:
                      - code
                      - message
                      - details
                required:
                  - error
        '422':
          $ref: '#/components/responses/ValidationException'
          description: Request failed.
components:
  responses:
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      scheme: bearer

````