Send a message
Send a message from your backend through the public API.
Send a message
Call POST /v1/messages from your backend. The example uses synthetic values.
const response = await fetch("https://api.example.com/v1/messages", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.META_FLOW_HUB_API_KEY!,
"Idempotency-Key": "order-123-notification-1",
},
body: JSON.stringify({
recipient: "+6281200000000",
templateId: "template_welcome",
variables: { firstName: "Ayu" },
}),
});Check the HTTP status and error envelope before treating the request as successful. See the POST messages operation for complete fields and responses.