Taskwind
Start free trial

Facebook posting API: publish to Pages with the Graph API

By Natnael Girma · Published

The Facebook posting API is the Pages API, a set of Graph API endpoints. To publish, you get a Page access token for a Page the user manages, then call POST /{page-id}/feed for text and links, /{page-id}/photos for images and /{page-id}/videos for video. It only posts to Pages. Personal profiles and groups have had no publishing API for years, and every permission you need goes through Meta's App Review before people outside your app can use it.

Everything below follows Meta's Pages API docs as of December 2026, where the latest Graph API version is v27.0.

What you can and cannot post to

Destination Can you publish through the API? Why
Facebook Page Yes The Pages API, with a Page access token
Personal profile No Meta deprecated publish_actions, the permission that let apps post as a user, starting August 1, 2018
Group No Meta deprecated the Groups API in v19 and removed it from all versions 90 days later, including publish_to_groups

If a tool says it posts to personal profiles or groups, ask how, because no official API does it today.

What you need

  1. A Meta app with the "Manage everything on your Page" use case. It adds business_management, pages_show_list and public_profile by default (create an app).
  2. A Page where the signed-in person can perform the CREATE_CONTENT task. A Page admin can perform every task.
  3. These permissions, granted through Facebook Login or Facebook Login for Business:
Permission Used for
pages_show_list Listing the Pages a person manages (/me/accounts)
pages_manage_posts Creating, editing and deleting Page posts
pages_read_engagement Reading Page content, required alongside pages_manage_posts
business_management Seeing Pages owned by a business portfolio
publish_video Publishing video, per the posts guide
  1. App Review for each permission, plus a published app, before anyone without a role on your app can grant them. In development mode you can request any permission from people who have a role on the app, which is enough to build and test (overview).

If you are building a product that manages other businesses' Pages, Meta also asks you to become a Tech Provider, which requires Business Verification.

Step 1: Get a Page access token

Three tokens are involved, which is where most of the confusion comes from. The flow is user token, then long-lived user token, then Page token.

Exchange the short-lived user token from Facebook Login for a long-lived one (about 60 days) on your server:

curl -i -X GET "https://graph.facebook.com/v27.0/oauth/access_token?grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-user-token}"

Then list the person's Pages with that token:

curl -i -X GET "https://graph.facebook.com/v27.0/me/accounts?fields=id,name,access_token,tasks&access_token={long-lived-user-token}"

Each Page in the response has its own access_token. Because you asked with a long-lived user token, these Page tokens have no expiration date. They can still be invalidated in certain cases that Meta lists in its token docs, so when a call fails with a token error, ask the person to reconnect. Store one token per Page and use it for every call to that Page.

Step 2: Publish a text or link post

curl -X POST "https://graph.facebook.com/v27.0/{page-id}/feed" \
  -H "Content-Type: application/json" \
  -d '{
        "message": "We are open late on Friday.",
        "link": "https://example.com/hours",
        "access_token": "{page-access-token}"
      }'

The response is {"id": "{page-id}_{post-id}"}, and the post lives at https://www.facebook.com/{page_post_id}. Either message or link is required. With a link, Facebook reads the page's Open Graph tags to build the preview card, and the feed reference notes the post fails if Facebook cannot see the URL.

Step 3: Post a photo

Send a public image URL to /photos. Facebook downloads it and creates the post:

curl -X POST "https://graph.facebook.com/v27.0/{page-id}/photos" \
  -F "url=https://example.com/menu.jpg" \
  -F "message=New autumn menu" \
  -F "access_token={page-access-token}"

You get back both a photo id and a post_id. The photos reference accepts JPEG, BMP, PNG, GIF and TIFF up to 10 MB, and recommends keeping PNGs under 1 MB.

Step 4: Post several photos in one post

There is no single multi-photo call. Upload each photo unpublished, then attach the IDs to a feed post:

# Repeat for each photo and keep each returned id
curl -X POST "https://graph.facebook.com/v27.0/{page-id}/photos" \
  -F "url=https://example.com/1.jpg" \
  -F "published=false" \
  -F "access_token={page-access-token}"

# Then publish one post with all of them
curl -X POST "https://graph.facebook.com/v27.0/{page-id}/feed" \
  -F "message=Three shots from the launch" \
  -F 'attached_media[0]={"media_fbid":"{photo-id-1}"}' \
  -F 'attached_media[1]={"media_fbid":"{photo-id-2}"}' \
  -F 'attached_media[2]={"media_fbid":"{photo-id-3}"}' \
  -F "access_token={page-access-token}"

Meta deletes unpublished photos that are not used within 24 hours. If the photos belong to a scheduled post, upload them with temporary=true instead.

Step 5: Post a video

The simplest call passes a public URL to /videos:

curl -X POST "https://graph-video.facebook.com/v27.0/{page-id}/videos" \
  -F "file_url=https://example.com/clip.mp4" \
  -F "description=Thirty seconds in the kitchen" \
  -F "access_token={page-access-token}"

