Facebook

Facebook API: Post to a Page

How to publish text, image, and video posts to a Facebook Page via API.

Quick answer

Directly on Meta's Graph API you pick an endpoint per media type — /{page-id}/feed for text, /photos for a single image, /videos for a single video, or an unpublished-photo-then-attach flow for multi-image posts. Through PostGate it's one POST /api/posts with body, connected profile IDs, and media; PostGate routes to the right Graph edge. Requires a Page access token with pages_manage_posts and a reviewed Meta app.

Posting to a Facebook Page through Meta's Graph API means choosing between a handful of different endpoints depending on what you're publishing: /{page-id}/feed for text, /{page-id}/photos for a single image, /{page-id}/videos for a single video, or an unpublished-photo-then-attach dance for a multi-image post. Get the branch wrong — say, attach a video the same way you attach photos — and the call fails.

PostGate collapses all of that into one request: POST /api/posts. You send a body, a list of connected profile IDs, and media — PostGate figures out which underlying Graph edge to call. It's the same envelope used for Instagram, LinkedIn, and every other platform, so a Facebook Page is just one more target, not a special case in your integration.

01

One request, whatever the media

You don't pick a mode. Pass profiles and media and PostGate routes for you: a lone video goes to the video endpoint, a lone photo to the photo endpoint, several photos get uploaded unpublished and attached to a feed post, and text-only content posts straight to the feed. This matters because Facebook itself won't let you mix a video with photos in the same post — the Graph API has no endpoint for that combination, so PostGate won't either.
Publish a photo post to a PagePostGate API
curl -X POST "https://postgate.studio/api/posts?profile_group_id=grp_acme123" \
  -H "Authorization: Bearer $POSTGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: launch-post-001" \
  -d '{
    "post": { "body": "Launch day. 🚀" },
    "profiles": ["pro_facebook789"],
    "media": ["https://cdn.example.com/launch.jpg"]
  }'
02

What does Facebook require from the caller?

The connected account needs a Page access token with an admin-equivalent task on the Page (or the pages_manage_posts scope), and the calling app needs to have passed Meta App Review and Business Verification for that permission to work for anyone outside people with a role on the app. PostGate marks Facebook publishing approval_required for exactly this reason — see Facebook Page access token for how the token itself is obtained and kept alive.
03

What are the text and media limits?

A Facebook Page post body allows up to 63,206 characters and links inside the text are fine. A post can carry up to 10 media items, images up to 10 MB, and video up to 4 GB and roughly 4 hours long — though as noted above, a single post is either all photos or one video, never both. See Media for how PostGate ingests a URL, a file, or a large upload before attaching it.
04

How do you read what actually happened?

The create response is acceptance, not proof of publication — delivery to Facebook happens asynchronously. Read the target on GET /api/posts/{id} for its status and permalink, or subscribe to a webhook instead of polling. If Meta throttles the call, PostGate surfaces that as a retryable rate_limited or platform_transient error — see Facebook API rate limit for what actually trips that.

Frequently asked questions

Which Graph API endpoint posts to a Facebook Page?

It depends on the content: /{page-id}/feed for text, /{page-id}/photos for a single image, /{page-id}/videos for a single video, and an unpublished-photo-then-attach flow for a multi-image post. Get the branch wrong — attaching a video the way you attach photos, say — and the call fails. PostGate routes to the correct edge automatically based on what media you pass.

Can I mix photos and a video in one Facebook post?

No. Facebook itself won’t let you combine a video with photos in the same post — the Graph API has no endpoint for that combination, so PostGate doesn’t offer it either. A single post is either all photos or one video, never both.

What are the Facebook Page post limits?

The post body allows up to 63,206 characters, and links inside the text are fine. A post can carry up to 10 media items, images up to 10 MB each, and video up to 4 GB and roughly 4 hours long — with the caveat that a single post is either all photos or one video.

What permissions do I need to post to a Facebook Page via API?

The connected account needs a Page access token with an admin-equivalent task on the Page (or the pages_manage_posts scope), and the calling app must have passed Meta App Review and Business Verification for that permission to work for anyone outside people with a role on the app. PostGate marks Facebook publishing approval_required for exactly this reason.

How do I know a Facebook post actually published?

The create response is acceptance, not proof of publication — delivery happens asynchronously. Read the target on GET /api/posts/{id} for its status and permalink, or subscribe to a webhook instead of polling. If Meta throttles the call, PostGate surfaces that as a retryable rate_limited or platform_transient error.

Build it with PostGate

One API for every social platform your customers care about — sandboxed, documented, and ready today.

Start building Read the docs