canonical: https://jentic.com/apis/facebook.com/facebook

# Facebook Graph API

Jentic publishes the only available OpenAPI specification for Facebook Graph API, keeping it validated and agent-ready. Read and write to the Facebook social graph through 24 endpoints covering user profiles, pages, posts, photos, albums, videos, comments, and friend connections. Supports OAuth 2.0 with granular permission scopes for accessing user data, publishing content to timelines and pages, and moderating comments and likes.

## For AI agents

Read user profiles, publish posts, retrieve photos and videos, and moderate comments on the Facebook social graph. Covers 24 endpoints for user content and page management.

## Scope

Does not handle Facebook Ads, Messenger Platform chatbots, or Instagram content - use for Graph API social graph reads and page publishing only.

## Capabilities

- Retrieve authenticated user profile data including name, email, and friend connections
- Publish text posts, links, and media to user timelines and managed pages
- Fetch photo albums and individual photos with metadata and engagement counts
- List and moderate comments on posts including reply threading
- Query page insights and manage page publishing permissions
- Retrieve video uploads with thumbnails, view counts, and associated comments
- Inspect OAuth token validity and granted permission scopes via debug_token

## Use cases

### AI Agent Page Management

An AI agent publishes scheduled content to a Facebook Page by calling POST /{page-id}/feed with a message and optional link attachment. Through Jentic, the agent discovers the page publishing operation by searching 'post to facebook page', loads the request schema including required page access token and message fields, and executes without manual Graph API setup. Handles page post creation, comment moderation, and engagement tracking in a single workflow.

Example prompt: Publish a post with message 'New product launch today!' to page-id 123456 via POST /{page-id}/feed and confirm the returned post ID

### User Profile and Social Graph Access

Access authenticated user profile data through the /me endpoint including name, email, profile picture, and friend connections. The Graph API returns structured JSON with only the fields requested via the fields parameter, reducing payload size. Supports accessing other users' public profiles via /{user-id} when appropriate permissions are granted.

Example prompt: Retrieve the authenticated user's name, email, and friend count via GET /me?fields=name,email,friends and return the structured profile data

### Content Moderation and Engagement

Monitor and moderate comments on posts using GET /{post-id}/comments and DELETE /{post-id}/comments/{comment-id}. Track engagement metrics through GET /{post-id}/likes for like counts and user details. Enables automated content moderation workflows that flag or remove inappropriate comments on page posts within seconds of posting.

Example prompt: Retrieve all comments on post-id 789 via GET /{post-id}/comments, filter for comments containing profanity, and delete flagged comments via DELETE endpoint

### Photo and Media Management

Upload photos and videos to user profiles or pages, retrieve album contents with metadata, and access media engagement data. The /{user-id}/photos endpoint returns uploaded photos with creation timestamps, dimensions, and associated comments. Albums are accessible through /{user-id}/albums with full photo enumeration support.

Example prompt: Retrieve all photo URLs from a user's albums via GET /{user-id}/albums followed by GET /{album-id}/photos for each album

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /me | Retrieve authenticated user's profile |
| GET | /{user-id}/feed | Get posts from a user's timeline |
| POST | /{user-id}/feed | Publish a post to a user or page timeline |
| GET | /{post-id}/comments | List comments on a post |
| GET | /{post-id}/likes | Get likes on a post |
| GET | /{user-id}/photos | Retrieve user's uploaded photos |
| GET | /debug_token | Inspect an access token's metadata |

## Key resources

- **Users** — Retrieve profiles, friend lists, permissions, and account information
- **Posts** — Publish, retrieve, and delete timeline posts with engagement data
- **Comments** — List, create, and delete comments on posts
- **Photos** — Upload and retrieve photos with albums and metadata
- **Pages** — Access and manage Facebook Pages including feed publishing
- **Videos** — Upload and retrieve video content with view counts

## Why Jentic

- **Setup:** Wiring the Facebook Graph API by hand means running its OAuth 2.0 flow, requesting the right permission scopes, targeting the graph.facebook.com/v18.0 host, and handling token debugging yourself. Through Jentic you install once, import the Facebook Graph API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** The Graph API puts the target id in the URL path (/{page-id}/feed, /{user-id}/photos), so a rule can pin your agent to one page or user: it can read the feed and publish there and nothing else. You choose the operations it may call, so reads across other users' photos or albums are not included unless you add them.
- **Credential handling:** Your Facebook OAuth 2.0 token, scoped to only the permissions you grant, is stored once, encrypted, by your own Jentic One instance and injected at execution time. The app secret and long-lived tokens never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'post to a Facebook page' or 'read a post's comments', and Jentic returns the matching /{page-id}/feed operation with its request schema so the agent calls the right endpoint without reading Meta's documentation.

## Related APIs

- **Instagram API** — Photo and video sharing platform owned by Meta, often used alongside Facebook for cross-platform social publishing
- **Twitter API v2** — Real-time public conversation platform with tweet search and streaming instead of social graph traversal
- **Buffer API** — Social media scheduling tool for queuing posts to Facebook and other platforms from a single interface

## FAQ

### Why is there no official OpenAPI spec for Facebook Graph API?

Meta does not publish an OpenAPI specification for the Graph API. Jentic generates and maintains this spec so that AI agents and developers can call Facebook Graph API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Facebook Graph API use?

The Graph API uses OAuth 2.0 with permission-based access tokens. User access tokens grant permissions like user_posts, user_photos, and user_friends. Page access tokens require pages_manage_posts and pages_read_engagement. Through Jentic, these OAuth tokens are stored encrypted in your Jentic One instance and agents receive scoped tokens without handling raw app secrets.

### Can I publish posts to a Facebook Page through this API?

Yes. Use POST /{page-id}/feed with a valid Page access token that has the pages_manage_posts permission. Include the message field for text content and optionally link or media attachments. The endpoint returns the created post's ID on success.

### What are the rate limits for the Facebook Graph API?

The Graph API uses application-level rate limiting. Each app gets 200 calls per user per hour for user-token requests. Page-token requests are limited to 4800 calls per app per hour per page. Rate limit headers (x-app-usage, x-page-usage) are returned with each response indicating current utilization percentage.

### How do I retrieve user posts and comments through Jentic?

Install the Jentic SDK with pip install jentic, then search for 'get facebook user feed' to discover the GET /{user-id}/feed operation. Jentic returns the endpoint schema with supported fields parameter options. For comments, search 'list comments on a facebook post' to load the GET /{post-id}/comments schema. Get started with Jentic One, the self-hosted execution layer.

### Can I access friend lists and social connections?

The GET /{user-id}/friends endpoint returns friends who also use your app, not the complete friend list (restricted since Graph API v2.0). The response includes friend user IDs and names. Use the fields parameter to request additional profile data for each friend within a single request via field expansion.

### How do I verify an access token's permissions?

Use the GET /debug_token endpoint with input_token parameter set to the token you want to inspect. The response includes the app_id, user_id, granted scopes, expiration time, and validity status. This is essential for verifying token permissions before making requests that require specific scopes.

### Can I limit what my agent is allowed to do with the Facebook Graph API?

Yes. Because the Graph API carries the target id in the URL path (POST /{page-id}/feed, GET /{user-id}/photos), your self-hosted Jentic One instance lets you write rules that pin the agent to a single page or user, so it can read that feed and publish there and nothing else. You decide which operations it may call, meaning reads across other users' photos, albums, or comments stay off limits unless you add them. The OAuth token is scoped to only the permissions you grant and injected at execution time by your own instance, so your rules, not the agent, control what it can reach.
