Messenger API for AI agents
Let your AI agent answer the people who message you on Facebook Messenger: it reads every chat, replies with text, photos and files, and can schedule messages and run automations for you.
What your agent can do on Messenger
- Read and answer Messenger chats, with photos and files
- Start a chat with someone who expects to hear from you
- Schedule messages and run automations
Three steps
- Start a trial and connect Messenger. You sign in to Facebook through a secure link and approve the connection.
- Add Spaces to your AI agent with one URL,
https://api.spacesos.com/mcp/messenger, or use the REST API athttps://api.spacesos.com/v1. Steps for each AI client. - Your agent reads and answers. Spaces paces every message inside the limits that keep the account safe.
Or paste this into your agent and let it set things up with you:
Set up Spaces for me by following https://www.spacesos.com/agentsThe core tools
| What it does | MCP tool | REST |
|---|---|---|
| Your conversations, newest first. Filter to unread. | list_messaging_chats | GET …/chats |
| The messages in one conversation. | list_messaging_messages | GET …/chats/{chat_id}/messages |
| An image, file, voice note or video from a message. | get_messaging_attachment | GET …/chats/{chat_id}/messages/{message_id}/attachments/{attachment_id} |
| Reply in a conversation, with text or attachments. | reply_in_chat | POST …/chats/{chat_id}/messages |
| Start a new conversation with someone who expects to hear from you. | start_chat | POST …/chats |
| Send a message at a set local time, inside working hours you choose. | schedule_message | POST /v1/messaging/schedules |
Every Messenger tool · Messenger MCP guide · Full reference
Limits that keep the account safe
Up to 40 messages a day per account, at least 20 seconds apart, with 8 new chats a day at most and a four-week warm-up for new accounts. Messenger limits in full · How accounts are kept safe.
FAQ
Can an AI agent reply to Facebook Messenger automatically?
Yes. Your agent reads new messages and replies in the same chat through Spaces, inside Messenger’s safe limits.
Can it message people who have not written to me?
Messenger only lets you reach someone who has not replied inside its messaging window, so Spaces works best for answering people who message you.
How do I connect Messenger?
You sign in to Facebook through a secure link and approve the connection. There is no app review to wait for.
How much does the Messenger API cost?
Plans from $19 a month for one connected account, with a trial. You pay per connected account, not per message or per contact.