To automatically publish posts to a Facebook Page using the Graph API, you’ll need to follow a structured setup involving app creation, token generation, and API calls. Here's a complete guide tailored for your SaaS automation needs:


✅ 1. Create a Facebook Developer App

  • Go to

  • Click “My Apps” → “Create App”

  • Choose App Type: Business

  • Fill in app name, email, and (optional) business account

✅ 2. Add Required Permissions

In App Review → Permissions and Features, request:

  • pages_manage_posts

  • pages_read_engagement

  • pages_show_list

  • pages_manage_metadata

These allow your app to read, write, and manage posts on Facebook Pages.

✅ 3. Generate a Page Access Token

Use the or your app’s OAuth flow:

  • Authenticate as a user who is admin of the Page

  • Select your app and request the above permissions

  • Choose the Page → Click Generate Access Token

  • Save the token securely

✅ 4. Get Your Page ID

Visit your Page → About → Page Transparency → Copy the numeric Page ID Or use:

http
GET /me/accounts?access_token=USER_ACCESS_TOKEN

✅ 5. Make the POST Request

Use the following endpoint:

http
POST https://graph.facebook.com/v19.0/{page_id}/feed

Payload:

json
{
  "message": "Hello from GlowFlow!",
  "access_token": "PAGE_ACCESS_TOKEN"
}

You can also include:

  • link: for sharing URLs

  • picture: for image previews

  • scheduled_publish_time: for future posts (Unix timestamp)

  • published: false: to schedule instead of posting immediately

🧠 Pro Tips

  • Use Supabase Edge Functions or n8n to automate publishing

  • Store tokens securely and refresh them periodically

  • Use scheduled_publish_time to queue posts in advance