Skip to content
Fresh 2026

Get Started

This document explains how to successfully call the Pages API to post to your Page.

Before You Start

You will need the following:

  • A Facebook Page, this can be an unpublished or published Page on which you can perform the CREATE_CONTENT task.

  • A Page access token for the Page

  • The following permissions:

    • pages_manage_metadata
    • pages_manage_posts
    • pages_manage_read_engagement
    • pages_show_list

Best Practices

When testing an API call, you can include the access_token parameter set to your access token. However, when making secure calls from your app, use the access token class.

Step 1. Get Your Page ID

To get a list of IDs and Page access tokens for Facebook Pages on which you can perform a task, send a GET request to /user_id/accounts endpoint where user_id is your user ID.

Example Request

Formatted for readability. Replace bold, italics values, such as page_id, with your values.

curl
curl -i -X GET "https://graph.facebook.com/v25.0/user_id/accounts?access_token=user_access_token"

On success, your app receives the following JSON response that includes an array of objects. Each object contains information about a specific Page including the name, ID, a short-lived Page access token, tasks you can perform on the Page, and more:

json
{
  "data": [\
    {\
      "access_token": "page_access_token",\
      "category": "Internet Company",\
      "category_list": [\
        {\
          "id": "2256",\
          "name": "Internet Company"\
        }\
      ],\
      "name": "Name of this Page",\
      "id": "page_id",\
      "tasks": [\
        "ANALYZE",\
        "ADVERTISE",\
        "MODERATE",\
        "CREATE_CONTENT"\
      ]\
    },\
...\
```\
\
## Step 2. Publish a post\
\
To publish a post, send a <code v-pre>POST</code> request to the <code v-pre>/page_id/feed</code> endpoint, where <code v-pre>page_id</code> is the ID for the Page you are publishing to, with the <code v-pre>message</code> parameter set to your message content and the <code v-pre>access_token</code> parameter set to the Page access token:\
\
#### Example Request\
\
_Formatted for readability. Replace **bold, italics values**, such as **page\_id**, with your values._\
\
```curl\
curl -X POST "https://graph.facebook.com/v25.0/page_id/feed" \\
     -H "Content-Type: application/json" \\
     -d '{\
           "message":"your_message_text",\
           "access_token":"page_access_token",\
         }'\
```\
\
Your post will be published immediately.\
\
On success, your app receives the following JSON response with the ID for the post:\
\
```json\
{\
  "id": "page_post_id"\
}\
```\
\
Visit your\
[Facebook Page \\
to view the post.\
\
\
## Step 3. Verify Your Post\
\
To verify that the post was published to your Page, send a <code v-pre>GET</code> request to the <code v-pre>/page_id/feed</code> endpoint:\
\
#### Example Request\
\
_Formatted for readability. Replace **bold, italics values**, such as **page\_id**, with your values._\
\
```code\
      curl -i -X GET "https://graph.facebook.com/v25.0/page_id/feed?access_token=page_access_token"\
```\
\
On success, your app will receive the following JSON response with an array of objects. Each object includes the post ID, the message content, and the time the post was created:\
\
```code\
{\
  "data": [\
    {\
      "created_time": "2020-03-25T17:33:34+0000",\
      "message": "Hello World!",\
      "id": "422575694827569_917077345377399"\
    },\
...\
  ]\
}\
```\
\
## Use the Graph Explorer\
\
The Graph Explorer tool is a UI that allows you to experiment with Facebook APIs without adding code to your app or website. You can select permissions, get access tokens, test <code v-pre>GET</code>, <code v-pre>POST</code>, and <code v-pre>DELETE</code> methods, and get code snippets of these queries for Android, iOS, JavaScript, PHP, and cURL.\
\
Note, you will need a Facebook App ID to use the Graph Explorer.\
\
### Step 1. Get Your Page ID\
\
Select the the <code v-pre>pages_manage_metadata</code>, <code v-pre>pages_manage_posts</code>, <code v-pre>pages_manage_read_engagement</code>, and <code v-pre>pages_show_list</code> permissions, which ever appear within the Permission dropdown menu, set the <code v-pre>GET</code> request to the <code v-pre>/me/accounts</code> endpoint in the query box, and click **Submit**.\
\
\
Click on the ID of your Page, displayed directly beneath the name of your Page, to move the ID to the query box.\
\
### Step 2. Post as a Page\
\
Under the **User or Page** drop down menu, select the Page access token for your Page. Next, set the method to <code v-pre>POST</code> with a request to the <code v-pre>/{page-id}/feed</code> endpoint, then set the **Params**<code v-pre>key</code> to <code v-pre>message</code> and the <code v-pre>value</code> to your post text. Click **Submit**.\
\
On success, the Graph Explorer will show the ID of the Page post.\
\
\
Visit your Facebook Page to view the post.\
\
### Step 3. Verify Your Post\
\
Send a <code v-pre>GET</code> request to the <code v-pre>/page-id/feed</code> endpoint.\
\
On success, the Graph Explorer will display the time the post was created, the text of the post, and the ID of the Page post.\
\
\
## Next steps\
\
Learn how to get and update information about your Facebook Page include Page details, access tokens, blocked users, and user recommendations, using the Manage a Facebook Page guide.\
\
Learn how to publish links, photos, and videos to your Page.\
\
## See Also\
\
|     |     |\
| --- | --- |\
| #### Graph API guides&lt;br&gt;- Access Tokens \&lt;br&gt;   &lt;br&gt;  &lt;br&gt;- Graph API User Guide \&lt;br&gt;   &lt;br&gt;  &lt;br&gt;- Graph Explorer User Guide \&lt;br&gt;   &lt;br&gt;  &lt;br&gt;- Pages API Overview-Tasks\&lt;br&gt;    | #### References&lt;br&gt;- Page Reference \&lt;br&gt;   &lt;br&gt;  &lt;br&gt;- Page Feed Reference \&lt;br&gt;   &lt;br&gt;  &lt;br&gt;- Page Post Reference \&lt;br&gt;   &lt;br&gt;  &lt;br&gt;- Permissions Reference \&lt;br&gt;   &lt;br&gt;  &lt;br&gt;- User Accounts Reference \&lt;br&gt;    |\
\
On This Page\
\
Get Started\
\
Before You Start\
\
Best Practices\
\
Step 1. Get Your Page ID\
\
Step 2. Publish a post\
\
Step 3. Verify Your Post\
\
Use the Graph Explorer\
\
Step 1. Get Your Page ID\
\
Step 2. Post as a Page\
\
Step 3. Verify Your Post\
\
Next steps\
\
See Also