Send a message
POST /v1/developer/messages — send text, media, or voice via a connected device.
Outbound messages are sent through a connected WhatsApp device. Every request needs a deviceUid (from GET /v1/developer/devices) and a recipient phone number in E.164-ish format (matching ^\+?[0-9]{7,15}$).
Send text
POST https://api.msgera.com/v1/developer/messages/send
X-API-Key: <MSGERA_KEY>
Content-Type: application/jsonRequest body
| Field | Type | Description |
|---|---|---|
deviceUidrequired | string | UID of the WhatsApp device sending the message. |
torequired | string | Recipient phone number, matching ^\+?[0-9]{7,15}$. |
textrequired | string | Message body (min 1 character). Supports spintax. |
curl -X POST https://api.msgera.com/v1/developer/messages/send \
-H "X-API-Key: $MSGERA_KEY" \
-H "Content-Type: application/json" \
-d '{
"deviceUid": "dev_4f8c2a1e",
"to": "+201001234567",
"text": "Hello from Msgera"
}'Send media
Upload an image, video, or document first with POST /v1/developer/media/upload, then reference its mediaId:
POST https://api.msgera.com/v1/developer/messages/send-media
X-API-Key: <MSGERA_KEY>
Content-Type: application/json| Field | Type | Description |
|---|---|---|
deviceUidrequired | string | UID of the WhatsApp device. |
torequired | string | Recipient phone number. |
mediaIdrequired | string | Id returned by /v1/developer/media/upload. |
caption | string | Optional caption shown below the media. |
clientMessageId | string | Your own idempotency key — duplicate values are deduped. |
Send voice
Same flow as media, but the upload should be an audio file. The recipient sees it as a voice note in WhatsApp.
POST https://api.msgera.com/v1/developer/messages/send-voice
X-API-Key: <MSGERA_KEY>
Content-Type: application/json| Field | Type | Description |
|---|---|---|
deviceUidrequired | string | UID of the WhatsApp device. |
torequired | string | Recipient phone number. |
mediaIdrequired | string | Id of the uploaded audio asset. |
clientMessageId | string | Your own idempotency key. |
Check WhatsApp availability
Before broadcasting, you can verify whether a list of numbers is on WhatsApp. Available on Baileys-backed devices only.
POST https://api.msgera.com/v1/developer/messages/check-whatsapp
X-API-Key: <MSGERA_KEY>
Content-Type: application/json| Field | Type | Description |
|---|---|---|
deviceUidrequired | string | UID of the WhatsApp device. |
numbersrequired | string[] | 1–50 phone numbers to check. |
Idempotency for media & voice
clientMessageId to safely retry on network errors. Msgera deduplicates by this value per device.Sending while delivery confirmations stream in? See Webhooksfor the inbound-reply payload, and the dashboard's real-time view for delivered/read status.