Facebook and Messenger API for Your App
Connect your users' personal Facebook accounts and the Pages they manage. Read and send Messenger messages, publish posts, reply to comments and sync contacts, through one API.
One API for Facebook and Messenger: Connect Every Account Type
Your users link their personal Facebook account once. Every Page they manage becomes available through the same endpoints.
Personal Facebook Account
Personal MessagingConnect your users' personal Facebook accounts and sync their Messenger chats, posts and contacts in real time.
- Messenger
- Personal chats and group conversations, with attachments, reactions and read receipts.
- Posts
- List, create, update and delete posts on the user's profile.
- Comments & reactions
- Read and reply to comments, react to posts and comments.
- Users
- Profiles, followers, friend requests and presence.
- Typical use
- CRM and sales teams who talk to prospects from their own account.
Facebook Pages
Pages managed by the userHandle Messenger conversations of the Pages your users manage, with Page posts and the people who write to them.
- Messenger
- Page inboxes: list conversations and reply as the Page, for every Page the user manages.
- Posts
- Retrieve and publish Page posts.
- Comments & reactions
- Answer comments and react on Page posts.
- Users
- Profiles of the people who write to the Page.
- Typical use
- Customer support and brands that manage several Pages.
Messenger API: Sync and Answer Every Conversation in Your App
Sync Messenger conversations from personal accounts and Pages in real time, and reply without leaving your product.
List chats and Page inboxes, start new conversations, reply, edit, delete or forward messages. Link several accounts and Pages per user.
Manage Facebook Posts, Comments & Reactions via API
Retrieve and publish posts from personal Facebook accounts and Pages, directly from your platform.
List & Retrieve Posts
Fetch posts from linked personal accounts and Pages, with captions, media and timestamps.
Create Posts
Publish a new post to a personal profile or a Facebook Page from your app.
Comment & React
Reply to comments and add reactions on posts, from the user's own account.
Sync Messenger Contacts into Your CRM
Retrieve user profiles, followers and friend requests with the Users API, and link their Messenger conversations to a CRM record.
Facebook and Messenger API Capabilities
Messaging, Posts and Users endpoints for personal Facebook accounts and Facebook Pages, through one unified API.
Account Connection
3 endpoints available
Messages
27 endpoints available
Posts
19 endpoints available
Users
14 endpoints available
Webhooks
9 events available
Facebook and Messenger API Use Cases
What you can build with the Facebook and Messenger API, and what your users gain.
CRM and Sales
Sync Messenger conversations with contact records and reply directly from the CRM.
The full conversation history and every deal in one place, without leaving the CRM.
CRM Use CaseCustomer Support and Helpdesk
Add Messenger to your support channels so agents read and answer Facebook messages in the same tool.
Facebook requests handled in the usual support tool, with no forgotten conversation.
Unified InboxAI Agent Platforms
Connect AI agents to Messenger to answer questions, qualify requests and hand off to a human.
First replies automated, teams step in only when a request needs them.
AI Agent Use CaseMultichannel Messaging
Bring Messenger, WhatsApp, Instagram, LinkedIn and email together in one interface with Unipile APIs.
Every channel read and answered from a single place.
Messaging APIHow Unipile Differs from the Meta Graph API
Unipile connects to Facebook on behalf of each user, with their own account. It is not a Meta official product.
Each user connects their own account, with no profile storage. Unipile is not a Meta Partner. Learn more
Build Features into Your Product Today
Try our White-Label solution for free and unlock its full potential for your business. With the 7-Day Free Trial, gain access to the complete suite of features designed to enhance your platform's capabilities and branding.
What's included
Connecting Made Easy: Integrate the Facebook and Messenger API in 2 API Requests
A production-ready SDK that handles the complexity of Facebook and Messenger integration. RESTful endpoints, real-time webhooks, and automatic rate limiting, so you can focus on building, not maintaining.
Simple Integration
Send messages, retrieve profiles and sync conversations with just a few lines of code. Our SDK handles authentication, rate limits, and error handling.
// Connect to Messenger in seconds import { UnipileClient } from 'unipile-node-sdk'; const client = new UnipileClient({ dsn: 'https://api.unipile.com', token: process.env.UNIPILE_TOKEN }); // Retrieve a Messenger contact profile const profile = await client.users.getProfile({ account_id: accountId, provider_id: 'messenger_user_id' }); // Reply to a Messenger conversation await client.messaging.sendMessage({ account_id: accountId, text: 'Hello! Thanks for your message.', attendees: [{ provider_id: 'messenger_user_id' }] });
RESTful API
Clean, standardized endpoints with JSON responses. Predictable URL structure and HTTP methods.
Real-time Webhooks
Instant notifications for new messages and account status changes. No polling required.
Secure Authentication
Token-based authentication with automatic session management. Secure credential handling for all account types.
Account Protection
Built-in safeguards to protect Messenger accounts, with activity limits on every linked account.
Smart Rate Limiting
Automatic rate limit management with informative headers. We handle Messenger's restrictions for you.
Clear Error Handling
Descriptive error codes and messages. Built-in retry logic with exponential backoff.
Build Facebook features with your coding agent
Your coding agent reads the Unipile API through the MCP server and adds Facebook Page conversations and post comments to your product.
Setup guide for your agentAdd Facebook Page messages and post comments to my shared inbox using Unipile
- 1 Sync the conversations of each linked Page GET /v2/{account_id}/chats
- 2 Reply from the shared inbox POST /v2/{account_id}/chats/{chat_id}/messages/send
- 3 Load the comments of each post GET /v2/{account_id}/posts/{post_id}/comments
Page messages and comments added to the shared inbox.
Tested on the Development applicationhttps://api.unipile.com Scoped API key in the X-API-KEY header One dashboard for all your integrations
Manage all your LinkedIn, WhatsApp, Gmail accounts and more from a single, intuitive interface.
Accounts
03/01/2025
02/15/2025
02/10/2025
03/01/2025
02/28/2025
02/20/2025
03/01/2025
02/25/2025
03/01/2025
02/22/2025
02/14/2025
02/12/2025
02/08/2025
02/05/2025
03/01/2025
02/15/2025
03/01/2025
02/22/2025
Discover More from Our API Suite
Beyond Facebook and Messenger, Unipile connects your product to messaging platforms, email providers, and calendars.
Built-In Security and Compliance
Enterprise-grade protection for your data and workflows Learn more about our security
Facebook and Messenger API FAQ
Everything you need to know about integrating Messenger with Unipile's API
It is an application programming interface that connects Facebook to your applications, websites and CRM systems: Messenger conversations on one side, posts, comments, reactions and user profiles on the other. Unipile covers Messaging, Posts and Users, for personal Facebook accounts and Facebook Pages.
No. Unipile is an independent company. It is not a Meta Partner and is not officially endorsed, sponsored or approved by Meta. Facebook and Messenger are trademarks of Meta Platforms, Inc.
No. Your users link their own Facebook account through Unipile's Hosted Auth.
The API is designed in line with the Digital Markets Act. Each user connects their own account, and Unipile acts on their behalf without storing user profiles.
Yes. Use the API for legitimate scenarios such as customer support or direct conversations. Spam and unauthorized automation can get accounts restricted or banned.
You can integrate the Facebook Messenger API by following the SDK. It provides detailed instructions on setting up the integration.
The main ones are CRM and sales, customer support and helpdesk, AI agent platforms and multichannel messaging, alongside order tracking and appointment scheduling.
Yes, you can send text, images, audio, and video messages, as well as documents via the API.
Absolutely. The API is designed to be flexible and can be integrated into your existing CRM or other business software.
Still have questions? Our team is here to help.
Talk to an expert