WaSetu
REST API v1.0 • Multi-Device Baileys Engine

Developer API Reference & Webhooks

Integrate programmatic WhatsApp messaging, automated OTP dispatch, session management, and bi-directional conversational webhooks into your applications with standard JSON payloads.

Latency < 350ms Fast Dispatch
Authentication Bearer Token / API Key
Data Format JSON UTF-8 Payload
Event Streaming Real-Time Webhooks
1

Overview & Base URL

API architecture, environments, and REST conventions

The OpenWA REST API enables programmatic interaction with WhatsApp. You can provision multi-device slots, generate dynamic QR codes, dispatch high-throughput transactional alerts, send rich media, and capture inbound replies via real-time webhooks.

// Production API Base Endpoint
https://wasetu.hostgeeks.in/api/v1
2

Authentication & Headers

Securing your API requests with Bearer Tokens

Every REST API request must authenticate by providing your Secret API Key in the Authorization header as a Bearer token, or alternatively via X-API-Key.

Authorization: Bearer wa_live_9a7e8b61c4d290fa
Content-Type: application/json
Accept: application/json
3

Anti-Ban Pacing & Rate Limits

Humanized typing delay engine and quota enforcement

To protect your connected numbers against WhatsApp spam filters, our socket gateway enforces automated human typing jitter (800ms – 2400ms delay between dispatches).

Burst Rate Limit Up to 30 requests/second per API token. Extra requests are held in priority FIFO queue.
Instance Pacing Outbound messages per instance are throttled with randomized jitter to simulate organic human typing.
GET /api/v1/instances

List All WhatsApp Instances

Slot Inventory

Returns an array of all WhatsApp instance slots provisioned under your account, along with their live socket connectivity state and paired phone numbers.

7-LANGUAGE CODE EXAMPLES Request
curl -X GET "https://wasetu.hostgeeks.in/api/v1/instances" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Sample Success Response (200 OK)

{
  "success": true,
  "data": [
    {
      "instance_key": "inst_7fa289e",
      "name": "Support Line 1",
      "phone": "919876543210",
      "status": "connected",
      "created_at": "2026-08-30T10:15:00Z"
    }
  ]
}
POST /api/v1/instances

Create Instance Slot

Slot Allocation

Provisions a new WhatsApp multi-device slot in your workspace. Once created, you can immediately initiate QR pairing to link any mobile device.

Request Body Parameters

Field Type Status Description
name string Required Friendly label for the instance slot (e.g. "Sales WhatsApp 01").
7-LANGUAGE CODE EXAMPLES JSON Payload
curl -X POST "https://wasetu.hostgeeks.in/api/v1/instances" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Care Desk"
  }'

Sample Success Response (201 Created)

{
  "success": true,
  "message": "WhatsApp instance slot created successfully.",
  "data": {
    "instance_key": "inst_92bc401",
    "name": "Customer Care Desk",
    "status": "disconnected"
  }
}
POST /api/v1/instances/{instanceKey}/connect

Connect & Generate QR Code

Session Initializer

Spawns a multi-device WhatsApp Baileys socket session and generates a real-time QR code. Returns the QR code in Base64 Data URI format ready to display in your user interface.

7-LANGUAGE CODE EXAMPLES Request
curl -X POST "https://wasetu.hostgeeks.in/api/v1/instances/inst_7fa289e/connect" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Sample Success Response (200 OK)

{
  "success": true,
  "message": "QR Code generated. Scan with WhatsApp to pair.",
  "data": {
    "instance_key": "inst_7fa289e",
    "status": "pairing",
    "qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA...",
    "expires_in": 45
  }
}
GET /api/v1/instances/{instanceKey}/status

Check Instance Connection Status

Socket Health

Polls the live socket state of an instance to verify whether WhatsApp web multi-device is currently active, pairing, or disconnected.

7-LANGUAGE CODE EXAMPLES Request
curl -X GET "https://wasetu.hostgeeks.in/api/v1/instances/inst_7fa289e/status" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Sample Success Response (200 OK)

{
  "success": true,
  "data": {
    "instance_key": "inst_7fa289e",
    "name": "Customer Care Desk",
    "phone": "919876543210",
    "status": "connected",
    "platform": "Baileys MD v6.5",
    "updated_at": "2026-08-30T17:45:00Z"
  }
}
GET /api/v1/instances/{instanceKey}/qr

Fetch Live QR Code

QR Polling

Retrieves the current active Base64 QR code image payload for a pairing session if it has not yet completed authentication.

7-LANGUAGE CODE EXAMPLES Request
curl -X GET "https://wasetu.hostgeeks.in/api/v1/instances/inst_7fa289e/qr" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Sample Success Response (200 OK)

