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:
| Integration | Field | What it is |
|---|---|---|
| FACEBOOK_PAGE_ID | The numeric ID of your Facebook Page | |
| FACEBOOK_PAGE_ACCESS_TOKEN | A long-lived token that lets your agent post to the Page | |
| INSTAGRAM_ACCOUNT_ID | The numeric ID of your Instagram Business account | |
| INSTAGRAM_ACCESS_TOKEN | Same Page Access Token used for Facebook (Instagram Business uses the Facebook API) |
Prerequisites
- A Facebook Page for your business (not a personal profile)
- An Instagram Business account connected to that Facebook Page
- A Meta Developer account (free to create)
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
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.
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.
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:
Copy this number. This is your FACEBOOK_PAGE_ID.
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.
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.
Create a new App
Click My Apps (top-right) then Create App.
- Use case: select "Other"
- App type: select "Business"
- App name: anything descriptive like "AgentGrow Publishing"
- Business portfolio: select your business portfolio (or create one if needed)
Click Create App.
Add the required products
From your App Dashboard, scroll to "Add products to your app" and click Set Up on these:
- Facebook Login for Business — needed to generate tokens
Open the Graph API Explorer
Go to developers.facebook.com/tools/explorer/. This is the easiest way to generate your token.
- In the top-right dropdown, select your app ("AgentGrow Publishing")
- Click Generate Access Token
Grant the required permissions
When the login dialog appears, make sure you grant these permissions:
- pages_manage_posts — lets the agent create posts
- pages_read_engagement — lets the agent read post insights
- pages_show_list — lets the agent access your Pages
- instagram_basic — needed for Instagram posting
- instagram_content_publish — lets the agent publish to Instagram
If you do not see all permissions listed, click Add a Permission in the Explorer and search for each one.
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:
- In Graph API Explorer, change the dropdown from "User Token" to "Page Access Token"
- Select your Page from the list
- A new token will appear in the Access Token field
Copy this token. It will look something like:
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:
- Go to developers.facebook.com/tools/debug/accesstoken/
- Paste your Page Access Token and click Debug
- At the bottom, click Extend Access Token
- Copy the new long-lived token
Option B — Use the API directly:
In Graph API Explorer, make this request (replace values with yours):
The response contains a long-lived 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
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.
Query the Graph API
Go back to developers.facebook.com/tools/explorer/. Make sure your Page Access Token is selected, then run this query:
The response will include your Pages. Find the one with an instagram_business_account field:
The id inside instagram_business_account is your INSTAGRAM_ACCOUNT_ID.
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
Open your Integrations page
Log in to your AgentGrow dashboard at agentgrow.io/user/integrations.
Configure Facebook
Click Configure (or Reconfigure) on the Facebook module. Enter:
- Facebook Page ID: the numeric ID from Part 1
- Facebook Page Access Token: the long-lived token from Part 2
Click Save & Restart Agent. Your agent pod will restart in about 30 seconds.
Configure Instagram
Click Configure on the Instagram module. Enter:
- Instagram Account ID: the ID from Part 3
- Instagram Access Token: the same Page Access Token you used for Facebook
Click Save & Restart Agent.
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:
- Your Instagram account must be a Business or Creator account (not Personal)
- It must be linked to your Facebook Page (Page Settings > Linked Accounts)
- Your app must have the instagram_basic permission
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.