Log inStart Free Trial
easyCoexistence Official APIs

Messenger Send API: sending messages from a Facebook Page

A Facebook Page sends Messenger messages with POST /{page-id}/messages and a Page access token: recipient holds the person's Page-scoped ID (PSID), messaging_type is RESPONSE or UPDATE inside the standard messaging window or MESSAGE_TAG after it, and message carries text or an attachment such as an image, audio, video or file. Meta answers with the recipient_id and a message_id.

easyCoexistence replies to DMs on Messenger with send_social_dm from Claude, ChatGPT or your own code inside the 24-hour window, as text; media, quick replies and templates are not covered.

300 per second

Send API calls an app can make per Page for messages with text, links, reactions and stickers.

10 per second

Send API calls an app can make per Page for messages that contain audio or video.

25 MB

Largest asset the Messenger Platform saves for reuse; an image uploaded from a URL is capped at 8 MB.

30 images

Most images one message can carry in its attachments array, the only media type allowed there.

90 days

How long a saved attachment_id lasts before the media has to be uploaded again.

What does a Send API request contain?

Meta lists six components a send must include: the ID of the Page sending, the ID of the person receiving, a Page access token from that Page, permission from the person, the message type and the content. The request is a POST of JSON to /{page-id}/messages, and a reply to someone who just wrote looks like this:

A text reply, and Meta's answer
POST /{page-id}/messages
{
  "recipient": { "id": "<PSID>" },
  "messaging_type": "RESPONSE",
  "message": { "text": "Your order ships tomorrow." }
}

{ "recipient_id": "<PSID>", "message_id": "<MESSAGE_ID>" }

Which ID goes in recipient?

Usually the Page-scoped ID, or PSID, that Meta assigns a person the first time they message the Page; it arrives as sender.id in the messages webhook. The recipient object accepts other kinds of ID for particular cases:

  • id: the PSID, unique to that person and that Page.
  • user_ref: for someone who used a plugin or a postback button to message the Page.
  • comment_id or post_id: for a private reply to a comment or a visitor post.
  • IDs from Facebook Login are app-scoped and do not work on the Messenger Platform.

Which messaging_type should a message use?

The type tells Meta why the message is being sent, and it decides when the send is allowed. Meta's Page messages reference lists four values:

  • RESPONSE: a reply to a message the Page received, promotional or not, inside the standard messaging window.
  • UPDATE: a message the Page sends on its own initiative, promotional or not, also inside the window.
  • MESSAGE_TAG: a non-promotional message sent after the window, with a tag that matches an approved use case.
  • UTILITY: a utility message built from an approved template, such as an order or appointment update.

What can a message carry?

Text, or one attachment object with a type and a payload: image, audio, video and file attachments point at a URL or a saved attachment_id, and template attachments carry structured messages with buttons. The same endpoint also takes these:

  • attachments: an array of up to 30 images sent as one message.
  • reply_to with a mid: a reply to a specific earlier message, the person's or the Page's.
  • quick_replies: up to 13 buttons above the composer, each title up to 20 characters.
  • sender_action: a typing indicator, a seen mark or a reaction, sent in a separate request from the message itself.
  • notification_type: REGULAR by default, or SILENT_PUSH or NO_PUSH.

How large can attachments be?

Meta's guide to saving assets sets the limits for media the Messenger Platform fetches and keeps: assets of up to 25 MB, images of up to 8 MB when uploaded from a URL, audio sent with an audio Content-Type, and video fetched within 75 seconds. Setting is_reusable to true returns an attachment_id that only the Page that sent it can reuse, for 90 days, and POST /{page-id}/message_attachments uploads media ahead of time.

What are the Send API rate limits?

Meta counts them per Page and by content. Its Page messages reference lists 613, Calls to this api have exceeded the rate limit, among the send errors, so slow down rather than retrying at once when it appears:

  • 300 calls a second per Page for messages with text, links, reactions and stickers.
  • 10 calls a second per Page for messages with audio or video.
  • Too many messages to a single thread may be rate limited on their own.
  • Messenger API calls overall: 200 times the number of engaged users, in a rolling 24 hours.
  • Above 40 messages a second, the Page inbox stops showing new messages and the Page cannot send until the volume falls.

Which errors does the Send API return?

Meta's Messenger error table pairs each code with a subcode that names the cause. These are the ones a Page meets most often when it sends:

  • 10 with 2018278 or 2534022: This message is sent outside of allowed window.
  • 10 with 2018300: another app controls the conversation.
  • 100: Invalid parameter, such as a wrong recipient ID; subcode 2018001 reads No matching user found.
  • 551: the person is not available, having perhaps blocked the Page or deactivated their account; 200 with 1545041 reads This person isn't available right now.
  • 200 with 2018028: the app cannot message people outside its roles until pages_messaging is reviewed and the app is live.
  • 10904: The page has messages disabled in the settings.

How does easyCoexistence send through it?

send_social_dm takes the account_id, the person's recipient_id, which is sender.id in a forwarded messages event, and the text, and posts them to /{page-id}/messages with messaging_type RESPONSE. The result is Meta's answer with the message_id, and a refused send comes back with Meta's error code and message. Media, quick replies, templates and sender actions are not among the tools: send_social_dm sends text.

Common mistakes

  • Sending a typing indicator with the message. Meta wants sender_action alone with the recipient, and text or templates in a separate request.
  • Firing a burst at one person. Meta may rate limit a single thread on its own, apart from the Page's 300 calls a second.
  • Sending audio or video at the text rate. Messages with audio or video are held to 10 calls a second per Page.
  • Reusing an attachment_id older than 90 days. Saved attachment IDs expire, so upload the media again for a new one.
Doing this with EasyCoexistence

Automations reply to new messages on their own with a fixed text or an AI reply. US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.

easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.

Frequently asked questions

Is the Messenger Send API free?

Yes, for standard messages. Meta's overview calls the Messenger Platform free to use, so a Page replying to people who wrote to it pays nothing per message; marketing messages are charged per message.

Which Page task does sending a message need?

Meta's Messenger overview asks for a Page token from someone who can perform the MESSAGING and MODERATE tasks, with the pages_messaging permission granted.

Can easyCoexistence reply with images on Messenger?

Not today. send_social_dm sends text, and no tool sends an attachment.

How much does easyCoexistence cost for a Facebook Page?

Each Page you connect is one connection, billed at US$ 9 to US$ 0.75 per connection per month depending on how many you have, and the first 3 days are free.

Keep reading

Connect your first channel in two minutes.

No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.

  • 3 days free
  • Cancel any time
  • Official APIs only
  • Monitored 24/7

Verified on