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

# Send interactive message (buttons or link)

> Send a WhatsApp message with reply buttons (type=button, 1 to 3 buttons) or one call-to-action link button (type=cta_url), within the 24-hour session window, via the authorized channel. When the customer taps a reply button, the reply arrives like any message (button_id is the id you gave). Texts longer than the WhatsApp limits are refused with a clear error, not cut.

Authentication: API key via X-API-Key header (or Authorization: Bearer).
Permissions: User API key
Rate limit: api_messaging — 20 requests/min per API user.



## OpenAPI

````yaml /api-reference/workspace.openapi.json post /api/workspace/v1/whatsapp/message/interactive
openapi: 3.1.0
info:
  title: Workspace API
  version: 1.0.0
  description: >-
    Manage contacts, labels, custom fields, WhatsApp messaging, and automations
    for your workspace.


    Generate your API key in the Developer Portal (profile menu → Developer) and
    send it in the `X-API-Key` header, or as `Authorization: Bearer <key>`.
    Never put the key in the URL.


    Every endpoint accepts POST with a JSON body, and also accepts GET with the
    same parameters as query-string values. All responses use the envelope `{
    success, data?, message?, error? }`.
servers:
  - url: https://YOUR_DOMAIN
    description: Your deployment, for example https://app.example.com
security: []
tags:
  - name: Channels
    description: Workspace API — Channels
  - name: Contacts
    description: Workspace API — Contacts
  - name: Custom Fields
    description: Workspace API — Custom Fields
  - name: Labels
    description: Workspace API — Labels
  - name: WhatsApp
    description: Workspace API — WhatsApp
  - name: Automations
    description: Workspace API — Automations
paths:
  /api/workspace/v1/whatsapp/message/interactive:
    post:
      tags:
        - WhatsApp
      summary: Send interactive message (buttons or link)
      description: >-
        Send a WhatsApp message with reply buttons (type=button, 1 to 3 buttons)
        or one call-to-action link button (type=cta_url), within the 24-hour
        session window, via the authorized channel. When the customer taps a
        reply button, the reply arrives like any message (button_id is the id
        you gave). Texts longer than the WhatsApp limits are refused with a
        clear error, not cut.


        Authentication: API key via X-API-Key header (or Authorization: Bearer).

        Permissions: User API key

        Rate limit: api_messaging — 20 requests/min per API user.
      parameters:
        - name: channelId
          in: query
          required: false
          description: Channel id. Auto-selects when omitted.
          schema:
            type: string
            example: ch_123
        - name: to
          in: query
          required: false
          description: Recipient phone or WhatsApp BSUID.
          schema:
            type: string
            example: '919876543210'
        - name: type
          in: query
          required: false
          description: button (reply buttons) or cta_url (one link button).
          schema:
            type: string
            example: YOUR_TYPE
        - name: body
          in: query
          required: false
          description: Message text, up to 1024 characters.
          schema:
            type: string
            example: YOUR_BODY
        - name: buttons
          in: query
          required: false
          description: >-
            type=button only. 1 to 3 items { id, title }: title up to 20
            characters, id (optional, up to 256 characters) comes back as
            button_id when tapped. Titles and ids must be different. JSON string
            for GET.
          schema:
            type: array
            items: {}
            example: []
        - name: buttonLabel
          in: query
          required: false
          description: type=cta_url only. Text on the link button, up to 20 characters.
          schema:
            type: string
            example: YOUR_BUTTONLABEL
        - name: buttonUrl
          in: query
          required: false
          description: type=cta_url only. The link to open (http or https).
          schema:
            type: string
            example: YOUR_BUTTONURL
        - name: header
          in: query
          required: false
          description: Header text, up to 60 characters. Not together with headerUrl.
          schema:
            type: string
            example: YOUR_HEADER
        - name: headerType
          in: query
          required: false
          description: image | video | document. Required with headerUrl.
          schema:
            type: string
            example: YOUR_HEADERTYPE
        - name: headerUrl
          in: query
          required: false
          description: Public URL of the header file.
          schema:
            type: string
            example: YOUR_HEADERURL
        - name: headerFilename
          in: query
          required: false
          description: File name shown for a document header.
          schema:
            type: string
            example: YOUR_HEADERFILENAME
        - name: footer
          in: query
          required: false
          description: Footer text, up to 60 characters.
          schema:
            type: string
            example: YOUR_FOOTER
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - to
                - type
                - body
              properties:
                channelId:
                  type: string
                  description: Channel id. Auto-selects when omitted.
                  example: ch_123
                to:
                  type: string
                  description: Recipient phone or WhatsApp BSUID.
                  example: '919876543210'
                type:
                  type: string
                  description: button (reply buttons) or cta_url (one link button).
                  example: YOUR_TYPE
                body:
                  type: string
                  description: Message text, up to 1024 characters.
                  example: YOUR_BODY
                buttons:
                  type: array
                  items: {}
                  description: >-
                    type=button only. 1 to 3 items { id, title }: title up to 20
                    characters, id (optional, up to 256 characters) comes back
                    as button_id when tapped. Titles and ids must be different.
                    JSON string for GET.
                  example: []
                buttonLabel:
                  type: string
                  description: >-
                    type=cta_url only. Text on the link button, up to 20
                    characters.
                  example: YOUR_BUTTONLABEL
                buttonUrl:
                  type: string
                  description: type=cta_url only. The link to open (http or https).
                  example: YOUR_BUTTONURL
                header:
                  type: string
                  description: >-
                    Header text, up to 60 characters. Not together with
                    headerUrl.
                  example: YOUR_HEADER
                headerType:
                  type: string
                  description: image | video | document. Required with headerUrl.
                  example: YOUR_HEADERTYPE
                headerUrl:
                  type: string
                  description: Public URL of the header file.
                  example: YOUR_HEADERURL
                headerFilename:
                  type: string
                  description: File name shown for a document header.
                  example: YOUR_HEADERFILENAME
                footer:
                  type: string
                  description: Footer text, up to 60 characters.
                  example: YOUR_FOOTER
            example:
              channelId: ch_123
              to: '919876543210'
              type: button
              body: Your order is ready. Collect it today?
              buttons:
                - id: collect_yes
                  title: 'Yes'
                - id: collect_later
                  title: Later
              footer: Reply within 24 hours
      responses:
        '200':
          description: 'Success. Envelope: { success:true, data, message? }.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    example: true
                  data: {}
                  message:
                    type: string
                  pagination:
                    type: object
                  total:
                    type: number
              example:
                success: true
                data:
                  messaging_product: whatsapp
                  messages:
                    - id: wamid.xxx
                message: Message sent successfully
        '400':
          description: >-
            Missing/invalid parameters. Body has success:false plus error and
            message.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
        '401':
          description: >-
            Missing or invalid API key (or session expired for session
            endpoints).
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
        '403':
          description: >-
            Authenticated but not authorized — wrong permissions or cross-tenant
            resource.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
        '429':
          description: >-
            Rate limited. Retry after the Retry-After seconds; see RateLimit-*
            headers.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
        '500':
          description: >-
            Unexpected server error. Body has success:false plus error and
            message.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
      security:
        - apiKeyHeader: []
        - bearerAuth: []
components:
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: Preferred. API key value directly.
    bearerAuth:
      type: http
      scheme: bearer
      description: Alternative. API key as the bearer token.

````

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