Developer API

Queue messages through a connected WhatsApp account, including groups and newsletters.

Connected WhatsApp API

Send with WhatsApp

The Campaign Messages API queues WhatsApp messages from your own scripts or integrations. The API key owner needs Inbox Write access. With Personal WhatsApp Own Write, the sender phone must be registered to that person. With Personal WhatsApp All Write, any registered sender phone in the workspace can be used.

Note: The sending WhatsApp account must be connected and available for queued API messages to be delivered. For newsletters, the connected WhatsApp account must also be an owner or admin of the newsletter.

Endpoint and request body

Send messages with POST /api/v1/messages/send. The request requires to, sender_phone, and a message object. The to value can be a phone number, group JID, or newsletter JID.

Complete text message request
curl -X POST "https://app.querygen.ai/api/v1/messages/send" \
  -H "Authorization: Bearer qg_xxxxxxxxxxxxx" \
  -H "X-Organization-Id: <organization-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "919876543210",
    "sender_phone": "919820160046",
    "message": {
      "type": "text",
      "text": "Hello, your order is ready!"
    }
  }'

Media message

For images, videos, audio files, and documents, set message.type to the media type and provide a publicly accessible media_url.

Complete media message request
curl -X POST "https://app.querygen.ai/api/v1/messages/send" \
  -H "Authorization: Bearer qg_xxxxxxxxxxxxx" \
  -H "X-Organization-Id: <organization-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "919876543210",
    "sender_phone": "919820160046",
    "message": {
      "type": "image",
      "media_url": "https://example.com/photo.jpg",
      "caption": "Here is your receipt",
      "filename": "receipt.jpg"
    }
  }'

Poll message

Polls require 2 to 12 options. Set poll_allows_multiple to true to allow more than one selection.

Complete poll message request
curl -X POST "https://app.querygen.ai/api/v1/messages/send" \
  -H "Authorization: Bearer qg_xxxxxxxxxxxxx" \
  -H "X-Organization-Id: <organization-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "919876543210",
    "sender_phone": "919820160046",
    "message": {
      "type": "poll",
      "poll_question": "How was your experience?",
      "poll_options": ["Excellent", "Good", "Average", "Poor"],
      "poll_allows_multiple": false
    }
  }'

Send to a group

Complete group message request
curl -X POST "https://app.querygen.ai/api/v1/messages/send" \
  -H "Authorization: Bearer qg_xxxxxxxxxxxxx" \
  -H "X-Organization-Id: <organization-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "120363019820160046@g.us",
    "sender_phone": "919820160046",
    "message": {
      "type": "text",
      "text": "Hello group!"
    }
  }'

Send to a newsletter

Complete newsletter message request
curl -X POST "https://app.querygen.ai/api/v1/messages/send" \
  -H "Authorization: Bearer qg_xxxxxxxxxxxxx" \
  -H "X-Organization-Id: <organization-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "120363999999999999@newsletter",
    "sender_phone": "919820160046",
    "message": {
      "type": "text",
      "text": "Today is the menu launch."
    }
  }'

Send response

Success response
{
  "success": true,
  "data": {
    "message_id": "msg_abc123",
    "campaign_id": "api_campaign_1234567890_user123",
    "status": "queued",
    "queued_at": "2026-02-28T10:30:00Z"
  }
}

Send errors

StatusMeaning
400Validation error, missing fields, invalid fields, or sender phone unavailable to the key owner
401Missing, invalid, or revoked API key
403The key owner lacks the required feature permission or sender access
429Rate limit exceeded