Hira Documentation
FR EN
Free trial

Send messages

Every content type, statuses and media.

POST /messages sends a message. It needs connectionId, to (number in international format, for example +237600000000) and exactly one content field.

Content types#

Field Use
text Free text, 4,096 characters at most.
image, document, audio, video Media, by assetId (see below) or by url. Caption and file name are optional.
product Meta product card (catalogId, productRetailerId, optional body).
productList Product list (catalogId, body, sections[].productItems[]).
template Approved template: { name, language, components? }.
smart Free text if the 24-hour window is open, otherwise the fallback template: { text, template }.
buttons Up to 3 quick-reply buttons.
list A list of choices, up to 10 rows.
cta A button that opens a web address.
otp One-time code, see the guide.
flow WhatsApp Flow (navigate, data_exchange or cta): see WhatsApp Flows.
callPermissionRequest Asks the customer for permission to call them: see WhatsApp calls.
reaction Reaction to a received message.
JSON
{ "connectionId": "con_...", "to": "+237600000000", "text": "Your parcel leaves tomorrow." }

The 24-hour window#

WhatsApp only accepts a free-form message (text, media, buttons, list) within 24 hours of the recipient's last message. Outside it, you need an approved template. A send outside the window fails with error 131047. To personalise and send in bulk while the window is open, use a free-form campaign.

The life of a message#

with the Meta error codePOST /messages answers right awayAcceptedacceptedSentsentDelivereddeliveredReadreadFailedfailed

Click a status to follow the message's path, or the failure to see the error code.

A message status changes after the API answers. Every change also arrives through a webhook.

The 200 response gives id, wamid and status = accepted. This means Meta took the message, not that it arrived. The status then moves to sent, delivered, read or failed. Follow it with a webhook or with GET /messages/{id}.

Send media#

Upload the file with POST /media (multipart, field file), then use the assetId you receive in the message. The same file uploaded twice is stored once. Media is kept 30 days in a private vault, then deleted.

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/media \
  -H "Authorization: Bearer pk_live_..." \
  -F "[email protected]"

Failures#

A failed message exposes Meta's error code. The detail of each code and the right reaction are in Error codes.