> For the complete documentation index, see [llms.txt](https://docs.fastn.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fastn.ai/connectors/catalog/social-media/facebook.md). Agents can also search and read this documentation through its [MCP server](https://docs.fastn.ai/~gitbook/mcp).

# Facebook

Facebook is a social network. Publish Page posts, photos and videos, manage comments, and read leads and insights.

![Facebook logo](https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-d9e6de3968393ea60a8fc091dcd9aa2a9d1a9f10%2Ffacebook.png?alt=media)

|                    |                                                                          |
| ------------------ | ------------------------------------------------------------------------ |
| **Category**       | [Social media](https://docs.fastn.ai/connectors/catalog/social-media.md) |
| **Website**        | [facebook.com](https://facebook.com)                                     |
| **Authentication** | OAuth 2.0                                                                |
| **Slug**           | `facebook`                                                               |
| **On fastn.ai**    | [Embed Facebook in your product](https://fastn.ai/integrations/facebook) |

## Setup

Your customers sign in to Facebook through Fastn's own OAuth app, so nothing needs setting up first. To show your own app on the consent screen instead, add your OAuth app on the connector's **Auth** tab under **Manage providers**.

## Connect in Fastn

Your customers connect Facebook from your widget. To connect an account yourself:

1. Go to **Build → Integrations → Connectors** and search for **Facebook**.
2. Select **Connect** on the Facebook card.

   <figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-586dd03cdc0c6904263f58928d7a531eae2f85df%2Fconnect-search.png?alt=media" alt="The Connectors page in Fastn with ServiceNow typed in the search box and the ServiceNow card showing a Connect button"><figcaption><p>Search for the connector, then select Connect on its card. ServiceNow is shown here.</p></figcaption></figure>
3. Keep the **Default** auth provider, or choose your own OAuth app if you added one. Pick the **Scopes** you need, select **Authorize**, then sign in to Facebook and approve access in the window that opens.

   <figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-0e2bbdd7109cec207402cf6883484b8525b7fbf5%2Fconnect-oauth.png?alt=media" alt="The Connect Salesforce dialog for OAuth 2.0 with the Default auth provider, an optional account name, the Scopes selector and an Authorize button"><figcaption><p>A connect form for OAuth 2.0. Salesforce is shown here.</p></figcaption></figure>
4. Check that the connection appears under **Operate → Connections** with the status `Active`. Your workflows can now use Facebook's actions.

For more detail, see [Connect an app](https://docs.fastn.ai/build/integrations/connectors/connect-an-app.md).

## Actions

<table><thead><tr><th width="240">Action</th><th width="260">Slug</th><th>What it does</th></tr></thead><tbody><tr><td>Create App Subscription</td><td><code>createAppSubscription</code></td><td>App-level webhook subscription for the 'page' object. Requires an app access token (appId|appSecret) passed as access_token.</td></tr><tr><td>Create Comment</td><td><code>createComment</code></td><td>Create a comment on an object, or reply to a comment by passing its id as objectId. Requires a Page access token.</td></tr><tr><td>Create Page Post</td><td><code>createPagePost</code></td><td>Publish a text (and optional link) post to a Page feed. Requires a Page access token (pass via pageAccessToken from listPages).</td></tr><tr><td>Delete Comment</td><td><code>deleteComment</code></td><td>Delete a comment on the Page's content Returns {success}.</td></tr><tr><td>Delete Photo or Video</td><td><code>deleteMediaObject</code></td><td>Delete a Page photo or video by id Returns {success}.</td></tr><tr><td>Delete Post</td><td><code>deletePost</code></td><td>Delete a Page post (or photo/video object) by id. Requires a Page access token.</td></tr><tr><td>Get Comment</td><td><code>getComment</code></td><td>Read one comment</td></tr><tr><td>Get Comments</td><td><code>getComments</code></td><td>Get comments on a post, photo, or other object.</td></tr><tr><td>Get Lead</td><td><code>getLead</code></td><td>Retrieve a single submitted lead by its leadgen id, including the answers the person entered. This is the follow-up call for a leadgen webhook notification, whose payload carries only the leadgen_id and no field data. Requires the leads_retrieval permission and a Page access token for the Page that owns the form.</td></tr><tr><td>Get Me</td><td><code>getMe</code></td><td>Get the authenticated user's basic profile.</td></tr></tbody></table>

<details>

<summary>View 27 more actions</summary>

<table><thead><tr><th width="240">Action</th><th width="260">Slug</th><th>What it does</th></tr></thead><tbody><tr><td>Get Page</td><td><code>getPage</code></td><td>Get details for a Facebook Page by id.</td></tr><tr><td>Get Page Feed</td><td><code>getPageFeed</code></td><td>Get posts from a Page feed.</td></tr><tr><td>Get Page Insights</td><td><code>getPageInsights</code></td><td>Get insights/analytics metrics for a Page.</td></tr><tr><td>Get Post</td><td><code>getPost</code></td><td>Read one Page post</td></tr><tr><td>Get Post Insights</td><td><code>getPostInsights</code></td><td>Metrics for one Page post, e.g. post_impressions, post_clicks, post_reactions_by_type_total.</td></tr><tr><td>Get Video</td><td><code>getVideo</code></td><td>Read one Page video including processing status</td></tr><tr><td>Hide Comment</td><td><code>hideComment</code></td><td>Hide or unhide a comment on the Page's content Returns {success}.</td></tr><tr><td>Like Object</td><td><code>likeObject</code></td><td>Like a post or comment as the Page Returns {success}.</td></tr><tr><td>List Albums</td><td><code>listAlbums</code></td><td>List the Page's photo albums</td></tr><tr><td>List App Subscriptions</td><td><code>listAppSubscriptions</code></td><td>List the app's current webhook subscriptions. Requires an app access token.</td></tr><tr><td>List Form Leads</td><td><code>listFormLeads</code></td><td>List all leads submitted through a specific Lead Ads form, newest first, with the answers each person entered. Use this to backfill leads or to recover any the webhook missed. Requires the leads_retrieval permission and a Page access token for the Page that owns the form.</td></tr><tr><td>List Granted Permissions</td><td><code>listPermissions</code></td><td>List the permissions the connected user has granted or declined for this app. Each entry has a permission name and a status of granted or declined. Use it to verify a connection carries the scopes an action needs before calling it.</td></tr><tr><td>List Lead Forms</td><td><code>listLeadForms</code></td><td>List the Lead Ads instant forms attached to a Facebook Page. Returns each form's id, name, status and questions. Use the returned form id with List Form Leads. Requires a Page access token plus the pages_manage_ads or leads_retrieval permission.</td></tr><tr><td>List Managed Pages</td><td><code>listPages</code></td><td>List the Facebook Pages the authenticated user manages. Each entry includes the Page access_token needed for publishing/engagement actions.</td></tr><tr><td>List Page Photos</td><td><code>listPagePhotos</code></td><td>List photos uploaded by the Page</td></tr><tr><td>List Page Ratings</td><td><code>listPageRatings</code></td><td>List recommendations/reviews left on the Page</td></tr><tr><td>List Page Videos</td><td><code>listPageVideos</code></td><td>List videos uploaded by the Page</td></tr><tr><td>List Pages For Trigger</td><td><code>listPagesForTrigger</code></td><td>Lists the Facebook Pages the connected user manages, returning only each Page's id and name (no Page access tokens). Used by app triggers to let the user pick which Page's events to receive.</td></tr><tr><td>List Published Posts</td><td><code>listPublishedPosts</code></td><td>List posts published by the Page</td></tr><tr><td>List Scheduled Posts</td><td><code>listScheduledPosts</code></td><td>List the Page's scheduled (not yet published) posts</td></tr><tr><td>Publish Photo</td><td><code>publishPhoto</code></td><td>Publish a photo to a Page from a hosted image URL. Requires a Page access token.</td></tr><tr><td>Publish Video</td><td><code>publishVideo</code></td><td>Publish a video to a Page from a hosted file URL. Requires a Page access token.</td></tr><tr><td>Subscribe Page App</td><td><code>subscribePageApp</code></td><td>Install/subscribe the app on a Page so it receives webhook notifications. Requires a Page access token.</td></tr><tr><td>Unlike Object</td><td><code>unlikeObject</code></td><td>Remove the Page's like from a post or comment Returns {success}.</td></tr><tr><td>Unsubscribe Page App</td><td><code>unsubscribePageApp</code></td><td>Uninstall/unsubscribe the app from a Page. Requires a Page access token.</td></tr><tr><td>Update Comment</td><td><code>updateComment</code></td><td>Edit a comment the Page wrote message). Returns {success}.</td></tr><tr><td>Update Post</td><td><code>updatePost</code></td><td>Edit the text of a Page post message). Returns {success}.</td></tr></tbody></table>

</details>

## Events

Start a workflow when one of these happens, with an [app event trigger](https://docs.fastn.ai/build/integrations/triggers.md).

<table><thead><tr><th width="240">Event</th><th width="260">Id</th><th>When it fires</th></tr></thead><tbody><tr><td>Lead Submitted</td><td><code>leadgen</code></td><td>Fires when someone submits one of the Page's Lead Ads instant forms. The payload carries only leadgen_id - call Get Lead with it to retrieve the submitted answers. Setup: Meta app console > Products > Webhooks > Page > Subscribe to this object, tick the leadgen field, paste this connector's webhook URL, and use the connector's verification secret as the verify token. Then run Subscribe Page App on each customer Page with subscribed_fields including leadgen.</td></tr><tr><td>Page Feed Activity</td><td><code>feed</code></td><td>Fires on activity in the Page feed - a new post, comment, reaction, share or edit. Setup: Meta app console > Products > Webhooks > Page > Subscribe to this object, tick the feed field, paste this connector's webhook URL, and use the connector's verification secret as the verify token. Then run Subscribe Page App on each customer Page with subscribed_fields including feed.</td></tr><tr><td>Page Mentioned</td><td><code>mention</code></td><td>Fires when the Page is mentioned in another person's or Page's post or comment. Setup: Meta app console > Products > Webhooks > Page > Subscribe to this object, tick the mention field, paste this connector's webhook URL, and use the connector's verification secret as the verify token. Then run Subscribe Page App on each customer Page with subscribed_fields including mention.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fastn.ai/connectors/catalog/social-media/facebook.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
