Skip to content

Facebook API

Postproxy publishes feed posts, Reels, and Stories to a Facebook Page, and offers the fullest engagement support of any network: complete comment management (including likes) and Messenger direct messages with reactions and private replies.

Every request below uses the base URL https://api.postproxy.dev and an Authorization: Bearer YOUR_API_KEY header. Replace YOUR_API_KEY and the example IDs with your own.

Platform IDfacebook
Formatspost (default), reel, story
Character limit63,206 (2,200 for Reels)
MediaOptional on feed posts; required for Reels and Stories
PlacementsPages — page_id (required)
CommentsList, reply, delete, hide/unhide, like/unlike
Direct messagesYes — text, media, reactions, private replies
Post chainsNo
FormatDescription
postFeed post (default)
reelFacebook Reel
storyFacebook Story

Every format requires a page_id — the Page to publish to. Fetch the IDs from placements.

ParameterTypeRequiredDescription
formatstringNo"post" (default)
first_commentstringNoComment added after publishing
page_idstringYesPage to publish to — fetch from placements
MediaMax sizeFormatsCountDuration
Image10 MBjpg, png, gif, webp10
Video4 GBmp4, mov11 s – 4 h
  • Text-only posts are allowed; media is optional.
  • Images and video cannot be mixed.
  • Minimum image dimensions: 200×200 px.
Terminal window
# Feed post with an image and a first comment
curl -X POST "https://api.postproxy.dev/api/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"post": { "body": "Exciting news! Check out our latest update." },
"profiles": ["prof_abc123"],
"media": ["https://example.com/image.jpg"],
"platforms": {
"facebook": {
"format": "post",
"first_comment": "What do you think? Let us know!",
"page_id": "123456789"
}
}
}'
ParameterTypeRequiredDescription
formatstringYes"reel"
titlestringNoTitle of the Reel
page_idstringYesPage to publish to — fetch from placements
MediaMax sizeFormatsCountDuration
Video300 MBmp4, mov13 s – 60 s
  • A video is required. Reels do not support a first comment.
Terminal window
# Reel
curl -X POST "https://api.postproxy.dev/api/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"post": { "body": "Behind the scenes 🎬" },
"profiles": ["prof_abc123"],
"media": ["https://example.com/video.mp4"],
"platforms": {
"facebook": { "format": "reel", "title": "Launch BTS", "page_id": "123456789" }
}
}'
ParameterTypeRequiredDescription
formatstringYes"story"
page_idstringYesPage to publish to — fetch from placements
MediaMax sizeFormatsCountDuration
Image10 MBjpg, png1
Video4 GBmp4, mov13 s – 60 s
  • Media is required; text captions are not supported.
  • Minimum dimensions: 500×500 px.
Terminal window
# Story (single image)
curl -X POST "https://api.postproxy.dev/api/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"post": {},
"profiles": ["prof_abc123"],
"media": ["https://example.com/story.jpg"],
"platforms": { "facebook": { "format": "story", "page_id": "123456789" } }
}'

A Facebook profile can manage several Pages. List them with the placements endpoint — each placement’s id is the page_id you pass when creating a post.

page_id is required on every post — there is no default Page, even when the profile has only one. Pass the id of the Page you want to publish to.

Terminal window
# List the Pages (placements) for a Facebook profile
curl "https://api.postproxy.dev/api/profiles/prof_abc123/placements" \
-H "Authorization: Bearer YOUR_API_KEY"

Facebook has the most complete Comments API support. All comment writes are asynchronous and need the profile_id query parameter.

ActionSupported
List / readYes
ReplyYes
DeleteYes
Hide / unhideYes
Like / unlikeYes
  • Comment attachments can carry photo, video, sticker, and share media.
  • Author metadata is available when Facebook returns it: is_verified_user, is_user_follow_business, is_business_follow_user, and follower_count.
