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

# Send a WhatsApp message

> Sends a WhatsApp template message from a registered sender to a recipient.



## OpenAPI

````yaml https://wavix.github.io/wavix-openapi/wavix-api.yaml post /v1/whatsapp/messages
openapi: 3.1.0
info:
  title: Wavix APIs
  description: >-
    Wavix provides robust APIs that let you integrate voice and text messaging
    features directly into your app. Send text, place calls, and access detailed
    reports  programmatically.
  termsOfService: https://wavix.com/terms-and-conditions
  license:
    name: MIT
    identifier: MIT
  contact:
    name: Wavix
    url: https://wavix.com
    email: support@wavix.com
  version: '1.0'
servers:
  - url: https://api.wavix.com
    description: https://api.wavix.com
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: SIP trunks
  - name: Buy
    description: Numbers
  - name: Cart
    description: Numbers
  - name: My numbers
    description: Numbers
  - name: Billing
    description: Billing, transactions, and invoices
  - name: Profile
    description: Account profile and customer information
  - name: CDRs
    description: Call detail records and call history
  - name: Speech Analytics
    description: Call transcription and speech analytics
  - name: SMS and MMS
    description: Messaging
  - name: Number Validator
    description: Phone number validation
  - name: Link shortener
    description: Short link and click metrics
  - name: 2FA
    description: Two-factor authentication
  - name: 10DLC
    description: 10DLC Campaigns and Brands
  - name: API Keys
    description: API key management
  - name: Call webhooks
    description: Webhook configuration for call events
  - name: Call control
    description: Programmable Voice
  - name: Call streaming
    description: Real-time call audio streaming over WebSocket
  - name: Call recording
    description: Call recording
  - name: Sub-accounts
    description: Sub-account management
  - name: Voice campaigns
    description: Outbound voice campaigns
  - name: Wavix Embeddable
    description: WebRTC embeddable widget
  - name: WhatsApp
    description: WhatsApp senders, templates, and messages
paths:
  /v1/whatsapp/messages:
    post:
      tags:
        - WhatsApp
      summary: Send a WhatsApp message
      description: >-
        Sends a WhatsApp template message from a registered sender to a
        recipient.
      operationId: whatsapp_messages_send
      parameters: []
      requestBody:
        description: Attributes for the message to send.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsAppMessageSendRequest'
        required: true
      responses:
        '201':
          description: The submitted message, with its `uuid` and initial status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsAppMessageSendResponse'
        '400':
          description: >-
            Returns when `from`/`to` are not valid phone numbers, or a button
            entry is malformed.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/WhatsAppProblem'
              examples:
                invalid-request:
                  value:
                    type: https://wavix.com/problems/invalid-request
                    title: Invalid Request
                    status: 400
                    detail: The request body is invalid.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: permanent
                    error_code: WAVIX_INVALID_REQUEST
        '401':
          $ref: '#/components/responses/WhatsAppUnauthorizedResponse'
        '402':
          $ref: '#/components/responses/WhatsAppPaymentRequiredResponse'
        '403':
          description: >-
            Returns when WhatsApp is account-suspended, or the sending
            capability is not enabled for the account.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/WhatsAppProblem'
              examples:
                account-suspended:
                  summary: Account is suspended
                  value:
                    type: https://wavix.com/problems/account-suspended
                    title: Account Suspended
                    status: 403
                    detail: Please top up your balance.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: permanent
                    error_code: WAVIX_ACCOUNT_SUSPENDED
                capability-missing:
                  summary: The sending capability is not enabled
                  value:
                    type: https://wavix.com/problems/capability-missing
                    title: Capability Missing
                    status: 403
                    detail: The sending capability is not enabled for this account.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: permanent
                    error_code: WAVIX_CAPABILITY_MISSING
        '404':
          description: >-
            Returns when WhatsApp is not available or not enabled for the
            account, no sender matches `from`, or no approved template matches
            the given name and language.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/WhatsAppProblem'
              examples:
                whatsapp-not-available:
                  summary: WhatsApp is not available for this account
                  value:
                    type: https://wavix.com/problems/whatsapp-not-available
                    title: WhatsApp Not Available
                    status: 404
                    detail: WhatsApp is not available for this account.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: permanent
                    error_code: WAVIX_WHATSAPP_NOT_AVAILABLE
                channel-not-enabled:
                  summary: WhatsApp is not enabled yet for this account
                  value:
                    type: https://wavix.com/problems/channel-not-enabled
                    title: Channel Not Enabled
                    status: 404
                    detail: The WhatsApp channel is not enabled for this account yet.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: permanent
                    error_code: WAVIX_CHANNEL_NOT_ENABLED
                sender-not-found:
                  summary: No sender matches `from`
                  value:
                    type: https://wavix.com/problems/sender-not-found
                    title: Sender Not Found
                    status: 404
                    detail: No sender was found for that number on this account.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: permanent
                    error_code: WAVIX_SENDER_NOT_FOUND
                template-not-found:
                  summary: No approved template matches the given name and language
                  value:
                    type: https://wavix.com/problems/template-not-found
                    title: Template Not Found
                    status: 404
                    detail: No template was found for that name and language.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: permanent
                    error_code: WAVIX_TEMPLATE_NOT_FOUND
        '409':
          description: Returns when the template is not approved for sending.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/WhatsAppProblem'
              examples:
                template-not-approved:
                  value:
                    type: https://wavix.com/problems/template-not-approved
                    title: Template Not Approved
                    status: 409
                    detail: The template is not approved for sending.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: permanent
                    error_code: WAVIX_TEMPLATE_NOT_APPROVED
        '429':
          $ref: '#/components/responses/WhatsAppTooManyRequestsResponse'
        '502':
          description: Returns when the provider rejects the message permanently.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/WhatsAppProblem'
              examples:
                provider-rejected:
                  value:
                    type: https://wavix.com/problems/provider-rejected
                    title: Provider Rejected
                    status: 502
                    detail: The provider rejected the message.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: permanent
                    error_code: WAVIX_PROVIDER_REJECTED
        '503':
          description: >-
            Returns when the provider is temporarily unavailable; the request
            may be retried.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/WhatsAppProblem'
              examples:
                provider-unavailable:
                  value:
                    type: https://wavix.com/problems/provider-unavailable
                    title: Provider Unavailable
                    status: 503
                    detail: The provider is temporarily unavailable.
                    instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                    error_class: retriable
                    error_code: WAVIX_PROVIDER_UNAVAILABLE
      deprecated: false
      security:
        - bearerAuth:
            - whatsapp:write
