Platforms

Facebook

Publish text, link, photo and video posts, Reels and Stories to Facebook Pages.

Overview

The facebook platform publishes to Facebook Pages (not personal profiles). Every Page you grant during login becomes its own account in Relaycast. You can post:

  • Text posts, optionally with a link preview card
  • 1–10 photos
  • 1 video (with optional title and custom thumbnail)
  • Reels (one vertical video)
  • Stories (one photo or one video)
  • Unpublished Page posts (for ads, or to publish later in Meta Business Suite)

Connect the account

In Integrations, choose Facebook, log in, and select the Pages to connect.

App setup (self-hosted)

  1. Create a Meta app with the use case Manage everything on your Page (this adds Facebook Login).
  2. Add https://social-publish-kappa.vercel.app/api/integrations/facebook/callback to Facebook Login → Settings → Valid OAuth Redirect URIs (override with FACEBOOK_REDIRECT_URI).
  3. Set FACEBOOK_APP_ID and FACEBOOK_APP_SECRET. Optionally pin the Graph API version with META_GRAPH_VERSION.

Always requested: pages_show_list, pages_read_engagement, pages_manage_posts. Optional features request extra permissions only when their flag is set, because Meta rejects the whole login ("Invalid Scopes") when a requested permission isn't added to the app:

FlagAddsEnables
FACEBOOK_ENABLE_INBOX=truepages_messaging, pages_manage_metadataMessenger inbox
FACEBOOK_ENABLE_INSIGHTS=trueread_insightsImpressions, views and clicks in analytics
FACEBOOK_ENABLE_BUSINESS_MANAGEMENT=truebusiness_managementPages owned through a Business portfolio

pages_show_list, pages_read_engagement and pages_manage_posts need Advanced Access (App Review and Business Verification) before people without a role on the Meta app can connect.

Page tokens obtained this way don't expire. If one is invalidated (password change, app removed, Page role removed), the next publish marks the account reconnect_required.

Post types & media rules

Choose the post type with options.publishAs:

publishAsMediaNotes
feed (default)None, 1–10 photos, or 1 videoText-only posts can use link for a preview card
reelExactly 1 videoVertical (9:16) video, 3–90 seconds per Facebook's requirements
storyExactly 1 photo or 1 videoStories have no caption; video max 60 seconds per Facebook's requirements
RuleLimit
Text63,206 characters
Feed mediaPhotos or one video, not both; up to 10 photos
Feed post contentNeeds text, a link, or media
linkOnly used on text-only feed posts; ignored when media is attached
ThumbnailJPEG, PNG or GIF up to 10 MB; feed videos and Reels only
Video title255 characters; feed videos and Reels only
publishImmediately: falseFeed posts only; Reels and Stories always publish immediately

Reel and Story duration and aspect ratio are checked by Facebook during processing, not before the post is queued.

Options

OptionTypeRequiredDefaultDescription
publishAsfeed \story \reelNo
linkstring (URL)NoLink URL. When set on a text-only post, Facebook renders a link preview card from this URL's Open Graph tags. Ignored when media is attached. Only when publishAs is feed.
thumbnailstring (URL or media://)NoThumbnail. Custom cover for videos and reels. JPEG, PNG or GIF up to 10 MB, ideally the same aspect ratio as the video. Ignored for photos and text posts. Only when publishAs is feed or reel.
titlestringNoVideo title. Optional title for videos and reels. Only when publishAs is feed or reel.
publishImmediatelybooleanNotruePublish immediately. Turn off to create an unpublished Page post: it won't appear on your Page or in Feed, but can be used for ads or published later in Meta Business Suite. Stories and reels always publish immediately.
thumbnail accepts an http(s) URL or a media library reference (media://<id>).

Examples

Link post

curl -X POST https://social-publish-api.onrender.com/v1/posts \
  -H "x-access-key: $RELAYCAST_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "content": "Our 2026 product report is out.",
    "targets": [{
      "accountId": "9b2e4c61-3f7a-4d8e-b5c2-1a0f9e8d7c6b",
      "options": { "publishAs": "feed", "link": "https://example.com/report-2026" }
    }],
    "publishNow": true
  }'
const res = await fetch("https://social-publish-api.onrender.com/v1/posts", {
  method: "POST",
  headers: {
    "x-access-key": process.env.RELAYCAST_API_KEY!,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    content: "Our 2026 product report is out.",
    targets: [
      {
        accountId: "9b2e4c61-3f7a-4d8e-b5c2-1a0f9e8d7c6b",
        options: { publishAs: "feed", link: "https://example.com/report-2026" },
      },
    ],
    publishNow: true,
  }),
});
const { data } = await res.json();
import os, requests

res = requests.post(
    "https://social-publish-api.onrender.com/v1/posts",
    headers={"x-access-key": os.environ["RELAYCAST_API_KEY"]},
    json={
        "content": "Our 2026 product report is out.",
        "targets": [{
            "accountId": "9b2e4c61-3f7a-4d8e-b5c2-1a0f9e8d7c6b",
            "options": {"publishAs": "feed", "link": "https://example.com/report-2026"},
        }],
        "publishNow": True,
    },
)
data = res.json()["data"]

Reel with title and thumbnail

Request body
{
  "content": "60 seconds with our design team",
  "media": [{ "url": "https://cdn.example.com/design-team.mp4", "type": "video" }],
  "targets": [{
    "accountId": "9b2e4c61-3f7a-4d8e-b5c2-1a0f9e8d7c6b",
    "options": {
      "publishAs": "reel",
      "title": "Meet the design team",
      "thumbnail": "https://cdn.example.com/design-team-cover.jpg"
    }
  }],
  "scheduledFor": "2026-11-05T12:00:00Z"
}

Unpublished photo post

Request body
{
  "content": "Holiday sale creative",
  "media": [{ "url": "https://cdn.example.com/sale.jpg", "type": "image" }],
  "targets": [{
    "accountId": "9b2e4c61-3f7a-4d8e-b5c2-1a0f9e8d7c6b",
    "options": { "publishImmediately": false }
  }],
  "publishNow": true
}

Analytics & comments

  • Analytics: reactions (likes), comments and shares for every post. Impressions, views and clicks (and video/Reel play counts) come from Page insights and need FACEBOOK_ENABLE_INSIGHTS=true plus a reconnect.
  • Inbox: Messenger conversations for the Page, with FACEBOOK_ENABLE_INBOX=true. Meta only allows replies within 24 hours of the person's last message. See Inbox & Comment Automation.
  • Comment automations are not available for Facebook.

Limitations & common errors

ErrorCause
Facebook posts can have photos or one video, not bothMixed photos and video in a feed post.
Facebook posts allow up to 10 photosMore than 10 photos.
A Facebook post needs text, a link, or mediaEmpty feed post.
A Facebook reel needs exactly one videoReels take one video and no photos.
A Facebook story needs exactly one photo or one videoStories take a single item.
Facebook stories always publish immediately …publishImmediately: false on a Reel or Story.
Login fails with "Invalid Scopes"An optional flag is on but its permission isn't added to the Meta app.
Account becomes reconnect_requiredThe Page token was invalidated (Graph error 190). Reconnect from Integrations.
No Pages listed after loginPages owned through a Business portfolio need FACEBOOK_ENABLE_BUSINESS_MANAGEMENT=true.

This page is also available as Markdown.