openreply icon indicating copy to clipboard operation
openreply copied to clipboard

Support / guidance for Meta's new Instagram API Unified Login flow

Open Fabre-Play opened this issue 1 month ago • 6 comments

Summary

New Meta apps created in October 2026 for the use case “Manage messaging and content on Instagram” are forced into:

Instagram API setup with Unified login

Meta states that the Instagram Login setup documented by OpenReply is unavailable for newer apps.

OpenReply currently appears to support the older Instagram Login / Business Login for Instagram flow.

Current OpenReply implementation

The current provider uses:

  • instagram.com/oauth/authorize
  • api.instagram.com/oauth/access_token
  • instagram_business_* permissions
  • graph.instagram.com
  • Instagram User Access Tokens
  • long-lived token exchange/refresh

Relevant files:

  • lib/meta/oauth.ts
  • lib/meta/client.ts
  • docs/setup.md

Reproduction

  1. Create a fresh Meta app using the Instagram messaging/content use case.

  2. Configure the available API setup with Unified login.

  3. Create a configuration with an Instagram professional account and the required Instagram permissions.

  4. Open the generated login URL, which uses:

    • facebook.com/dialog/oauth
    • client_id
    • config_id
    • redirect_uri
  5. Complete authorization.

  6. Meta redirects with code and state.

  7. Exchange the code with:

    GET https://graph.facebook.com/v25.0/oauth/access_token

  8. Inspect the resulting token with Meta's token debugger.

The exchange succeeds and produces a valid SYSTEM_USER token associated with the correct app. The token has:

  • instagram_basic
  • instagram_manage_comments
  • instagram_content_publish
  • instagram_manage_messages
  • public_profile

The token has no expiration timestamp in the debugger response.

Additional verification

Meta Business Suite shows the app under Connected Apps with access to the selected Instagram professional account and capabilities for:

  • profile and posts;
  • comments;
  • publishing;
  • messages.

There is no traditional System User listed under Business Settings.

Instagram Webhooks also work:

  • valid X-Hub-Signature-256;
  • object: instagram;
  • entry[].id present;
  • changes[].field: comments.

The Instagram Account ID used in the Graph requests was independently verified to match byte-for-byte:

  1. the Instagram identifier shown by Meta Business Suite for the connected professional account;
  2. entry[].id from a real, correctly signed comments webhook.

This reasonably rules out a simple wrong-ID or namespace mismatch.

Development Mode behavior was also observed:

  • a comment from an account without an app role did not produce a webhook;
  • a comment from an Instagram Tester produced a webhook.

Failure

Using the confirmed Instagram Account ID with the Unified Login token:

GET https://graph.facebook.com/v25.0/{instagram_account_id}
GET https://graph.facebook.com/v25.0/{instagram_account_id}/media
GET https://graph.facebook.com/v25.0/{instagram_account_id}/conversations?platform=instagram

all return:
HTTP 400
GraphMethodException
error code: 100
error subcode: 33
The same token is rejected by graph.instagram.com/me.

No IDs, tokens, app secrets, usernames, or private account data are included here.
Expected behavior
We'd like to determine the correct operational token/host/endpoint combination for Instagram accounts connected through Unified Login, and whether OpenReply needs a second provider implementation.
Questions
1. Is Meta Unified Login currently supported by OpenReply?
2. Is Unified Login support planned or already under development?
3. What is the correct operational Graph host and endpoint pattern for the SYSTEM_USER token issued by this flow?
4. Does Unified Login require additional asset/task assignment even when Meta Business Suite shows the Instagram account under Connected Apps?
5. Is the token returned by the code exchange the final operational token, or is another token/context required?
6. Would a PR adding Unified Login as a second Meta authentication/provider mode be welcome?
Requested guidance
Please confirm the supported authentication matrix and the correct endpoint/token combination for newer Meta apps. A provider abstraction may be needed so existing Instagram Login integrations remain supported while Unified Login is added separately.

Fabre-Play avatar Oct 30 '26 18:10 Fabre-Play

Running in to the same issue

jackswisher avatar Oct 30 '26 22:10 jackswisher

Same issue here.

Heppian avatar Nov 01 '26 01:11 Heppian

We hit the same symptom and found what fixed it for us: add business_management to the configuration.

What we saw before the fix: the code exchange returned a SYSTEM_USER token (no expiry), the client portfolio listed the app under Connected Apps with access to the Instagram account, /me/assigned_instagram_accounts returned {"data": []}, and every call on the Instagram account ID failed with 100/33. It reproduced with "Continue with Instagram", "Continue with Facebook", after removing and re-adding the connection, on a second app, and with the App Dashboard's own "Generate token". An ad account created during the flow was assigned to the system user; only the Instagram account never was.