components:
  schemas:
    WhatsAppMessageSendRequest:
      title: WhatsAppMessageSendRequest
      required:
        - from
        - to
        - template
      type: object
      additionalProperties: false
      properties:
        from:
          type: string
          description: Sender's phone number, 6-20 digits.
          pattern: ^\d{6,20}$
          example: '14155550100'
        to:
          type: string
          description: Recipient's phone number, 6-20 digits.
          pattern: ^\d{6,20}$
          example: '447537151866'
        template:
          type: object
          required:
            - name
            - language
          additionalProperties: false
          properties:
            name:
              type: string
              description: Approved template name.
              example: order_shipped
            language:
              type: string
              description: Template language code.
              example: en_US
            placeholders:
              type: array
              description: >-
                Values substituted into the template body's `{{n}}`
                placeholders, in order.
              items:
                type: string
              example:
                - '123456'
            header:
              type: object
              description: >-
                Header content, required only when the template's `HEADER`
                component needs one.
              additionalProperties: false
              properties:
                type:
                  type: string
                  enum:
                    - TEXT
                    - TEXT_NAMED_PARAMETERS
                    - IMAGE
                    - VIDEO
                    - DOCUMENT
                    - LOCATION
                  example: TEXT
                placeholder:
                  type: string
                  description: Value for a `TEXT` header's `{{1}}` placeholder.
                mediaUrl:
                  type: string
                  description: Media URL for an `IMAGE`/`VIDEO`/`DOCUMENT` header.
                filename:
                  type: string
                  description: Filename for a `DOCUMENT` header.
                latitude:
                  type: number
                  description: Latitude for a `LOCATION` header.
                longitude:
                  type: number
                  description: Longitude for a `LOCATION` header.
                parameterName:
                  type: string
                  description: Placeholder name for a named-parameter `TEXT` header.
                text:
                  type: string
                  description: Value for a named-parameter `TEXT` header.
            buttons:
              type: array
              description: >-
                Dynamic values for the template's `BUTTONS` component, one entry
                per button, matching the template's button order.
              items:
                type: object
                required:
                  - type
                additionalProperties: true
                properties:
                  type:
                    type: string
                    enum:
                      - QUICK_REPLY
                      - URL
                      - COPY_CODE
                      - FLOW
                      - CATALOG
                      - MULTI_PRODUCT
                      - ORDER_DETAILS
                      - VOICE_CALL
                    example: QUICK_REPLY
    WhatsAppMessageSendResponse:
      title: WhatsAppMessageSendResponse
      required:
        - message
      type: object
      additionalProperties: false
      properties:
        message:
          $ref: '#/components/schemas/WhatsAppMessage'
    WhatsAppProblem:
      title: WhatsAppProblem
      description: >-
        RFC 9457 problem document returned by WhatsApp endpoints as
        `application/problem+json`.
      required:
        - type
        - title
        - status
        - detail
        - instance
      type: object
      additionalProperties: false
      properties:
        type:
          type: string
          description: URI identifying the problem type.
          example: https://wavix.com/problems/whatsapp-not-available
        title:
          type: string
          description: Short, human-readable summary of the problem type.
          example: WhatsApp Not Available
        status:
          type: integer
          format: int32
          description: HTTP status code.
          example: 404
        detail:
          type: string
          description: >-
            Human-readable explanation specific to this occurrence of the
            problem.
          example: WhatsApp is not available for this account.
        instance:
          type: string
          description: >-
            URI identifying this specific occurrence of the problem, such as the
            request ID.
          example: 3a525ca2-6909-4c72-9399-905adf7f3a74
        error_class:
          type: string
          description: Machine-readable classification of the error.
          enum:
            - permanent
            - retriable
            - rate_limited
            - invalid_template
          example: permanent
        error_code:
          type: string
          description: Stable machine-readable error code, derived from the problem slug.
          example: WAVIX_WHATSAPP_NOT_AVAILABLE
    WhatsAppMessage:
      title: WhatsAppMessage
      required:
        - uuid
        - from
        - to
        - status
        - created_at
      type: object
      additionalProperties: false
      properties:
        uuid:
          type: string
          format: uuid
          description: Message ID.
          example: 3a525ca2-6909-4c72-9399-905adf7f3a74
        from:
          type: string
          description: Sender's phone number in E.164 digits.
          example: '14155550100'
        to:
          type: string
          description: Recipient's phone number in E.164 digits.
          example: '447537151866'
        status:
          type: string
          description: Message delivery status.
          enum:
            - failed
            - sent
            - delivered
            - undelivered
            - expired
            - rejected
            - unknown
          example: sent
        template:
          type:
            - object
            - 'null'
          description: Template used to send the message.
          additionalProperties: false
          properties:
            name:
              type: string
              description: Template name.
              example: order_shipped
            language:
              type: string
              description: Template language code.
              example: en_US
        created_at:
          type: string
          description: Date and time the message was created, in ISO 8601 format.
          example: '2026-01-15T10:30:00Z'
  responses:
    WhatsAppUnauthorizedResponse:
      description: Returns when the request is not authenticated.
      headers: {}
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/WhatsAppProblem'
          examples:
            authentication-required:
              value:
                type: https://wavix.com/problems/authentication-required
                title: Authentication Required
                status: 401
                detail: Authentication is required to access this resource.
                instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                error_class: permanent
                error_code: WAVIX_AUTHENTICATION_REQUIRED
    WhatsAppPaymentRequiredResponse:
      description: Returns when the account balance is insufficient.
      headers: {}
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/WhatsAppProblem'
          examples:
            payment-required:
              value:
                type: https://wavix.com/problems/payment-required
                title: Payment Required
                status: 402
                detail: Please top up your balance.
                instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                error_class: permanent
                error_code: WAVIX_PAYMENT_REQUIRED
    WhatsAppTooManyRequestsResponse:
      description: Returns when the account has exceeded its request rate limit.
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          schema:
            type: integer
            example: 30
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/WhatsAppProblem'
          examples:
            rate-limited:
              value:
                type: https://wavix.com/problems/rate-limited
                title: Rate Limited
                status: 429
                detail: Too many requests. Try again later.
                instance: 3a525ca2-6909-4c72-9399-905adf7f3a74
                error_class: rate_limited
                error_code: WAVIX_RATE_LIMITED
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Wavix API key. Pass as `Authorization: Bearer <api_key>`. Keys support
        per-resource scopes (none / read / write). See [Restricted keys and
        scopes](https://docs.wavix.com/api-reference/authentication#restricted-keys-and-scopes).

````