Publish image or Reel to a Facebook Page
Creates a native photo, Reel, or text/link feed post 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 and Reels.linkstring URL, optional fallback formediaUrls.typestring, optional. UseIMAGEfor native Page photos,REELfor native Facebook Reels, orFEEDfor text/link posts. Default isIMAGEwhen media is present andFEEDfor text-only posts.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"
}
}