EN

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.

7-day free trial, no credit card.
Your App
Synced
Anna Rossi ARAnna Rossi
Messages12
Accounts3
Activity
Contacts84
JCJulia Chen
Julia ChenNew
1 min
Coveton Apparel page
Thank you for the quick answer!
LMLucas Meyer
Lucas MeyerOrder
25 min
Personal account
Is the order still on track?
SRSofia Rivera
Sofia RiveraBooking
2h
Green Bowl Cafe page
Can I book a table for Friday?
DMDaniel Martinez
Daniel MartinezSupport
5h
Coveton Apparel page
Thanks, the issue is solved now.
FacebookCoveton ApparelLinked
Conversations 48Unread 6
FacebookGreen Bowl CafeLinked
Conversations 31Unread 4
FacebookAnna Rossi, personal accountLinked
Conversations 22Unread 2
Julia Chen replied to your message
FacebookCoveton Apparel · 1 min ago
Conversation assigned to Carlos Reed
FacebookTeam inbox · 20 min ago
Image sent to Lucas Meyer
FacebookCoveton Apparel · 1h ago
Sofia Rivera tagged as Booking
FacebookGreen Bowl Cafe · 2h ago
JCJulia Chen
Julia ChenSynced
Customer · Coveton Apparel page
Messenger3 conversations
LMLucas Meyer
Lucas MeyerSynced
Customer · Coveton Apparel page
MessengerInstagram
SRSofia Rivera
Sofia RiveraSynced
Customer · Green Bowl Cafe page
Messenger1 conversation
DMDaniel Martinez
Daniel MartinezSynced
Customer · Coveton Apparel page
Messenger2 conversations
await client.messaging.sendMessage("Hi!");
FacebookFacebook API Integration

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 Messaging

Connect 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 user

Handle 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

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.

Your App
Synced
FacebookPersonalFacebookCoveton ApparelFacebookCoveton OutletLink a Page
Me · MONDAY, 05:09 PM
Hello Michel, your order has shipped. Tracking details below.
MOMichel OpraMichel Opra · MONDAY, 07:12 PM
Thank you for the quick answer!
Me · MONDAY, 07:30 PM
Happy to help. Talk soon.
EditForwardDelete
Reply to Michel via Messenger
LMLucas MeyerLucas Meyer · TUESDAY, 10:02 AM
Here is a photo of the item I received.
Clothing rack from a fall collection
Me · TUESDAY, 10:15 AMFILE
exchange-quote.pdf112 KB
LMLucas MeyerLucas Meyer · TUESDAY, 10:21 AM
0:12
Attach a file and reply via Messenger
SBSarah BrownSarah BrownActive now
Me · WEDNESDAY, 09:40 AM
Your appointment is confirmed for Friday at 10 AM.
Delivered
Me · WEDNESDAY, 09:41 AM
Here is the address of the store.
Seen
SBSarah BrownSarah Brown is typing
Reply to Sarah via Messenger
POSThttps://your-app.com/webhooks/unipile
Events pushed to your server
New messageLucas Meyer, Coveton Apparel page20010:21:04
Message editedMichel Opra20010:21:37
New reactionSarah Brown reacted to a message20010:22:10
Read receiptMessage seen by Michel Opra20010:22:52
Account statusPersonal account synced20010:23:15

List chats and Page inboxes, start new conversations, reply, edit, delete or forward messages. Link several accounts and Pages per user.

Posts API

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.

Documentation
Your App
FacebookFeed FacebookPosts Analytics
Posted via API
Clothing rack from a fall collection
248 32 14
248 reactions
Coveton Apparel Our fall collection just landed. Coats, knits and layers, available now in store and online. #fallcollection #newarrivals
Comments · 32
SRSofia Rivera
Sofia Rivera These look great, I need them!
24m 12
CA
Coveton Apparel Thanks Sofia! Sizes are restocked, the link is in the comments. via API
12m 3
DMDaniel Martinez
Daniel Martinez Do you ship to Europe?
8m 1
CA Reply as Coveton Apparel Post
Posts this week 3 published via API
+3
Users API

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.

