Send Message
const url = 'https://example.com/platform/v1/messages';const options = { method: 'POST', headers: {'X-API-Key': 'example', 'Content-Type': 'application/json'}, body: '{"channel_id":1,"components":[{"parameters":[{"parameter_name":"example","text":"example","type":"text"}],"type":"header"}],"contacts":["example"],"context":{},"interactive":{},"language_code":"es","location":{},"media":{"caption":"example","filename":"example","id":"example","link":"example","voice":false},"preview_url":false,"reaction":{},"template_name":"example","text":"example","to":"example","type":"text"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/platform/v1/messages \ --header 'Content-Type: application/json' \ --header 'X-API-Key: example' \ --data '{ "channel_id": 1, "components": [ { "parameters": [ { "parameter_name": "example", "text": "example", "type": "text" } ], "type": "header" } ], "contacts": [ "example" ], "context": {}, "interactive": {}, "language_code": "es", "location": {}, "media": { "caption": "example", "filename": "example", "id": "example", "link": "example", "voice": false }, "preview_url": false, "reaction": {}, "template_name": "example", "text": "example", "to": "example", "type": "text" }'Send a WhatsApp/Instagram message via the developer’s platform channel.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Request Body required
Section titled “Request Body required ”Body for POST /platform/v1/messages.
type=text → text required, template_name ignored.
type=template → template_name required, WhatsApp channels only.
type=image|video|audio|document|sticker → media required.
type=interactive / catalog → interactive required (passthrough).
type=location → location required.
type=contacts → contacts required.
type=reaction → reaction required.
type=typing → no body field required (just channel_id + to).
Reply-to and link preview:
context.message_idinjects a reply-to context into the Meta payload (text/media — WA + IG native).preview_urlenables WhatsApp link preview fortype=text(IG ignores).
object
header — fills the template’s HEADER placeholder(s).
object
text — the only parameter kind that fills a NAMED body placeholder.
currency parameter.
date_time parameter.
image parameter — header only.
video parameter — header only.
document parameter — header only.
location parameter — header only.
payload parameter — sub_type=quick_reply buttons ONLY.
object
coupon_code parameter — sub_type=copy_code buttons ONLY.
object
body — fills the BODY placeholders.
NAMED and POSITIONAL cannot be mixed: either EVERY parameter carries
parameter_name (the template was created with
parameter_format=NAMED) or none does.
object
text — the only parameter kind that fills a NAMED body placeholder.
currency parameter.
date_time parameter.
image parameter — header only.
video parameter — header only.
document parameter — header only.
location parameter — header only.
payload parameter — sub_type=quick_reply buttons ONLY.
object
coupon_code parameter — sub_type=copy_code buttons ONLY.
object
button — one component per button, addressed by index.
index serializes as Meta’s STRING index (“0”, “1”, …); an integer is
accepted and coerced. The parameter kind is FIXED by sub_type:
quick_reply -> one payload, url -> one text,
copy_code -> one coupon_code.
object
text — the only parameter kind that fills a NAMED body placeholder.
currency parameter.
date_time parameter.
image parameter — header only.
video parameter — header only.
document parameter — header only.
location parameter — header only.
payload parameter — sub_type=quick_reply buttons ONLY.
object
coupon_code parameter — sub_type=copy_code buttons ONLY.
object
carousel — never nested (a card cannot contain another carousel).
object
One runtime carousel card — card_index plus its own components.
object
header — fills the template’s HEADER placeholder(s).
object
text — the only parameter kind that fills a NAMED body placeholder.
currency parameter.
date_time parameter.
image parameter — header only.
video parameter — header only.
document parameter — header only.
location parameter — header only.
payload parameter — sub_type=quick_reply buttons ONLY.
object
coupon_code parameter — sub_type=copy_code buttons ONLY.
object
body — fills the BODY placeholders.
NAMED and POSITIONAL cannot be mixed: either EVERY parameter carries
parameter_name (the template was created with
parameter_format=NAMED) or none does.
object
text — the only parameter kind that fills a NAMED body placeholder.
currency parameter.
date_time parameter.
image parameter — header only.
video parameter — header only.
document parameter — header only.
location parameter — header only.
payload parameter — sub_type=quick_reply buttons ONLY.
object
coupon_code parameter — sub_type=copy_code buttons ONLY.
object
button — one component per button, addressed by index.
index serializes as Meta’s STRING index (“0”, “1”, …); an integer is
accepted and coerced. The parameter kind is FIXED by sub_type:
quick_reply -> one payload, url -> one text,
copy_code -> one coupon_code.
object
text — the only parameter kind that fills a NAMED body placeholder.
currency parameter.
date_time parameter.
image parameter — header only.
video parameter — header only.
document parameter — header only.
location parameter — header only.
payload parameter — sub_type=quick_reply buttons ONLY.
object
coupon_code parameter — sub_type=copy_code buttons ONLY.
object
Outbound media source for type=image|video|audio|document|sticker.
Exactly one of link (public URL) XOR id (a media_id from the future
POST /platform/v1/media upload endpoint, WF3). Validator enforces the XOR.
Per-type field semantics:
caption— image/video/document only (Meta drops it on audio/sticker).filename— document only; WhatsApp REQUIRES it when sending by link.voice— audio only; WA-specific OGG/OPUS voice note (IG ignores).
Responses
Section titled “ Responses ”Successful Response
Response for POST /platform/v1/messages.
object
Example generated
{ "channel_id": 1, "message_id": "example", "type": "example"}Bad request — wa_only (type only supported on WhatsApp) or other validation rejected before any Meta call.
Channel not found or not owned by this developer account.
Unprocessable entity — body shape invalid for the requested type.
Rate limit or template quota exceeded — retry after the window resets.
Headers
Section titled “Headers ”Total requests permitted in the current window.
Requests remaining in the current window.
Unix epoch seconds when the window resets.
Upstream Meta API error — structured envelope with Meta’s code / title / message / fbtrace_id for debugging.
object
Example generated
{ "error": "example", "fbtrace_id": "example", "message": "example", "meta_code": 1, "meta_subcode": 1, "meta_title": "example"}