Publish image, Reel, feed post, or Story to a Facebook Page
Creates a native photo, Reel, text/link feed post, or Page Story on a connected Facebook Page for the API key owner. Pass pageId for a specific Page, or omit it to use the default configured Page.
textormessagestring, optional if a media URL or link is present.mediaUrlsarray or string URL, optional for feed posts. Required for images, Reels, and Stories.linkstring URL, optional fallback formediaUrls.typestring, optional. UseIMAGEfor native Page photos,REELfor native Facebook Reels,FEEDfor text/link posts, orSTORIES(aliasSTORY) for Page Stories. Image vs video Stories is inferred from the media URL. Default isIMAGEwhen media is present andFEEDfor text-only posts. Stories requireMETA_STORIES_ENABLED=trueon the server.pageIdstring, optional connected Facebook Page ID.proxyDownloadboolean, optional. Whentrue, Postifys downloads the media to a temporary file first. Images are published through a short-lived Postifys URL. Reels are uploaded to Meta using the Facebook Reels API. Temp files are deleted after publish. Automatically enabled for Google Drive and Dropbox links.
curl -X POST https://postifys.com/api/facebook/post \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"text": "New image from Postifys API",
"type": "IMAGE",
"mediaUrls": ["https://example.com/image.jpg"],
"pageId": "FACEBOOK_PAGE_ID"
}'
const response = await fetch("/api/facebook/post", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
body: JSON.stringify({
text: "New Reel from Postifys API",
type: "REEL",
mediaUrls: ["https://example.com/reel.mp4"],
pageId: "FACEBOOK_PAGE_ID"
})
});
const result = await response.json();
{
"success": true,
"historyId": "post_abc123",
"data": {
"id": "PAGE_ID_POST_ID"
}
}