HTTP API

Send WhatsApp messages from WhatSync

Use the Send API from construction operations tools, automations, backend jobs, and support workflows. v1 supports direct text, image, and document messages from the connected WhatsApp account.

Authentication

Send a bearer token with every request. For the construction app, use the token shown in the dashboard MCP setup card. The token is scoped to the connected WhatSync workspace and sends from that workspace's WhatsApp account.

Authorization header
Authorization: Bearer YOUR_CONSTRUCTION_TOKEN

Endpoint

Send message endpoint
POST https://construction.whasupcrm.com/api/v1/messages/send

Send Text

Text sends require a recipient phone number and non-empty text. Use international phone number format when possible.

curl text message
curl -X POST "https://construction.whasupcrm.com/api/v1/messages/send" \
  -H "Authorization: Bearer YOUR_CONSTRUCTION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+917999709798",
    "type": "text",
    "text": "The site inspection is scheduled for 4 PM."
  }'

Send Image

Image URLs must be public HTTPS URLs. Localhost, private network addresses, and non-HTTPS URLs are rejected.

curl image message
curl -X POST "https://construction.whasupcrm.com/api/v1/messages/send" \
  -H "Authorization: Bearer YOUR_CONSTRUCTION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+917999709798",
    "type": "image",
    "image": {
      "url": "https://example.com/site-progress.jpg",
      "caption": "Latest slab progress photo."
    }
  }'

Send Document

Documents use public HTTPS URLs. Provide a file name and MIME type when your system knows them.

curl document message
curl -X POST "https://construction.whasupcrm.com/api/v1/messages/send" \
  -H "Authorization: Bearer YOUR_CONSTRUCTION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+917999709798",
    "type": "document",
    "document": {
      "url": "https://example.com/daily-report.pdf",
      "fileName": "daily-report.pdf",
      "mimetype": "application/pdf",
      "caption": "Daily site report attached."
    }
  }'

Node Example

Node fetch
const response = await fetch("https://construction.whasupcrm.com/api/v1/messages/send", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_CONSTRUCTION_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    to: "+917999709798",
    type: "text",
    text: "Concrete pour starts at 7 AM tomorrow.",
  }),
});

const result = await response.json();

Responses

Accepted response
{
  "accepted": true,
  "messageId": "BAE5...",
  "remoteJid": "[email protected]",
  "to": "+917999709798",
  "normalizedPhone": "917999709798",
  "status": "accepted"
}

The construction Send API uses the existing WhatsApp send path and returns after WhatsApp accepts the message. It does not expose the CRM queue or send-attempt status endpoints.

Error Codes

CodeMeaning
missing_bearer_tokenThe Authorization header is missing or malformed.
invalid_bearer_tokenThe bearer token is invalid.
invalid_requestRequest JSON is missing required fields.
invalid_phone_numberPhone number must contain 7 to 15 digits.
not_connectedThe connected WhatsApp account is offline.
recipient_not_foundThe phone number is not reachable on WhatsApp.
invalid_media_urlMedia URL is not a safe public HTTPS URL.
WhatsApp can limit or suspend accounts for unwanted or risky messaging. Use this API for expected, consent-based operational messages, not high-volume blasts.