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

# Send Interactive Buttons

> Send an interactive button message with up to 3 quick reply buttons.

## Basic Usage

```bash theme={null}
curl -X POST "https://api.flowiq.live/send-whatsapp" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+27123456789",
    "message_type": "interactive",
    "interactive": {
      "type": "button",
      "header": "Order Confirmation",
      "body": "Would you like to confirm your order #12345?",
      "footer": "Reply within 24 hours",
      "buttons": [
        { "id": "confirm", "title": "Confirm" },
        { "id": "cancel", "title": "Cancel" },
        { "id": "modify", "title": "Modify Order" }
      ]
    }
  }'
```

### With Image Header

```bash theme={null}
curl -X POST "https://api.flowiq.live/send-whatsapp" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+27123456789",
    "message_type": "interactive",
    "interactive": {
      "type": "button",
      "body": "Check out our new product!",
      "header_media": { "type": "image", "url": "https://example.com/product.jpg" },
      "buttons": [
        { "id": "buy", "title": "Buy Now" },
        { "id": "info", "title": "More Info" }
      ]
    }
  }'
```

***

## Request Body

| Field                         | Type   | Required | Description                                                         |
| ----------------------------- | ------ | -------- | ------------------------------------------------------------------- |
| `phone_number`                | string | Yes      | Recipient phone number with country code                            |
| `message_type`                | string | Yes      | Must be `"interactive"`                                             |
| `interactive.type`            | string | Yes      | Must be `"button"`                                                  |
| `interactive.body`            | string | Yes      | Main message text (max 1024 chars)                                  |
| `interactive.header`          | string | No       | Header text (max 60 chars)                                          |
| `interactive.footer`          | string | No       | Footer text (max 60 chars)                                          |
| `interactive.buttons`         | array  | Yes      | Array of button objects — max 3                                     |
| `interactive.buttons[].id`    | string | No       | Unique button ID returned on tap (auto-generated if omitted)        |
| `interactive.buttons[].title` | string | Yes      | Button label (max 20 chars)                                         |
| `interactive.header_media`    | object | No       | Media header — `type`, `url`, and optional `filename` for documents |
| `context_message_id`          | string | No       | WhatsApp message ID to reply to                                     |

<Warning>
  Button titles are limited to 20 characters. Maximum 3 buttons per message.
</Warning>

```json theme={null}
{
  "phone_number": "+27123456789",
  "message_type": "interactive",
  "interactive": {
    "type": "button",
    "body": "Would you like to confirm your order?",
    "buttons": [
      { "id": "confirm", "title": "Confirm" },
      { "id": "cancel", "title": "Cancel" }
    ]
  }
}
```

***

## Response

### Success (200)

```json theme={null}
{
  "success": true,
  "message": "Message sent successfully",
  "data": {
    "message_id": "wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI...",
    "recipient": "27123456789",
    "message_type": "interactive"
  }
}
```

### Error: Missing Required Field (400)

```json theme={null}
{
  "error": "Missing required field",
  "message": "interactive.body and interactive.buttons are required for button messages"
}
```

***

## Integration Example

```javascript theme={null}
async function sendInteractiveButtons(apiKey, phoneNumber, interactive) {
  const response = await fetch(
    `https://api.flowiq.live/send-whatsapp`,
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${apiKey}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ phone_number: phoneNumber, message_type: "interactive", interactive }),
    }
  );
  const data = await response.json();
  if (!response.ok) throw new Error(data.message);
  return data;
}
```


## OpenAPI

````yaml flowiq-api-reference/openapi-send-interactive-buttons.json POST /send-whatsapp
openapi: 3.1.0
info:
  title: FlowIQ - Send Interactive Buttons
  version: 1.0.0
servers:
  - url: https://api.flowiq.live
    description: FlowIQ Production API
security:
  - BearerAuth: []
paths:
  /send-whatsapp:
    post:
      tags:
        - Endpoints
      summary: Send Interactive Buttons
      description: Send an interactive button message with up to 3 quick reply buttons.
      operationId: sendInteractiveButtons
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                phone_number:
                  type: string
                  description: Recipient phone number with country code
                  example: '+27123456789'
                message_type:
                  type: string
                  enum:
                    - interactive
                  description: Must be "interactive"
                  example: interactive
                interactive:
                  type: object
                  description: Interactive button message configuration
                  properties:
                    type:
                      type: string
                      enum:
                        - button
                      description: Must be "button"
                    body:
                      type: string
                      description: Main message body text (max 1024 chars)
                    header:
                      type: string
                      description: Header text (max 60 chars)
                    footer:
                      type: string
                      description: Footer text (max 60 chars)
                    buttons:
                      type: array
                      description: Array of buttons (max 3)
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            description: Button identifier
                          title:
                            type: string
                            description: Button text (max 20 chars)
                    header_media:
                      type: object
                      description: Media header for button messages
                      properties:
                        type:
                          type: string
                          enum:
                            - image
                            - video
                            - document
                        url:
                          type: string
                        filename:
                          type: string
                  required:
                    - type
                    - body
                    - buttons
                context_message_id:
                  type: string
                  description: WhatsApp message ID to reply to
                  example: wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI...
              required:
                - phone_number
                - message_type
                - interactive
      responses:
        '200':
          description: Message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Message sent successfully
                  data:
                    type: object
                    properties:
                      message_id:
                        type: string
                        example: wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI...
                      recipient:
                        type: string
                        example: '27123456789'
                      message_type:
                        type: string
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Bearer token for authentication. Format: `Bearer YOUR_BEARER_TOKEN`'
      bearerFormat: JWT

````