For large files, Meta's Video API guide uses the Resumable Upload API. You start a session with POST /{app-id}/uploads (file name, length and type), send the bytes to upload:{session-id} with a file_offset header, and publish the returned file handle with fbuploader_video_file_chunk. If the connection drops, a GET on the session tells you the offset to resume from. Reels use a separate Reels publishing flow.

Step 6: Schedule a post

Set published to false and add scheduled_publish_time as a Unix timestamp in seconds, an ISO 8601 string or a relative string such as tomorrow:

curl -X POST "https://graph.facebook.com/v27.0/{page-id}/feed" \
  -H "Content-Type: application/json" \
  -d '{
        "message": "Doors open at 9.",
        "published": false,
        "scheduled_publish_time": 1798000000,
        "access_token": "{page-access-token}"
      }'

Meta's own pages disagree on the window. The posts guide says between 10 minutes and 30 days ahead, the feed reference says up to 75 days, and the videos reference allows video up to 6 months out. Stay within 30 days for feed posts and you are safe under every version of the rule. If you use relative strings, read the post back to confirm the time Meta stored.

Edit and delete

Rate limits

Calls made with a Page token count against Meta's Business Use Case limit for that Page. The rate limiting docs give the formula as calls within 24 hours = 4,800 × the number of engaged users (people who engaged with the Page in the last 24 hours).

A worked example: a small Page with 50 engaged users in the last day gets 4,800 × 50 = 240,000 calls in 24 hours. Publishing a three-photo post costs four calls (three uploads and one feed post), so ordinary publishing will not get close. Bulk reads and polling are what hit the limit. Check the X-Business-Use-Case-Usage header on responses to see how close you are.

Facebook API pricing

Meta publishes no price for the Pages API. There is no pricing page and no per-call fee anywhere in its documentation. You pay in time instead: building the login flow, App Review for each permission, and Business Verification if you serve other businesses. Your own costs are hosting media at public URLs and running whatever stores and fires scheduled jobs, if you do not use scheduled_publish_time.

A third-party posting API flips this. You pay the vendor, and the vendor runs the Meta app, the login flow and the review process.

Common errors

Error Cause Fix
190 with subcode 2069032 You used a user token where a Page token is required Fetch the Page token from /me/accounts and use it
1 with subcode 2853006 The person cannot perform the needed task on the Page Ask a Page admin to give them the right access
200 with subcode 2069030 or 2069031 Endpoint or field not supported Check the field names against the reference for your API version
Permission error for someone outside your app Permission not yet approved in App Review Add them as a tester, or finish App Review
80001 Business Use Case rate limit reached for the Page Back off and check X-Business-Use-Case-Usage
4, 17, 32 App, user or user-token Pages rate limits Slow down; use Page tokens for Page calls
Page missing from /me/accounts Page owned by a business portfolio Request business_management

The Pages API error codes page lists more, mostly for insights and ads.

What we ran into building this

Taskwind's Facebook connector runs these calls in production. A few things the docs do not make obvious:

The same post through Taskwind

With Taskwind, you connect a Page once with Facebook's official login, and Taskwind stores the Page token and makes the Graph API calls. You post with an API key. Upload media first if there is any:

curl -X POST https://taskwind.ai/v1/media \
  -H "Authorization: Bearer $TASKWIND_API_KEY" \
  -H "Content-Type: image/jpeg" \
  --data-binary @menu.jpg

Then publish, or add scheduled_at (Unix seconds) to schedule. Several media_ids become one multi-photo post:

curl -X POST https://taskwind.ai/v1/posts \
  -H "Authorization: Bearer $TASKWIND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content":"New autumn menu","account_ids":["acc_..."],"media_ids":["med_..."],"scheduled_at":1798000000}'

The response includes a targets array with each account's status, link and error. The same request can go to Instagram, LinkedIn and other connected accounts. See the REST API docs.

On Facebook, Taskwind supports Pages only, with text, images and video up to 63,206 characters, plus editing the text of published posts. It also handles Page comments and the Messenger inbox. It does not post to profiles or groups (no official API can), does not publish Stories or Reels as a separate format, and has no analytics yet. Plans start at $49/month with a 7-day trial (pricing). For the same job across every network, see the social media posting API guide.

Questions

Can I post to a Facebook Page I don't manage?

No. Publishing needs a Page access token from someone who can perform the CREATE_CONTENT task on that Page, so a Page admin has to connect it to your app.

Can I reply to comments on my Page posts with the API?

Yes. Send a POST to /{page-post-id}/comments with a message, using a Page token with pages_manage_engagement, pages_read_engagement and pages_read_user_engagement. The comment appears as the Page.

Can I post to Instagram with the same Facebook app?

Yes, one Meta app can hold several use cases, but Instagram publishing uses its own endpoints and permissions. Our Instagram API guide covers that flow.