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

# Send a WhatsApp

> Send a one-way WhatsApp message, or set a `waitTime` to listen for a reply and capture it in the response. Send from the Poku WhatsApp account using free-form text, or use your own WhatsApp number with a Meta-approved template.



## OpenAPI

````yaml POST /messages/whatsapp
openapi: 3.1.0
info:
  title: Poku API
  version: 1.0.0
  description: OpenAPI document for the authenticated Poku API routes.
servers:
  - url: https://api.pokulabs.com
security:
  - bearerAuth: []
tags:
  - name: calls
  - name: messages
  - name: forms
  - name: interactions
  - name: numbers
  - name: webhooks
paths:
  /messages/whatsapp:
    post:
      tags:
        - messages
      summary: Send a WhatsApp message
      description: >-
        Send a one-way WhatsApp message, or set a `waitTime` to listen for a
        reply and capture it in the response. Send from the Poku WhatsApp
        account using free-form text, or use your own WhatsApp number with a
        Meta-approved template.
      operationId: sendWhatsappMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/WhatsAppMessagePoku'
                - $ref: '#/components/schemas/WhatsAppMessageOwn'
      responses:
        '200':
          description: Message sent successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsMessageResponse'
              examples:
                noWaitTime:
                  summary: No waitTime set
                  value:
                    interactionId: 092f9eb4-3694-4718-9084-5c786afa87ec
                replyReceived:
                  summary: Reply received within waitTime
                  value:
                    response: 'Human response: Hello there!'
                noReply:
                  summary: No reply received
                  value:
                    response: Human did not respond, please continue where you left off.
components:
  schemas:
    WhatsAppMessagePoku:
      title: Send from Poku WhatsApp
      type: object
      required:
        - message
        - to
      properties:
        message:
          type: string
          description: >-
            The content of your message.


            When `waitTime` is not set:

            *"Notification from AI agent: {{message}}. No response required."*


            When `waitTime` is set:

            *"Your AI agent is requesting your input. Message from agent:
            {{message}}. Please review and reply with your guidance. If no
            response is received within {{waitTime}} seconds, the request will
            be automatically closed."*
        to:
          type: string
          description: The number you want to message, in E.164 format.
        waitTime:
          type: number
          minimum: 1
          maximum: 600
          description: >-
            When not supplied, no reply is captured.


            When supplied, this is the number of seconds the API request is held
            open waiting for a reply. Poku returns the reply in the HTTP
            response.
          example: 60
        followUpTime:
          type: number
          minimum: 1
          maximum: 60000
          description: >-
            Duration in seconds to keep listening for a reply after the
            `waitTime` window closes.


            When a reply arrives within this window, Poku sends it to any
            webhooks you've configured.
          example: 6000
      additionalProperties: false
    WhatsAppMessageOwn:
      title: Send from your own WhatsApp
      type: object
      required:
        - template
        - to
        - from
      properties:
        template:
          type: object
          description: >-
            A Meta-approved WhatsApp template. Required when sending from your
            own number. Configure your Twilio or MessageBird credentials on the
            [Integrations page](https://dashboard.pokulabs.com/integrations).
          required:
            - id
            - variables
          properties:
            id:
              type: string
              description: The template UUID from your Meta Business account.
            variables:
              type: object
              description: Key-value pairs mapping template variable names to their values.
              additionalProperties:
                type: string
          example:
            id: 29536325-17a1-49b3-b6fe-9b3d12b839c6
            variables:
              linkID: '{{replyToken}}'
        to:
          type: string
          description: The number you want to message, in E.164 format.
        from:
          type: string
          description: >-
            Bring your own WhatsApp number from Twilio or Messagebird. Configure
            your credentials on the [Integrations
            page](https://dashboard.pokulabs.com/integrations) and pass the
            number here in E.164 format.
        waitTime:
          type: number
          minimum: 1
          maximum: 600
          description: >-
            When undefined or not supplied, no reply is captured.


            When supplied, this is the number of seconds the API request is held
            open waiting for a reply. Poku returns the reply in the HTTP
            response.
          example: 60
        followUpTime:
          type: number
          minimum: 1
          maximum: 60000
          description: >-
            Duration in seconds to keep listening for a reply after the
            `waitTime` window closes.


            When a reply arrives within this window, Poku sends it to any
            webhooks you've configured.
          example: 6000
      additionalProperties: false
    SmsMessageResponse:
      type: object
      properties:
        interactionId:
          type: string
          description: >-
            Returned when no waitTime is set. Unique identifier for this
            interaction.
        response:
          type: string
          description: >-
            Returned when waitTime is set. Contains the recipient reply, or a
            timeout message if no reply was received.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authentication header containing your Poku API key. Find it in the [Poku
        dashboard](https://dashboard.pokulabs.com/). The format is "Bearer
        YOUR_API_KEY"

````