Your App
FacebookMessenger conversations
Coveton Apparel page
Contacts 4
JCJulia Chen
Julia Chen Facebook3 conversations
LMLucas Meyer
Lucas Meyer Facebook2 conversations
DMDaniel Martinez
Daniel Martinez Facebook2 conversations
SRSofia Rivera
Sofia Rivera Facebook1 conversation
Sync
3 contacts synced
JCJulia Chen
Julia ChenCustomer · Coveton Apparel page
3Conversations
27Messages
318Followers
Full NameJulia Chen
Facebook PageCoveton Apparel, follower
Last MessageThank you for the quick answer!
Assigned ToCarlos Reed
TagsOrder, Support
ProfileGET /v2/{account_id}/users/{user_id}
Facebook API

Facebook and Messenger API Capabilities

Messaging, Posts and Users endpoints for personal Facebook accounts and Facebook Pages, through one unified API.

Explore All Endpoints

Account Connection

3 endpoints available

Hosted Auth: white label link to connect your end users
Custom Auth: connect with credentials or browser cookies
Two-factor checkpoints: SMS, authenticator app, WhatsApp, in-app validation or OTP

Messages

27 endpoints available

Send and Reply to Messages
List Chats, Page Inboxes and Messages
Start a Chat, from a Page Inbox too
Send and Download File Attachments
Edit, Delete and Forward Messages
Add and Remove Message Reactions
Read Status, Presence and Typing Indicator
Group Participants and Contacts

Posts

19 endpoints available

List and Retrieve Posts
Create, Update and Delete Posts
Post Reactions
Comments and Replies
Comment Reactions
User's Comments and Reactions

Users

14 endpoints available

Retrieve User Profiles and Pictures
User Presence
Update the Account Profile
Followers and Followings
Follow and Unfollow Users
Send, Accept or Cancel Friend Requests

Webhooks

9 events available

New Message
Message Edited or Deleted
Read and Delivery Receipts
New Reaction
Chat Updated or Deleted
Account Status
Use Cases

Facebook and Messenger API Use Cases

What you can build with the Facebook and Messenger API, and what your users gain.

Your CRM
ContactsDeals
ContactsCompanyViaStatus
JCJulia Chen
NexaTech
Facebook
Qualified
LMLucas Meyer
Synthex
Facebook
Proposal
SRSofia Rivera
Orbix
Facebook
Won
DMDaniel Martinez
Quark
Facebook
New

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 Case
Your Helpdesk
TicketsCustomers
RequestsTicketViaStatus
MOMichel Opra
#4521
Facebook
Open
EGElena Garcia
#4498
Facebook
Solved
GLGabriel Lopez
#4530
Facebook
Pending
ARAnna Rossi
#4476
Facebook
Open

Customer 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 Inbox
Your AI Agent
ConversationsHandoffs
ContactsIntentViaStatus
VHVictor Harris
Pricing
Facebook
AI replied
NDNatalia Diaz
Demo
Facebook
Qualified
RFRobert Fox
Billing
Facebook
To a human
OWOscar Ward
Info
Facebook
AI replied

AI 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 Case
Your Inbox
All channelsUnread
ContactsCompanyViaStatus
SBSarah Brown
NexaTech
Facebook
Replied
MYMery Yard
Orbix
WhatsApp
New
LMLucas Meyer
Synthex
Instagram
New
DMDaniel Martinez
Quark
LinkedIn
Replied

Multichannel 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 API

How 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.

Criteria
Meta Graph API
Unipile
Personal accounts
Meta Graph API: Not supported for messaging
Unipile: Supported
Setup
Meta Graph API: Meta app + App Review
Unipile: Your users link their account
Same API for other channels
Meta Graph API: No
Unipile: LinkedIn, WhatsApp, Instagram, email, calendar
Relationship with Meta
Meta Graph API: Official
Unipile: Independent, not endorsed by Meta
European Commission
EU Regulated Digital Markets Act (DMA)

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.