{
  "success": true,
  "data": {
    "instance_key": "inst_7fa289e",
    "status": "pairing",
    "qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "expires_in": 30
  }
}
POST /api/v1/instances/{instanceKey}/logout

Logout & Unlink WhatsApp Device

Session Teardown

Terminates the WhatsApp multi-device session, closes socket handles, and clears persisted device keys from storage.

7-LANGUAGE CODE EXAMPLES Request
curl -X POST "https://wasetu.hostgeeks.in/api/v1/instances/inst_7fa289e/logout" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Sample Success Response (200 OK)

{
  "success": true,
  "message": "WhatsApp instance unlinked and logged out successfully.",
  "data": {
    "instance_key": "inst_7fa289e",
    "status": "disconnected"
  }
}
POST /api/v1/messages/send

Send WhatsApp Text Message

Outbound Transactional

Dispatches a plain or markdown-formatted WhatsApp text message to any international mobile number.

Request Body Parameters

Field Type Status Description
instance_key string Required Unique identifier of your connected WhatsApp instance slot.
phone string Required Recipient phone number with country code (e.g. 919876543210). No leading + or dashes.
message string Required Text message body (supports *bold*, _italic_, ~strike~, and emojis). Max 4096 chars.
7-LANGUAGE CODE EXAMPLES JSON Payload
curl -X POST "https://wasetu.hostgeeks.in/api/v1/messages/send" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_key": "inst_7fa289e",
    "phone": "919876543210",
    "message": "Hello! Your appointment is confirmed for *3:00 PM* today. - OpenWA"
  }'

Sample Success Response (200 OK)

{
  "success": true,
  "message": "WhatsApp message dispatched successfully.",
  "data": {
    "message_id": 1042,
    "wa_message_id": "3EB0F429A71",
    "phone": "919876543210",
    "status": "sent"
  }
}
POST /api/v1/messages/send-media

Send WhatsApp Document & Media

PDF / Image / Video / Audio

Dispatches a PDF invoice, document file, JPEG/PNG image, MP4 video, or audio file via a public HTTPS URL with an optional caption.

Request Body Parameters

Field Type Status Description
instance_key string Required Target instance key.
phone string Required Recipient phone number with country code.
media_url url Required Publicly accessible direct HTTPS URL to the media file.
caption string Optional Text caption displayed under the media attachment.
media_type string Optional Explicit media type: "document", "image", "video", "audio". Auto-detected if omitted.
7-LANGUAGE CODE EXAMPLES JSON Payload
curl -X POST "https://wasetu.hostgeeks.in/api/v1/messages/send-media" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_key": "inst_7fa289e",
    "phone": "919876543210",
    "media_url": "https://yourdomain.com/invoices/INV-1092.pdf",
    "caption": "Here is your monthly invoice receipt. Thank you!"
  }'

Sample Success Response (200 OK)

{
  "success": true,
  "message": "Media message dispatched successfully.",
  "data": {
    "message_id": 1043,
    "wa_message_id": "3EB0D498C29",
    "phone": "919876543210",
    "media_type": "document",
    "status": "sent"
  }
}
POST /api/v1/messages/send-location

Send GPS Location Pin

Map Coordinates

Dispatches a native WhatsApp interactive Google Maps / OpenStreetMap GPS coordinate pin with place name and street address.

Request Body Parameters

Field Type Status Description
instance_key string Required Your WhatsApp instance key.
phone string Required Recipient phone number with country code.
latitude float Required Latitude coordinate (e.g. 28.613939).
longitude float Required Longitude coordinate (e.g. 77.209021).
name string Optional Venue, office, or store location name.
address string Optional Street address details.
7-LANGUAGE CODE EXAMPLES JSON Payload
curl -X POST "https://wasetu.hostgeeks.in/api/v1/messages/send-location" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_key": "inst_7fa289e",
    "phone": "919876543210",
    "latitude": 28.613939,
    "longitude": 77.209021,
    "name": "Wasetu Corporate HQ",
    "address": "Connaught Place, New Delhi 110001, India"
}'
POST /api/v1/numbers/check

WhatsApp Number Registration Checker

onWhatsApp Verification

Checks whether one or multiple phone numbers are registered and active on WhatsApp before broadcasting campaigns.

7-LANGUAGE CODE EXAMPLES JSON Payload
curl -X POST "https://wasetu.hostgeeks.in/api/v1/numbers/check" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_key": "inst_7fa289e",
    "numbers": [
        "919876543210",
        "919999888777",
        "918888777666"
    ]
}'

{
  "success": true,
  "total_checked": 3,
  "registered_count": 2,
  "data": [
    { "phone": "919876543210", "exists": true, "jid": "919876543210@s.whatsapp.net" },
    { "phone": "919999888777", "exists": true, "jid": "919999888777@s.whatsapp.net" },
    { "phone": "918888777666", "exists": false, "jid": "918888777666@s.whatsapp.net" }
  ]
}

