Documentation
Messages
POST /messages sends any message type the Cloud API supports. The body carries the numberId that sends, the recipient in E.164 (digits with the country code, with or without +) and a message object discriminated by type.
curl -X POST https://zaiped.com/v1/messages \
-H "Authorization: Bearer zp_..." \
-H "Content-Type: application/json" \
-d '{
"numberId": "YOUR_NUMBER_ID",
"to": "5511999999999",
"message": { "type": "text", "text": "Hello from Zaiped" }
}'Message types
- text: text, previewUrl.
- image, video, audio, document, sticker: media as { path } (a mediaId from POST /media) or { link } (a public URL), plus caption and fileName.
- location: latitude, longitude, name, address.
- contacts: a list of { name, phone, email }.
- reaction: wamid and emoji.
- buttons: up to three reply buttons with header, body and footer.
- list: sections of rows behind one button.
- cta_url: a body with one link button.
- carousel: cards with media and a URL or reply button each.
- location_request and call_permission: a body that asks the customer for the location or for permission to call.
- flow: a WhatsApp Flow by flowId, with the CTA text.
- product, product_list and catalog_message: items from the linked Meta catalog.
- template: templateId and values, a map from variable to text (body variables by their name or position; header and buttons by their slot key).
The 24-hour window
Meta only accepts free-form messages within 24 hours of the customer's last message. When the recipient is known to us and the window is closed, the API answers 400 with meta_window_closed before calling Meta. Templates are accepted at any time.
What you get back
The response carries the wamid Meta assigned and a status: accepted, or held_for_quality_assessment when Meta holds a message sent with a new template. Delivery, read and failure arrive later as message.status webhook events.
- POST /messages/{wamid}/read marks a received message as read, optionally with the typing indicator.
- POST /blocked and DELETE /blocked/{numberId}/{phone} block and unblock a customer. Meta only allows blocking who messaged you in the last 24 hours.