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

# Send WhatsApp template

> Send one approved template to one person, filling in its variables, media header and button links. Charged from your wallet at the template category's price.

Scope: `whatsapp:send`.

`number` says which number sent it: `own` or `shared`. On the shared number you can only send templates you created there.

Replies inside the 24-hour window are sent from the WhatsApp inbox. Delivery and read receipts arrive as `whatsapp.status` webhooks; replies as `whatsapp.inbound`.



## OpenAPI

````yaml /openapi.json post /whatsapp/send
openapi: 3.1.0
info:
  title: Messaly API
  version: 1.0.0
  description: >-
    SMS, WhatsApp, email, contacts and CRM for your business. Amounts are in
    KES. Authenticate with an API key (Settings → API keys). A key can be
    limited to scopes and to IP addresses; a key with no scopes can call every
    endpoint here.
servers:
  - url: https://app.telaven.com/api/v1
    description: Production
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Account
    description: Wallet balance and SMS pricing.
  - name: SMS
    description: Send SMS and read messages and analytics.
  - name: SMS campaigns
    description: Create, schedule and send SMS campaigns to lists and tags.
  - name: Contacts
    description: Contacts and contact lists.
  - name: WhatsApp
    description: Send approved WhatsApp templates.
  - name: Email
    description: Email campaigns and unsubscribes.
  - name: CRM
    description: Deals, companies and pipelines.
paths:
  /whatsapp/send:
    post:
      tags:
        - WhatsApp
      summary: Send WhatsApp template
      description: >-
        Send one approved template to one person, filling in its variables,
        media header and button links. Charged from your wallet at the template
        category's price.


        Scope: `whatsapp:send`.


        `number` says which number sent it: `own` or `shared`. On the shared
        number you can only send templates you created there.


        Replies inside the 24-hour window are sent from the WhatsApp inbox.
        Delivery and read receipts arrive as `whatsapp.status` webhooks; replies
        as `whatsapp.inbound`.
      operationId: sendWhatsappTemplate
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Optional. A unique value (e.g. a UUID) per operation, up to 255
            characters. Retrying with the same key and body returns the first
            response instead of doing it again. Kept 24 hours.
          schema:
            type: string
            example: 5f1c2b0e-8d6a-4c1f-9a43-2b7e0f6d1a90
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                to:
                  type: string
                  example: '0712345678'
                  description: The customer's number, e.g. 0712345678 or 254712345678.
                name:
                  type: string
                  example: Jane Wanjiku
                  description: The customer's name, shown in your WhatsApp inbox.
                template:
                  type: object
                  properties:
                    name:
                      type: string
                      example: order_ready
                      description: An approved template (see List WhatsApp templates).
                    language:
                      type: string
                      example: en
                      description: Template language code (default en).
                    params:
                      type: object
                      properties:
                        body:
                          oneOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                          example:
                            - Jane
                            - A1042
                          description: >-
                            Body values: an array for {{1}}, {{2}}… or an object
                            for named variables ({{customer_name}}).
                        header:
                          type: object
                          example:
                            media:
                              type: image
                              link: https://example.com/promo.jpg
                          description: >-
                            `{ text }` for a text header with a variable, or `{
                            media: { type, link, filename? } }` for an image,
                            video or document header (a public https link).
                        buttons:
                          type: array
                          items:
                            type: object
                          example:
                            - index: 0
                              text: A1042
                          description: >-
                            Values for URL buttons with a variable: `{ index,
                            text }`, where index is the button's position
                            (0-based).
                      required: []
                    bodyParams:
                      type: array
                      items:
                        type: string
                      description: >-
                        Older form of `template.params.body` (positional only).
                        Still accepted.
                  required:
                    - name
              required:
                - to
                - template
            example:
              to: '0712345678'
              name: Jane Wanjiku
              template:
                name: order_ready
                language: en
                params:
                  body:
                    - Jane
                    - A1042
                  header:
                    media:
                      type: image
                      link: https://example.com/order.jpg
                  buttons:
                    - index: 0
                      text: A1042
      responses:
        '200':
          description: Success
          content:
            application/json:
              example:
                success: true
                id: 4b7e…
                wamid: wamid.HBgMMjU0NzEyMzQ1Njc4FQIAERgS…
                status: sent
                number: own
                costCents: 80
        '400':
          description: >-
            Missing `to` or template name, invalid number, a template that isn't
            yours or isn't approved, or Meta rejected the message (the error
            explains why).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: No API key, or the key is wrong, disabled or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            INSUFFICIENT_BALANCE: Your wallet doesn't cover the cost. Top up and
            retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            VERIFICATION_REQUIRED: The platform requires account verification
            before sending, and yours isn't approved yet. / The key doesn't have
            the scope this endpoint needs, or it's used from an address its IP
            allowlist doesn't include.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            WhatsApp isn't connected for your business and the shared number
            isn't available. / IDEMPOTENCY_IN_PROGRESS: A request with this
            Idempotency-Key is still running. Wait and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            IDEMPOTENCY_KEY_REUSED: This Idempotency-Key was already used for a
            different request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            More than 120 requests in a minute with this key. Wait for the
            number of seconds in Retry-After.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >-
            Something went wrong on our side. Retry with backoff. A POST sent
            with an Idempotency-Key replays this same error for that key,
            because the request may have partly run: check the result before
            trying again with a new key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        code:
          type: string
          description: Machine-readable code where one exists, e.g. INSUFFICIENT_BALANCE.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Authorization: Bearer tlv_…'
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.