POST /api/v1/messages/send-buttons

Send Interactive Buttons

Quick Reply Actions

Dispatches 1-click interactive quick response buttons for instant customer feedback, confirmations, or routing.

7-LANGUAGE CODE EXAMPLES JSON Payload
curl -X POST "https://wasetu.hostgeeks.in/api/v1/messages/send-buttons" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_key": "inst_7fa289e",
    "phone": "919876543210",
    "message": "Hello Amit! Would you like to confirm your appointment for tomorrow?",
    "footer": "Powered by Wasetu Automated Care",
    "buttons": [
        {
            "id": "btn_confirm",
            "text": "\u2705 Confirm Booking"
        },
        {
            "id": "btn_reschedule",
            "text": "\ud83d\udcc5 Reschedule"
        },
        {
            "id": "btn_cancel",
            "text": "\u274c Cancel"
        }
    ]
}'

Sample Success Response (200 OK)

{
  "success": true,
  "message_id": 105,
  "wa_message_id": "wamid.HBgMOTE5ODc2NTQzMjEw...",
  "phone": "919876543210",
  "status": "sent"
}
POST /api/v1/messages/send-lists

Send Interactive Lists & Catalogs

Multi-Section Menus

Dispatches multi-section interactive product menus, department lists, or service catalogs.

7-LANGUAGE CODE EXAMPLES JSON Payload
curl -X POST "https://wasetu.hostgeeks.in/api/v1/messages/send-lists" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_key": "inst_7fa289e",
    "phone": "919876543210",
    "title": "Wasetu Cloud Services",
    "message": "Please choose a department below to connect with an executive:",
    "button_text": "View Departments",
    "footer": "Available 24/7 Support",
    "sections": [
        {
            "title": "Customer Support",
            "rows": [
                {
                    "id": "sec_billing",
                    "title": "Billing & Invoices",
                    "description": "Payment issues and upgrades"
                },
                {
                    "id": "sec_tech",
                    "title": "Technical Support",
                    "description": "API integration help"
                }
            ]
        },
        {
            "title": "Sales & Growth",
            "rows": [
                {
                    "id": "sec_enterprise",
                    "title": "Enterprise Plans",
                    "description": "High volume custom plans"
                }
            ]
        }
    ]
}'

Sample Success Response (200 OK)

{
  "success": true,
  "message_id": 106,
  "wa_message_id": "wamid.HBgMOTE5ODc2NTQzMjEw...",
  "phone": "919876543210",
  "status": "sent"
}
POST /api/v1/messages/send-contact

Send Contact Card (vCard)

Contact Sharing

Dispatches a native WhatsApp contact card / vCard 3.0 with full name, phone number, and organization name, enabling the recipient to save or message the contact in 1 click.

Request Body Parameters

Field Type Status Description
instance_key string Required Your connected WhatsApp instance key.
phone string Required Recipient phone number with country code.
name string Required Full display name of the contact.
contact_phone string Optional Phone number of the contact card (defaults to recipient if omitted).
organization string Optional Company or business affiliation name.
7-LANGUAGE CODE EXAMPLES JSON Payload
curl -X POST "https://wasetu.hostgeeks.in/api/v1/messages/send-contact" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_key": "inst_7fa289e",
    "phone": "919876543210",
    "name": "Alex Morgan",
    "contact_phone": "919876543210",
    "organization": "HostGeeks Cloud Services"
}'

Sample Success Response (200 OK)

{
  "success": true,
  "message_id": 107,
  "wa_message_id": "wamid.HBgMOTE5ODc2NTQzMjEw...",
  "phone": "919876543210",
  "status": "sent"
}
GET /api/v1/messages/history

Query Message History & Logs

Audit & Telemetry

Retrieves paginated historical outbound and inbound messages filtered by instance slot, recipient phone number, or date range.

Query Parameters

Field Type Status Description
instance_key string Optional Filter logs strictly for a specific instance slot.
phone string Optional Filter messages sent to or received from a specific phone.
limit integer Optional Results per page (default: 50, maximum: 200).
page integer Optional Page offset number for pagination (default: 1).
7-LANGUAGE CODE EXAMPLES Request
curl -X GET "https://wasetu.hostgeeks.in/api/v1/messages/history?instance_key=inst_7fa289e&limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Sample Success Response (200 OK)

