Send Messages
All messages are sent through the main endpoint:
POST https://messaging.mahadata.io/v1/{phone_number_id}/messagesReplace {phone_number_id} with your WhatsApp Business phone number ID (obtained from the app.mahadata.io page Channels).
Authentication
Section titled “Authentication”Every request must include the header Authorization with a Bearer token:
Authorization: Bearer YOUR_API_KEYCommon Parameters
Section titled “Common Parameters”| Parameters | Type | Required | Description |
|---|---|---|---|
messaging_product | string | Yes | Always "whatsapp" |
to | string | Yes | Recipient phone number in E.164 format (without +) |
type | string | Yes | Message type: text, image, document, template, interactive, location, contact, audio, video, sticker, reaction |
custom_properties | object | No | Custom metadata returned in the webhook, but not sent to the provider |
Message Type
Section titled “Message Type”Success Response
Section titled “Success Response”All message types return the same response:
{ "messaging_product": "whatsapp", "messages": [ { "id": "msg_f7a816e2-8397-11f0-8e34-010203040506" } ]}Save id from the response to track the message status via the webhook.
Webhook Status
Section titled “Webhook Status”Once the message is sent, you will receive a webhook for each status change. See the page Webhook for full details.
| The | Description |
|---|---|
message.status.sent | Message successfully sent to the network |
message.status.delivered | Message delivered to the recipient’s device |
message.status.read | Message read by the recipient |
message.status.failed | Message failed to send |