Get started with the Instagram API with Unified Login
Updated: Oct 27, 2026
Copy for LLM
This guide shows you how to set up the Instagram API with Unified Login and add it to your app. When you finish, your business clients can connect their Instagram professional account to your app by logging in with Instagram or Facebook.
Before you start
You need:
- A Meta app with the Manage messaging & content on Instagram use case. The app must be owned by a business portfolio. The API setup with Unified login tab only appears for apps owned by a business portfolio.
- An app that uses Facebook Login for Business. The Instagram API with Unified Login is built on Facebook Login for Business, so the API setup with Unified login tab only appears for apps that use it. New business type apps and new apps created with a supported use case use Facebook Login for Business automatically. If your app still uses Facebook Login, switch your app to Facebook Login for Business or create a new app.
- An admin role on the app.
- An HTTPS redirect URL that your app controls. Your clients return to this URL after they log in.
- An HTTPS endpoint that can receive and verify webhook notifications.
- An Instagram professional account for testing. Test users aren’t supported.
To open the setup, go to your app in the App Dashboard, select Use cases > Manage messaging & content on Instagram > Customize, and then select API setup with Unified login.
Step 1: Create a configuration
A configuration is the list of permissions and assets your app asks your clients for. It’s a Facebook Login for Business configuration, and its ID is called
config_id.Open Configure your app:
- Select Create new configuration. A default configuration made with Create new configuration requests:
- An Instagram account
- An ad account, which your clients can skip
- The
instagram_basicandinstagram_manage_messagespermissions, which are required, plusinstagram_manage_comments,instagram_content_publish,ads_management, andads_read
- To change the permissions, open the configuration preview and select Edit permissions. You can also add
instagram_manage_insightsandinstagram_manage_events. - Select Use this configuration.
- Under Redirect URL, enter your HTTPS redirect URL, and select Save.
- Copy the Login URL. You add it to your app in Step 4.
The configuration preview also shows the access token type and expiration for the configuration.
The
config_id isn’t a secret. It identifies the configuration but doesn’t give access to any data.You can also select an existing Facebook Login for Business configuration if it has the Instagram Login Compatible label.
Step 2: Generate a test access token
Open Generate access tokens to test with your own Instagram account while your app is in Development mode.
- Select Add account and invite your Instagram professional account as an Instagram Tester.
- Accept the invitation in Instagram on the web: Settings > Website permissions > Apps and websites > Tester Invites. The account appears in the table after you accept.
- Select Generate token and complete the login. Copy the access token. It’s shown only once.
Step 3: Configure webhooks
Webhooks notify your server when something happens on your clients’ Instagram accounts, such as a new message or comment.
Open Configure webhooks. Add your callback URL and verify token, and verify your endpoint. Then subscribe to the fields your app needs.
After a client connects, subscribe each of their Instagram accounts to your app. See Set up Webhooks and Webhook fields.
Add the Login URL from Step 1 to a button or link in your app or website. Before your client selects it, tell them why your app needs each asset and permission.
The login URL opens the Facebook Login for Business dialog. It has the following format:
https://www.facebook.com/dialog/oauth?
client_id=<META_APP_ID>
&config_id=<CONFIG_ID>
&redirect_uri=<REDIRECT_URI>
&response_type=code
&display=popup
&prompt=login
| Parameter | Description |
|---|---|
client_id | Required. Your Meta app ID. |
config_id | Required. The ID of the configuration you selected in Step 1. |
redirect_uri | Required. Your HTTPS redirect URL. It must match the redirect URL saved in Step 1. |
response_type | Required. Set to code. The login flow returns a code that your server exchanges for an access token in Step 5. |
display | Optional. Set to popup to open the login dialog in a popup window. |
prompt | Optional. Set to login to always show both the Facebook and Instagram login options. Without it, a client who is already logged in to Facebook continues as that account. |
See Facebook Login for Business and Manually build a login flow for more about the login dialog.
When your client selects the button, they log in with Instagram or Facebook, select their business portfolio and the assets to share, and approve the permissions. See Business onboarding.
Step 5: Exchange the code for an access token
Your app doesn’t receive an access token directly from the login flow. When your client completes the login flow, Meta redirects them to your redirect URL with a
code. Exchange the code for an access token with a server-to-server call:GET https://graph.facebook.com/v27.0/oauth/access_token?
client_id=<META_APP_ID>
&client_secret=<META_APP_SECRET>
&code=<CODE>
Use your Meta app ID and app secret, not your Instagram app ID and secret. Make this call from your server, and never expose your app secret in client-side code.
On success, your app receives a Business Integration System User Access Token. See Authentication and access tokens to learn how to store and use it.
Then show your client whether the connection worked. If they canceled or something went wrong, give them a way to try again.
Step 6: Get your client’s IDs
With a Business Integration System User Access Token,
/me represents the business integration system user, not the client’s Instagram professional account. Use the following requests to get your client’s business ID and the IDs of the accounts that your client shared with your app, and store them with the access token.Get the client business ID
Send a
GET request to the /me endpoint with the fields parameter set to client_business_id.curl -G \
-d 'fields=client_business_id' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v27.0/me
On success, your app receives a JSON object with your client’s business ID:
{ "client_business_id": "<CLIENT_BUSINESS_ID>", "id": "<APP_SCOPED_ID>" }
Store the client business ID with the access token. You need it to refresh or fetch your client’s access tokens with the Business Integration System User Access Token Management API. See Get a client business ID.
Get Instagram account IDs
Send a
GET request to the /me/assigned_instagram_accounts endpoint. Your app needs the instagram_basic permission.curl -G \
-d 'fields=id,username' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v27.0/me/assigned_instagram_accounts
On success, your app receives a JSON object with the Instagram professional accounts that your client shared:
{ "data": [ { "id": "<INSTAGRAM_ACCOUNT_ID>", "username": "<INSTAGRAM_USERNAME>" } ], "paging": { "cursors": { "before": "QVFIUkdGRXA2eHNNTUs4T1ZA...", "after": "QVFIUmlwbnFsM3N2cV9lZAFdC..." } } }
Use each
id as the Instagram professional account ID in your request paths. A client can share more than one Instagram account, and one access token covers all of them.Get ad account IDs
If your app manages ads for your client, send a
GET request to the /me/adaccounts endpoint. Your app needs the ads_read or ads_management permission.curl -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v27.0/me/adaccounts
On success, your app receives a JSON object with the ad accounts that your client shared:
{ "data": [ { "account_id": "<AD_ACCOUNT_ID>", "id": "act_<AD_ACCOUNT_ID>" } ], "paging": { "cursors": { "before": "MjM4NTQ0NDk4NjE2ODA2N...", "after": "MjM4NTQ0NDk4NjE2ODA2N..." } } }
Use the
id value, which includes the act_ prefix, in Marketing API request paths. To create ads for the Instagram account, see Set Up Instagram Accounts Without Pages.Step 7: Test your integration
Before you invite clients, connect your own test account through your login button and check that:
- The Instagram and Facebook login options appear.
- Your business portfolio and Instagram account are listed.
- Only the assets and permissions your app needs are requested.
- Your server receives the
codeand exchanges it for an access token. - Your server receives a test webhook notification.
Step 8: Complete App Review
When you save your configuration, your app gets Standard Access to its permissions. Standard Access is enough to test with people who have a role on your app.
To connect other clients, your app needs Advanced Access to each permission in your configuration, and it must be in Live mode. Open Complete App Review, select Go to app review, and request Advanced Access. If your app already has Advanced Access to these permissions, for example from the Instagram API with Facebook Login, you don’t need to request it again. See Permissions and App Review.