{
  "success": true,
  "data": [
    {
      "id": 1042,
      "instance_key": "inst_7fa289e",
      "phone": "919876543210",
      "message": "Hello! Your appointment is confirmed for *3:00 PM* today.",
      "status": "delivered",
      "created_at": "2026-08-30T17:40:12Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "per_page": 20,
    "total": 148
  }
}
GET /api/v1/groups

List Participating WhatsApp Groups

Group Discovery & Metadata

Retrieves all active WhatsApp groups that the connected instance is a participating member of, including group IDs, subjects, participant counts, creation timestamps, and owner JIDs.

Query Parameters

Field Type Status Description
instance_key string Required Unique identifier of your connected WhatsApp instance slot.
7-LANGUAGE CODE EXAMPLES Request
curl -X GET "https://wasetu.hostgeeks.in/api/v1/groups?instance_key=inst_7fa289e" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Sample Success Response (200 OK)

{
  "success": true,
  "total": 2,
  "groups": [
    {
      "id": "120363421634618099@g.us",
      "subject": "Executive Management & Operations",
      "participantsCount": 24,
      "creation": 1788078000,
      "owner": "919958240463@s.whatsapp.net",
      "desc": "Official coordination channel for operations and field dispatch."
    },
    {
      "id": "120363389145672101@g.us",
      "subject": "DevOps & Infrastructure Alerts",
      "participantsCount": 12,
      "creation": 1787954000,
      "owner": "919876543210@s.whatsapp.net",
      "desc": "Automated incident notices and build monitoring."
    }
  ]
}
POST /api/v1/messages/send-group

Send WhatsApp Group Message

Broadcast & Group Announcements

Dispatches announcements, status updates, notifications, or document attachments directly to any WhatsApp Group. Supports full WhatsApp markdown formatting (*bold*, _italic_, ~strikethrough~, bullet lists, numbered lists, and quotes).

Request Body Parameters

Field Type Status Description
instance_key string Required Unique identifier of your connected WhatsApp instance slot.
group_id string Required Target WhatsApp Group JID ending with @g.us (e.g. 120363421634618099@g.us) or 18-digit group number.
message string Required Message text content. Full WhatsApp markdown is enabled. Max 4096 characters.
media_url string Optional Publicly accessible direct HTTPS URL to an image, document, audio, or video attachment.
7-LANGUAGE CODE EXAMPLES JSON Payload
curl -X POST "https://wasetu.hostgeeks.in/api/v1/messages/send-group" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_key": "inst_7fa289e",
    "group_id": "120363421634618099@g.us",
    "message": "*Important Announcement:* \nScheduled maintenance has completed successfully! 🚀",
    "media_url": "https://example.com/release-notes.pdf"
  }'

Sample Success Response (200 OK)

{
  "success": true,
  "message": "Group message dispatched successfully to 120363421634618099@g.us",
  "data": {
    "id": 1089,
    "instance_key": "inst_7fa289e",
    "group_id": "120363421634618099@g.us",
    "message": "*Important Announcement:* \nScheduled maintenance has completed successfully! 🚀",
    "media_url": "https://example.com/release-notes.pdf",
    "status": "sent",
    "created_at": "2026-09-04T00:10:00Z"
  }
}

Real-Time Inbound Webhooks

Receive customer replies and real-time delivery acknowledgments

Configure your webhook endpoint URL inside your Client Portal. Whenever an inbound message arrives or an outbound message transitions status (sent → delivered → read), our gateway dispatches an HTTP POST JSON event directly to your server.

EVENT Inbound Message Event (messages.upsert)

{
  "event": "messages.upsert",
  "instance_key": "inst_7fa289e",
  "phone": "919876543210",
  "sender_name": "Sarah Connor",
  "message_body": "Hi! I would like to book a demo coaching session for tomorrow.",
  "message_type": "text",
  "timestamp": 1788092058
}

EVENT Delivery Status Receipt (messages.update)

{
  "event": "messages.update",
  "instance_key": "inst_7fa289e",
  "wa_message_id": "3EB0F429A71",
  "phone": "919876543210",
  "status": "read",
  "timestamp": 1788092062
}

HTTP Error Codes & Resolutions

Standard status codes returned by the API

Code Meaning Resolution Guide
200 OK Success Request processed and WhatsApp message sent or session updated.
400 Bad Request Instance Disconnected Device is not connected. Scan QR in portal or use /instances/{key}/connect.
401 Unauthorized Invalid API Token Ensure your Bearer token is passed correctly in the Authorization header.
403 Forbidden Feature Locked Your subscription plan does not include REST API access. Upgrade your plan.
422 Unprocessable Validation Error One or more required fields are missing or invalid (e.g. invalid phone number format).
429 Rate Limit Quota Exceeded Daily or monthly message limit exhausted, or burst rate exceeded. Upgrade to higher tier.
500 Server Error Internal Failure WhatsApp socket engine failure or internal exception. Verify gateway daemon is running.
Cookie & Privacy Choices

We use essential cookies to maintain secure authentication and analytical cookies to improve platform performance.