For developers

Trigger WhatsApp messages from your own systems.

A small REST API and outbound webhooks. Your API key lives in the dashboard under API & webhooks.

Authentication

Send your key as a bearer token on every request.

Authorization: Bearer oct_xxxxxxxxxxxxxxxx

Send a template message

Works outside the 24-hour window. The template must already be approved by Meta.

POST https://test.niswartham.org/api.php?action=send_template

{
  "to": "9876543210",
  "template": "order_update",
  "variables": ["Priya", "RW-1029"],
  "header_media": "https://example.com/banner.jpg"
}

Returns a queue_id. The message is dispatched by the background worker within seconds, and its state can be polled with the status endpoint.

Send a session message

Plain text, only valid while the customer's 24-hour window is open.

POST https://test.niswartham.org/api.php?action=send_text

{ "to": "9876543210", "text": "Your order leaves the warehouse this evening." }

Create or update a contact

POST https://test.niswartham.org/api.php?action=add_contact

{ "phone": "9876543210", "name": "Priya Nair",
  "attributes": { "city": "Pune", "order_id": "RW-1029" } }

Other endpoints

  • ?action=status&id=123 — delivery state of a queued message
  • ?action=usage — plan, limits and this month's usage
  • ?action=contacts&page=1&limit=50 — paginated contact list
  • ?action=templates — your approved templates
  • ?action=opt_out — mark a contact as opted out

Outbound webhooks

Add your endpoint in the dashboard and we will POST incoming messages and delivery updates to it as JSON.

Error codes

  • 401 — API key missing or invalid
  • 402 — subscription expired, or a plan limit reached
  • 403 — your plan does not include API access
  • 409 — the 24-hour window is closed, send a template instead
  • 422 — the request is missing or malforming a field