Confirm this change

API reference 2 min read

API quickstart

Connect your backend to a WhatsApp workspace.

On this page

Prepare the workspace

Complete guided workspace setup: connect WhatsApp, confirm Meta number readiness, obtain business verification approval and confirm a test delivery. The 15-day free trial starts after these checks pass; no payment is needed during setup. In Dashboard → Platform → API access, create a workspace API key. Store the key in your backend secret manager. Never embed it in browser code, mobile apps, URLs or source control.

Authentication and base URL

Use https://connect.meshdex.com/api/platform on the hosted service, or your deployment origin followed by /api/platform. Send x-api-key on every integration request. Keys are scoped to their workspace; a workspace ID supplied by the caller cannot switch tenants. Revoked keys return 401. Key and webhook management routes use dashboard authentication and workspace roles, not API keys.

Send your first reply

Record opt-in only after obtaining real consent. Free-form messages require an open WhatsApp customer service window, normally 24 hours after the customer last messaged the business. Outside that window, send an approved template. An accepted send is not proof of delivery; follow signed message.delivered, message.read and message.failed events.

Request headers

Content-Type: application/json is required for JSON writes. All /messages send requests require Idempotency-Key (8–128 letters, digits, dots, colons, underscores or hyphens). Use a new key for each new logical action. x-whatsapp-sender is the Meta phone number ID, not a display phone number; omit it to use the default sender.

Example request

Example
curl "$CONNECT_ORIGIN/api/platform/messages/text" \
  -H "x-api-key: $CONNECT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reply-order-1042-v1" \
  -H "x-whatsapp-sender: 123456789012345" \
  -d '{"to":"919876543210","body":"Your order is ready."}' 

Example response

Example
{"message":"Message sent successfully","messageId":"wamid.example"}

Build a two-way chat

Subscribe to message.inbound and message status events in Platform → Webhooks. Load GET /messages to display history. Group messages by business sender and recipient, use POST /messages/text to reply, and POST /messages/read for inbound read receipts. Keep API keys on your backend and expose only your own authenticated, authorized chat service to your frontend.

Need help with this guide? Contact support