Terminal window
# List comments on a post
curl "https://api.postproxy.dev/api/posts/post_abc123/comments?profile_id=prof_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
Terminal window
# Reply to a comment (omit parent_id to comment on the post itself)
curl -X POST "https://api.postproxy.dev/api/posts/post_abc123/comments?profile_id=prof_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "body": "Appreciate the feedback!", "parent_id": "cmt_abc123" }'
Terminal window
# Like / unlike a comment
curl -X POST "https://api.postproxy.dev/api/posts/post_abc123/comments/cmt_abc123/like?profile_id=prof_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
curl -X POST "https://api.postproxy.dev/api/posts/post_abc123/comments/cmt_abc123/unlike?profile_id=prof_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
Terminal window
# Hide / unhide a comment
curl -X POST "https://api.postproxy.dev/api/posts/post_abc123/comments/cmt_abc123/hide?profile_id=prof_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
curl -X POST "https://api.postproxy.dev/api/posts/post_abc123/comments/cmt_abc123/unhide?profile_id=prof_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
Terminal window
# Delete a comment
curl -X DELETE "https://api.postproxy.dev/api/posts/post_abc123/comments/cmt_abc123?profile_id=prof_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"

Facebook Messenger is supported through the Direct Messages API. Each send accepts either text or a single attachment.

CapabilitySupported
Send / receive textYes
AttachmentsYes — one per send
ReactionsYes — named reactions map to emoji (love → ❤, like → 👍, …)
Edit outbound messageNo
Delivery / read receiptsYes
Private reply to a commentYes
Inbound deliveryWebhook
  • 24-hour window. Free-form messages are only allowed within 24 hours of the participant’s last message. Sending outside the window is not supported.
  • Private replies DM a commenter directly, bypass the 24-hour window (up to 7 days), and are allowed once per comment.
  • Start a chat with the participant’s Page-scoped ID (PSID) as participant_external_id.
Terminal window
# Create or find a chat by PSID
curl -X POST "https://api.postproxy.dev/api/profiles/prof_abc123/chats" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "participant_external_id": "7000000000000000", "participant_name": "Jane Doe" }'
Terminal window
# Send a text message
curl -X POST "https://api.postproxy.dev/api/chats/chat_abc123/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "body": "Hi! How can we help?" }'
Terminal window
# Send a single media attachment
curl -X POST "https://api.postproxy.dev/api/chats/chat_abc123/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "media": ["https://example.com/receipt.pdf"] }'
Terminal window
# React to a message (named reaction -> emoji)
curl -X POST "https://api.postproxy.dev/api/messages/msg_abc123/react" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "reaction": "like" }'
Terminal window
# Private reply to a commenter (bypasses the 24h window, once per comment)
curl -X POST "https://api.postproxy.dev/api/posts/post_abc123/comments/cmt_abc123/private_reply?profile_id=prof_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "text": "Sent you a DM with the details!" }'

Subscribe with the Webhooks API. Create a subscription:

Terminal window
curl -X POST "https://api.postproxy.dev/api/webhooks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks/postproxy",
"events": ["platform_post.published", "comment.created", "message.received", "reaction.received"]
}'

Events relevant to Facebook:

EventWhen
post.processedA post is ready to publish
platform_post.publishedA post was published to the platform
platform_post.failedA post failed to publish (retries exhausted)
platform_post.failed_waiting_for_retryA publish attempt failed; will retry
platform_post.insightsNew analytics snapshot
comment.createdA comment was synced on a Facebook post
message.received / .sentInbound / outbound DM
message.delivered / .readDelivery and read receipts
message.editedAn inbound message was edited
reaction.receivedA reaction was added or removed on a message
profile.connected / .disconnectedConnection state changed
profile.statsNew profile stats snapshot (once per Page)
media.failedA media attachment failed to process

Facebook does not report message deletions — message.deleted only fires for Instagram.

  • Publishing targets a Facebook Page, not a personal profile.
  • page_id is required on every post; fetch it from placements.
  • Reels are video-only and capped at 60 seconds; Stories require 500×500 px media.