How many accounts?
5.00 €
/account/month
How accounts are calculated Pricing is based on the number of linked accounts. For example, 3 Emails + 2 LinkedIn + 6 WhatsApp accounts would cost 55€ (11 x 5€) (or $60.5, 11 x $5.5). No additional cost by request. We have minimum of 49€/month ($55), including up to 10 accounts.

What's included

check
One API. All channels
Linkedin, Instagram, Email, WhatsApp...
check
All Features
Outreach, Real-time Inbox, Enrichment...
check
Unlimited usage
Only providers limit apply.
check
7-Day Free Trial
Build Now
Cancel anytime. No credit card required
Built for Developers

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.

messenger-inbox.js
// 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' }]
});
One Unified API

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.

Unipile MCP server

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 agent
CursorCursor · social-inbox Unipile MCP connected

Add Facebook Page messages and post comments to my shared inbox using Unipile

  1. 1 Sync the conversations of each linked Page GET /v2/{account_id}/chats
  2. 2 Reply from the shared inbox POST /v2/{account_id}/chats/{chat_id}/messages/send
  3. 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 application
https://api.unipile.com Scoped API key in the X-API-KEY header
Unified Dashboard

One dashboard for all your integrations

Manage all your LinkedIn, WhatsApp, Gmail accounts and more from a single, intuitive interface.

/
Acme
/
Application
Documentation
API Reference
Changelog
Connect a new account
Select the type of account you
want to connect
LinkedIn
LinkedIn
WhatsApp
WhatsApp
Facebook
Facebook
Telegram
Telegram
Google
Google
IMAP
IMAP
Microsoft
Microsoft
Google Calendar
Google Calendar
Outlook Calendar
Outlook Calendar

Accounts

20 Operational
0 Authentication required
0 Service interruption
0 Paused
Name ID Status Linked
Operational Linked on
03/01/2025
Operational Linked on
02/15/2025
Operational Linked on
02/10/2025
Operational Linked on
03/01/2025
Operational Linked on
02/28/2025
Operational Linked on
02/20/2025
Operational Linked on
03/01/2025
Operational Linked on
02/25/2025
Operational Linked on
03/01/2025
Operational Linked on
02/22/2025
Operational Linked on
02/14/2025
Operational Linked on
02/12/2025
Operational Linked on
02/08/2025
Operational Linked on
02/05/2025
Operational Linked on
03/01/2025
Operational Linked on
02/15/2025
Operational Linked on
03/01/2025
Operational Linked on
02/22/2025
Try for free
Dashboard Demo

Discover More from Our API Suite

Beyond Facebook and Messenger, Unipile connects your product to messaging platforms, email providers, and calendars.

WhatsAppLinkedInInstagramTelegram

Messaging API

Connect WhatsApp, LinkedIn, Instagram and Telegram to send, receive and manage conversations.

GmailOutlookIMAP

Email API

Integrate Gmail, Outlook and IMAP to send, receive and sync emails in real time.

Google CalendarOutlook Calendar

Calendar API

Sync Google Calendar and Outlook events in real time, directly from your product.

6000+ Companies Innovating with Unipile
Trusted by industry leaders
1 API
Streamline operations for all major communication channels
2 Days
Achieve live integration quickly with minimal setup
30%
Reduction in maintenance efforts and resources

Built-In Security and Compliance

Enterprise-grade protection for your data and workflows Learn more about our security
SOC 2 Type II
SOC 2 Type II
Certified
Independently audited security controls ensuring data protection and operational integrity.
GDPR
GDPR
Compliant
Full compliance with European data protection regulations for user privacy.
99.9%
Platform Uptime over the last 24 months
24/7
Global Support with high-performance API

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