To let your AI agent publish posts on your Facebook Page and Instagram account, you need to provide a few credentials through the Integrations page in your AgentGrow dashboard. This guide walks you through getting each one.

What You Will Need

Here are the credentials required for each integration:

IntegrationFieldWhat it is
FacebookFACEBOOK_PAGE_IDThe numeric ID of your Facebook Page
FacebookFACEBOOK_PAGE_ACCESS_TOKENA long-lived token that lets your agent post to the Page
InstagramINSTAGRAM_ACCOUNT_IDThe numeric ID of your Instagram Business account
InstagramINSTAGRAM_ACCESS_TOKENSame Page Access Token used for Facebook (Instagram Business uses the Facebook API)
Instagram Business accounts are managed through Facebook. One Page Access Token works for both Facebook and Instagram posting.

Prerequisites

If you do not have an Instagram Business account yet, switch from personal to business in Instagram Settings > Account > Switch to Professional Account, then link it to your Facebook Page under Page Settings > Linked Accounts.


Part 1 — Get Your Facebook Page ID

1

Go to your Facebook Page

Open Facebook and navigate to the Page you want your agent to post to. Make sure you are an admin of this Page.

2

Open Page Settings

On the left sidebar of your Page (New Pages Experience), click Settings at the bottom. If you are using the classic interface, click Settings in the top navigation bar.

3

Find your Page ID

Scroll to the bottom of the General settings page (or look under Page Transparency). You will see Page ID — a long numeric string like:

102770581820871

Copy this number. This is your FACEBOOK_PAGE_ID.

Alternative: Go to your Page, click About, and scroll to the very bottom. The Page ID is listed under Page transparency.

Part 2 — Get Your Page Access Token

This is the most involved step. You will create a Meta App, grant it permissions, and generate a long-lived Page Access Token.

1

Create a Meta Developer account

Go to developers.facebook.com and log in with the Facebook account that is an admin of your Page. If prompted, agree to the Meta Platform Terms and verify your account.

2

Create a new App

Click My Apps (top-right) then Create App.

Click Create App.

3

Add the required products

From your App Dashboard, scroll to "Add products to your app" and click Set Up on these:

4

Open the Graph API Explorer

Go to developers.facebook.com/tools/explorer/. This is the easiest way to generate your token.

5

Grant the required permissions

When the login dialog appears, make sure you grant these permissions:

If you do not see all permissions listed, click Add a Permission in the Explorer and search for each one.

6

Get the Page Access Token

The token you just generated is a User Access Token. You need to exchange it for a Page Access Token:

Copy this token. It will look something like:

EAABsbCS1iHgBO0pVjZC8mG2RaT7xN3KlXs2...
7

Extend the token to long-lived

Short-lived tokens expire in about one hour. You need a long-lived token (60 days) or a permanent token.

Option A — Use the Access Token Debugger:

Option B — Use the API directly:

In Graph API Explorer, make this request (replace values with yours):

GET /oauth/access_token?grant_type=fb_exchange_token&client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&fb_exchange_token=YOUR_SHORT_LIVED_TOKEN

The response contains a long-lived token.

Important: Page Access Tokens generated from a long-lived User Token are permanent and do not expire. This is the recommended approach — extend the User Token first, then get the Page Token.

The final token you copy is your FACEBOOK_PAGE_ACCESS_TOKEN. This same token also works as your INSTAGRAM_ACCESS_TOKEN.


Part 3 — Get Your Instagram Account ID

1

Confirm your Instagram Business account is linked

Go to your Facebook Page > Settings > Linked Accounts (or Instagram in the left menu). Make sure your Instagram Business account appears here. If not, link it first.

2

Query the Graph API

Go back to developers.facebook.com/tools/explorer/. Make sure your Page Access Token is selected, then run this query:

GET /me/accounts?fields=instagram_business_account

The response will include your Pages. Find the one with an instagram_business_account field:

{ "data": [ { "instagram_business_account": { "id": "17841448960441070" }, "id": "102770581820871" } ] }

The id inside instagram_business_account is your INSTAGRAM_ACCOUNT_ID.

If instagram_business_account is missing, your Instagram account is either not a Business/Creator account or it is not linked to the Facebook Page.

Part 4 — Enter Credentials in AgentGrow

1

Open your Integrations page

Log in to your AgentGrow dashboard at agentgrow.io/user/integrations.

2

Configure Facebook

Click Configure (or Reconfigure) on the Facebook module. Enter:

Click Save & Restart Agent. Your agent pod will restart in about 30 seconds.

3

Configure Instagram

Click Configure on the Instagram module. Enter:

Click Save & Restart Agent.

Token refresh: If you used a long-lived User Token first (Option A/B in Part 2), your Page Access Token will not expire. If you used a short-lived token directly, it will expire in about one hour and you will need to repeat Part 2.

Troubleshooting

I cannot find my Page ID

Go to your Page on Facebook, click the three dots (...) menu, then About. Scroll to the bottom — the Page ID is listed under Page Transparency. You can also find it in the URL when you are on the classic Pages experience: facebook.com/pages/edit/?id=123456789.

Graph API Explorer says "insufficient permissions"

Click Add a Permission in the Explorer and add pages_manage_posts and instagram_content_publish. Then click Generate Access Token again and re-authorize the app.

Instagram Business Account field is missing

Three things to check:

My agent posted once then stopped

Your token likely expired. Go to the Access Token Debugger (developers.facebook.com/tools/debug/accesstoken/), paste your token, and check the expiration. If expired, repeat Part 2 to generate a new long-lived token, then reconfigure the module in your dashboard.

How do I make the token permanent?

Generate a long-lived User Token first (extend via the Debugger or API). Then use that long-lived User Token to request a Page Access Token. The resulting Page Token will be permanent (no expiry). The Access Token Debugger will show "Expires: Never" for a permanent token.