The fix:

  1. The permission editor in API setup with Unified login doesn't offer business_management. Add the Facebook Login for Business product to the app.
  2. Under Facebook Login for Business > Configurations, click Edit on the same configuration (same config_id) and add business_management in the permissions step.
  3. Have the client log in again.

After that, /me/assigned_instagram_accounts returns the account, and /{ig-user-id}, /media, /{media-id}/comments and /conversations?platform=instagram all work with the system-user token on graph.facebook.com. GET /{instagram-asset-id}/assigned_users?business={client_business_id} shows the system user with FULL_CONTROL, MESSAGES, CONTENT and COMMUNITY_ACTIVITY.

Notes:

  • The token only kept business_management on an app with Advanced Access to public_profile. On an app where public_profile was Standard, the consent screen listed the permission but the token dropped it silently.
  • For clients without a role on the app, business_management will need Advanced Access through App Review.
  • Conversation participant IDs (IGSIDs) matched the ones our Instagram Login integration had stored for the same account, so contacts don't change when moving between the two logins.

Tested on 2026-10-31 with Graph API v26.0. So far we've confirmed the fix on the "Continue with Facebook" path (an app admin logging in); we'll confirm the "Continue with Instagram" path next.

kleberncto avatar Nov 01 '26 04:11 kleberncto

Follow-up: the fix also works on the "Continue with Instagram" path, with the same configuration (business_management included).

  • The flow showed two screens. The first picks assets: the business portfolio, the Instagram account, and "Ad Accounts • Optional", which we skipped. On the "Continue with Facebook" path, by contrast, the dialog made us create an ad account because the portfolio had none. The second screen reviews permissions and lists "Manage your business".
  • /me/assigned_instagram_accounts returned the account, and profile, media, comments and /conversations?platform=instagram all worked.
  • Both login paths returned the same system user for the client portfolio, and logging in again didn't invalidate the earlier token.
  • Changing the Instagram account's password did not revoke either system-user token. We checked with debug_token and /conversations right after the change, then 5 and 10 minutes later.

Two extras, in case they help:

  • Insights: adding instagram_manage_insights to the configuration made /{ig-user-id}/insights and /{media-id}/insights work with the same token.
  • Likes: POST/DELETE /{ig-user-id}/likes (with comment_id or media_id) needs instagram_manage_engagement. Like business_management, it isn't offered in the Unified login tab's permission editor, only under Facebook Login for Business > Configurations > Edit. Without it the call fails with 100/33; with it, both like and unlike succeed. On the Instagram API with Instagram Login (graph.instagram.com) the same calls still fail with 100/33.

Tested on 2026-11-01 with Graph API v26.0.

kleberncto avatar Nov 01 '26 05:11 kleberncto

Hi @diwenne,

New Meta apps only offer Instagram API with Unified Login, but OpenReply still uses the Instagram Login OAuth flow. This prevents connecting a newly created app, as reported in #103 and #104.

Is official Unified Login support planned? I found henacosta1’s implementation—would you recommend using it, and has anyone confirmed that a complete comment-to-DM campaign works with it?

I’d prefer to stay on the official project and use Meta directly. What would you recommend?

Thanks!

danielterreros avatar Nov 11 '26 17:11 danielterreros

Data point on the open question about a full comment-to-DM flow under Unified Login.

Setup: new app (Unified Login only), system-user token on graph.facebook.com v27.0, config with instagram_basic, instagram_manage_comments, instagram_manage_messages and (after the tip above) business_management. App is published/Live. Account subscribed via POST /{ig-id}/subscribed_apps with comments,messages,messaging_postbacks,messaging_seen,message_reactions; app-level subscription for the instagram object shows the same fields.

What works:

  • comments webhooks arrive in real time, including from accounts with no role on the app.
  • Private reply with a postback button template is sent fine.
  • The dashboard "Test" for messages reaches our endpoint (signature valid).
  • /{ig-id}/conversations?platform=instagram shows the button taps and DMs within seconds.

What doesn't: no messages or messaging_postbacks webhook ever arrives, for button taps or plain DMs, even from the account we added as an Instagram tester. Nothing is rejected on our side.

Ruled out: other DM tools (removed from Connected apps), conversation routing ("Take control of conversations" on), API version, field set, business_management.

Our guess is Standard Access: the Instagram tester role may not count under Unified Login, only Facebook-account roles under App roles > Roles. Has anyone received messaging webhooks under Unified Login, and if so, was the sender an app role holder or did you have Advanced Access?

ugursaricam avatar Nov 19 '26 11:11 ugursaricam