Facebook

Facebook Posting API

A posting API for Facebook Pages, with the same envelope used for Instagram and Threads.

Quick answer

A full Facebook posting integration is four pieces: POST /api/profiles/connect gives you a hosted URL to link a Page without ever seeing its access token; POST /api/posts publishes now, as a draft, at a fixed scheduled_at, or via a recurring queue; media is validated before it reaches Meta; and delivery is confirmed per target through webhooks or polling.

"A Facebook posting API" usually means more than the one call that creates a post. A real integration also needs to connect a Page without ever touching its access token, attach media that's validated before it reaches Meta, decide between publishing now, later, or on a recurring schedule, and find out — reliably — whether delivery actually succeeded.

PostGate covers that whole surface for Facebook Pages with the same request shapes it uses for Instagram, LinkedIn, Threads, and seven other platforms. This page is the map; the other Facebook how-to guides go deep on each piece.

01

How do you connect a Page without seeing its token?

POST /api/profiles/connect creates a short-lived hosted URL (it expires after 15 minutes). Redirect your customer's browser to it; they authorize the Page on Meta's own domain and land back on your return_url. PostGate stores and refreshes the resulting Page access token — your product never receives it. See Facebook Page access token for what that token actually is.
Create a connection URLPostGate API
curl -X POST https://postgate.studio/api/profiles/connect \
  -H "Authorization: Bearer $POSTGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "facebook",
    "profile_group_id": "grp_acme123",
    "return_url": "https://app.example.com/settings/social"
  }'
02

One endpoint, four publishing modes

POST /api/posts with no timing field publishes immediately. Add draft: true to save it for approval, an ISO 8601 scheduled_at to fire at a fixed instant, or scheduled_at: "queue" to take the next open recurring slot. It's the same request body every time — see Facebook Scheduling API and Facebook API: Post to a Page for each in detail.
03

How is media validated before it reaches Meta?

Attach a public URL, a base64 data URL, or a pre-uploaded media ID. PostGate fetches the asset, detects its real MIME type, probes dimensions and duration, and revalidates it again at scheduled publish time — so a broken link surfaces as a clear error, not a Graph API 400 you have to decode. Large or reusable video goes through Facebook Graph API video upload.
04

Delivery is asynchronous — observe it, don't assume it

The create response is acceptance. Each destination in targets moves through its own lifecycle — pending, publishing, then a terminal published, failed, or skipped. Subscribe to webhooks for normal operation, or poll GET /api/posts/{id} with backoff. Throttling from Meta comes back as a retryable error — see Facebook API rate limit.
05

What about formats beyond a plain feed post?

A vertical short-form video is a Reels question, not a different endpoint. Both use the same POST /api/posts call; what changes is the media you send.

Frequently asked questions

How do I connect a Facebook Page without handling its access token?

POST /api/profiles/connect creates a short-lived hosted URL — it expires after 15 minutes. Redirect your customer’s browser to it; they authorize the Page on Meta’s own domain and land back on your return_url. PostGate stores and refreshes the resulting Page access token server-side, and your product never receives it.

What publishing modes does the Facebook posting API support?

Four, all through the same POST /api/posts request body: no timing field publishes immediately; draft: true saves the post for approval; an ISO 8601 scheduled_at fires at a fixed instant; and scheduled_at: "queue" takes the next open slot on a recurring schedule.

How is media validated before it reaches Facebook?

Attach a public URL, a base64 data URL, or a pre-uploaded media ID. PostGate fetches the asset, detects its real MIME type, probes dimensions and duration, and revalidates it again at scheduled publish time — so a broken link surfaces as a clear error on your request, not a Graph API 400 you have to decode after the fact.

Do Facebook Reels need a different endpoint through PostGate?

No. A vertical short-form video is a Reels question, not a different endpoint — both use the same POST /api/posts call, and what changes is the media you send. Delivery still resolves per target through the same lifecycle: pending, publishing, then published, failed, or skipped.

Build it with PostGate

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

Start building Read the docs