The Pages API is a set of Facebook Graph API endpoints that apps can use to create and manage a Page's settings and content. If you are unfamiliar with the Graph API, please read our Graph API documentation before proceeding.
API authentication is handled through Access Tokens. Most endpoints require Page access tokens, which are unique to each Page, app User, and app, and have an expiration time. In order to get a token from an app User, the app User must own or be able to perform a Task on the Page.
You can get access tokens from your app Users by implementing Facebook Login.
Most endpoints require one or more permissions which must be granted by your app Users through the use of Facebook Login. All Page permissions require App Review before your app can use them to access in.
You will need to request access through App Review if:
pages_show_listpermission for the first time.
pages_show_listpermission within the last 90 days.
If your app has previously been approved for any of the following permissions through App Review no action is required:
Some endpoints require a Feature which must be approved through the App Review process before your app can use them in Live Mode. Features allow you to access public Page data without a permission or the ability to perform a task on the Page. Refer to each endpoint's reference to determine which Page Feature it requires.
Tasks allow Users to perform specific actions on a Page. When a User uses an app to interact with a Page, depending on the attempted action, we will first check if the User has been approved for a task that permits that type of action.
Users who interact with Pages are identified by Page-Scoped User IDs (PSID). PSIDs are IDs that are unique to each User-Page pair. Pages API and Messenger API endpoints rely on PSIDs, so you can use a PSID to identify a User's interactions with a Page, as well as the User's public Messenger conversations with that Page.
App-Scoped User IDs
Before May 1, 2018, Pages API endpoints relied on App-Scoped User IDs (ASID). Apps created before this date continued receiving ASIDs in endpoint responses, unless an app admin used the App Dashboard to opt-in to receive PSIDs. Starting with v7.0+, Pages API endpoints will only accept and return PSIDs for all apps, regardless of their creation date. This change will also be applied to all API versions on May 5th, 2021.
The Page-Scoped ID API allows you to map ASIDs to their PSID equivalents. The API is deprecated in v7.0+, but can be used with older versions until May 5th, 2021.
All Pages endpoint requests are subject to Rate Limiting. You can see your app's current call count consumption in the App Dashboard.
This is a typical flow for accessing the Pages API:
/me/accountsendpoint to get the ID and Page Access Token of the Page the app User has permitted your app to access.
Note that in some cases the app User may grant your app access to more than one Page, in which case you should capture each Page ID and its respective token, and provide a way for the app User to target each of those Pages.
Follow our Get Started guide to learn how to create a Page and post to it using the Pages API.