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

# Send QR message

> Learn how to send WhatsApp messages through your QR-connected number using Vambe API.

## 🚀 What you'll build

You'll send messages through your QR-connected WhatsApp number using the Vambe API. Choose between AI-generated messages or manual control.

<Tip>
  QR messaging works like WhatsApp Web but with AI automation. Perfect for
  personal numbers and quick setup.
</Tip>

***

## Prerequisites

* ✅ [Connected WhatsApp QR](/docs/connect-whatsapp-qr) to your Vambe account
* ✅ **Phone connected to internet** and WhatsApp QR active
* ✅ Valid Vambe API key from [developers page](https://app.vambeai.com/developers)

***

## Two Ways to Send Messages

### Option 1: AI-Generated Messages (Recommended)

Let Vambe AI create intelligent messages for you:

<Steps>
  <Step title="Get QR Channel ID">
    ```bash theme={null}
    curl -X GET \
      -H "x-api-key: YOUR_API_KEY" \
      https://api.vambe.me/api/public/channels/web-whatsapp
    ```

    Save the `id` field as your phoneId for the ticket endpoint.
  </Step>

  <Step title="Get Pipeline Stage ID">
    ```bash theme={null}
    curl -X GET \
      -H "x-api-key: YOUR_API_KEY" \
      https://api.vambe.me/api/public/pipeline
    ```

    Save the stage ID where you want to start the conversation.
  </Step>

  <Step title="Create AI-Generated Message">
    ```bash theme={null}
    curl -X POST \
      -H "x-api-key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "to_phone_number": "+1234567890",
        "contact_name": "John Doe",
        "stage_id": "stage_initial_001",
        "contact_metadata": {
          "source": "api",
          "priority": "normal"
        },
        "ticket_metadata": {
          "topic": "product_inquiry"
        }
      }' \
      https://api.vambe.me/api/public/ticket/open/web-whatsapp/{phoneId}
    ```

    <Check>
      AI automatically creates appropriate message content and initiates the conversation based on your pipeline configuration.
    </Check>
  </Step>
</Steps>

### Option 2: Manual Message Control

For when you want full control over message content:

<Steps>
  <Step title="Get QR Channel ID">
    ```bash theme={null}
    curl -X GET \
      -H "x-api-key: YOUR_API_KEY" \
      https://api.vambe.me/api/public/channels/web-whatsapp
    ```

    Save the `id` field as your phoneId.
  </Step>

  <Step title="Get Pipeline Stage ID">
    ```bash theme={null}
    curl -X GET \
      -H "x-api-key: YOUR_API_KEY" \
      https://api.vambe.me/api/public/pipeline
    ```

    Save the stage ID where you want to send the message.
  </Step>

  <Step title="Send Your Custom Message">
    ```bash theme={null}
    curl -X POST \
      -H "x-api-key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "message": "Hello! This is a custom message from Vambe.",
        "stage": "stage_initial_001",
        "toPhoneNumber": "+1234567890",
        "contactName": "John Doe",
        "metaData": {}
      }' \
      https://api.vambe.me/api/public/web-whatsapp-message/send/1001/message
    ```
  </Step>
</Steps>

***

## What Happens Behind the Scenes

When you send a message through QR API, Vambe automatically:

<CardGroup cols={2}>
  <Card title="AI Processing" icon="brain">
    * **Extracts contact data** using GPT
    * **Creates or updates** contact records
    * **Generates intelligent content** (ticket mode)
    * **Validates data format** automatically
  </Card>

  <Card title="Conversation Management" icon="messages">
    * **Links contact to pipeline** stage
    * **Preserves conversation** history
    * **Tracks customer journey** progression
    * **Enables AI responses** for incoming messages
  </Card>
</CardGroup>

***

## API Comparison

| Feature              | AI-Generated (Ticket) | Manual Message    |
| -------------------- | --------------------- | ----------------- |
| **Setup**            | 3 steps               | 3 steps           |
| **Message Creation** | AI creates content    | You write content |
| **Required Fields**  | Minimal               | All manual        |
| **Best For**         | Automation            | Full control      |

***

## Error Handling

<AccordionGroup>
  <Accordion title="Phone Offline (503)" icon="phone">
    **If your phone is disconnected:**

    * Check phone internet connection
    * Ensure WhatsApp is running
    * Reconnect QR in Vambe dashboard
  </Accordion>

  <Accordion title="Invalid Stage (400)" icon="ban">
    **If stage ID doesn't exist:**

    * Get stage ID from pipeline API
    * Verify pipeline is active
    * Check stage belongs to your account
  </Accordion>

  <Accordion title="Rate Limit (429)" icon="clock">
    **If too many messages:**

    * QR limit: \~250 messages/day
    * Add delays between messages
    * Consider Business API for higher volume
  </Accordion>
</AccordionGroup>

***

## Next Steps

<Check>
  You're now ready to send messages through your WhatsApp QR connection.
</Check>

<CardGroup cols={2}>
  <Card title="Configure AI Assistant" icon="robot" href="/docs/create-pipeline">
    Train your AI to handle customer responses automatically
  </Card>

  <Card title="Monitor Analytics" icon="chart-line" href="/docs/analytics">
    Track message performance and customer engagement
  </Card>

  <Card title="Create Pipelines" icon="sitemap" href="/docs/create-pipeline">
    Build conversation flows for automated customer journeys
  </Card>

  <Card title="Upgrade to Business API" icon="arrow-up" href="/docs/connect-whatsapp-api">
    Scale to higher limits with official Meta integration
  </Card>
</CardGroup>

<Info>
  **Pro Tip:** Start with AI-generated messages for easier setup, then use
  manual control when you need specific content formatting.
</Info>
