Documentation Index
Fetch the complete documentation index at: https://docs.msgflash.com/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
x-api-key: <api_key>
The message is accepted as queued, then sent asynchronously.
From the MsgFlash dashboard, media can be prepared through a temporary upload before final sending. See Temporary media uploads.
Parameters
Body
| Field | Type | Required | Description |
|---|---|---|---|
instanceId | UUID | yes | Source WhatsApp instance |
to | string | yes | E.164 number |
type | enum | yes if no templateId | Direct message type |
templateId | UUID | yes if no type | MsgFlash template to use |
text | string | depends on type | Direct message body |
mediaUrl | string | depends on type | Public media URL |
latitude | number | if type=location | Latitude |
longitude | number | if type=location | Longitude |
locationName | string | no | Location name |
locationAddress | string | no | Location address |
contactId | UUID | no | Shared contact or template context |
variables | object | no | Values injected into custom.* |
Mode 1 — Direct message
Texte
Media, location, and contact
- Image
- Vidéo
- Audio
- Note vocale
- Document
- Localisation
- Contact
Mode 2 — Send via template
You can send a message by providingtemplateId instead of type.
- loads the template
- resolves
contact.*,user.*,instance.* - injects your custom values into
custom.* - stores the final rendered text in
Message.body
contact.*user.*instance.*custom.*
For
contact.* variables, provide contactId if you want enriched contact context.Success response
Common errors
| Code | HTTP | When |
|---|---|---|
VALIDATION_ERROR | 400 | Invalid body |
TEMPLATE_INVALID | 400 | Invalid placeholder or template |
TEMPLATE_VARIABLES_MISSING | 400 | Variables template missing |
TEMPLATE_CONTEXT_UNAVAILABLE | 400 | Invalid contactId or instanceId context |
NOT_FOUND | 404 | Instance, contact, or template not found |
SUBSCRIPTION_INACTIVE | 403 | Subscription not usable |
MONTHLY_OUTBOUND_QUOTA_EXCEEDED | 429 | Monthly quota exhausted |
Possible statuses
| Status | Description |
|---|---|
queued | Message accepted and queued |
sent | Sent to WhatsApp |
delivered | Delivered to the device |
read | Read by recipient |
failed | Send failed |
Track status
GET /api/v1/messages/{id}- Webhooks
message.sent,message.delivered,message.read,message.failed