Setting up Instagram Login: Instagram app ID and secret
Instagram API with Instagram Login connects an Instagram professional account (Business or Creator) without a Facebook Page. You set it up inside a Meta app: under Instagram → API setup with Instagram login copy the Instagram app ID and Instagram app secret — they differ from the Meta App ID — add the OAuth redirect URI, request instagram_business_* permissions and configure webhooks.
Updated:
Instagram Login or Facebook Login: which one?
Choose Instagram Login when the account has no Facebook Page or you only need Instagram: profile, media, publishing, comments, Direct and insights. Choose Facebook Login via a Page when you also need Facebook Pages, Lead Ads, ads, hashtag search or product tagging — per Meta's docs these aren't available with Instagram Login.
Both paths work only with professional accounts — the API can't access personal Instagram accounts.
You can use both in one product: in the Socialift dashboard they're separate cards, “Meta (Facebook) app” and “Instagram Login app”.
Instagram Login vs Facebook Login
| Instagram Login | Facebook Login (via Page) | |
|---|---|---|
| Facebook Page | Not required | Required: the Instagram account is linked to a Page |
| Which ID | Instagram app ID | Meta App ID |
| API host | graph.instagram.com | graph.facebook.com |
| Token | Instagram User token (long-lived — 60 days, refreshable) | Facebook User or Page token |
| Permissions | instagram_business_* | instagram_* + pages_* |
| Hashtag search, product tagging | No | Yes |
| Socialift dashboard | “Kalitlar” (Keys) → “Instagram Login app” | “Kalitlar” (Keys) → “Meta (Facebook) app” |
| Python SDK | Instagram(app_id=..., app_secret=...) | Instagram.via_facebook(app_secret=...) |
How to set up Instagram Login in the Meta dashboard
Open a Meta app with the Instagram use case
On developers.facebook.com/apps create an app and choose the Instagram use case (“Manage messaging & content on Instagram”), or add it to a compatible existing app. Then open Instagram → API setup with Instagram login in the left menu. Button labels may change — the goal is to reach that section.
Copy the Instagram app ID and secret
They're under “Set up Instagram business login” → Business login settings. These are NOT the Meta App ID and App Secret from App settings → Basic: per Meta's docs, apps using Business Login for Instagram use the Instagram app ID shown in this section.
Add the OAuth redirect URI
In Business login settings add your callback address to OAuth redirect URIs. It must exactly match the
redirect_uriin the authorization request.Check the permissions
Make sure the use case includes the
instagram_business_*permissions you need (table below). The old names (business_basicand so on) were deprecated on January 27, 2025 — your code must use the new ones.Test with your own account
The same page lets you add an Instagram account to generate a test token. With Standard Access the app works only for accounts you own or manage, or that you added to the app in the App Dashboard.
Configure webhooks
In the webhooks section enter the Callback URL and Verify token, verify, then subscribe to
comments(mentions arrive inside this event) andmessages. Meta requires the app to be Live, Advanced Access forcomments, a public account, and aPOST /me/subscribed_appscall ongraph.instagram.comfor each account.App Review and Business Verification
To connect accounts you don't own or manage, get Advanced Access through App Review; Advanced Access requires Business Verification.
Which permissions (scopes) do you need?
This is the default list for Socialift's “Instagram Login app” card and for the Instagram(...) client.
| Permission | What it allows | In the SDK |
|---|---|---|
instagram_business_basic | Profile and media of the professional account; also required to refresh the token | ig.profile, ig.media, ig.refresh_token |
instagram_business_content_publish | Publish posts, carousels and Reels | ig.publish, ig.publish_carousel |
instagram_business_manage_comments | Read, reply to, hide and delete comments; the comments webhook | ig.comments, ig.reply_comment, ig.hide_comment |
instagram_business_manage_messages | Direct conversations and sending messages; the messages webhook | ig.conversations, ig.send_message |
instagram_business_manage_insights | Account and media insights | ig.insights, ig.media_insights |
Refresh conditions (Meta): the token is at least 24 hours old, still valid, and the user granted instagram_business_basic. A token not refreshed within 60 days expires.
How to add the Instagram Login app to Socialift
“Kalitlar” (Keys) → “Instagram Login app”
In the dashboard open “Kalitlar” and the “Instagram Login app” card. Paste the Redirect URI from the “Konsolga ko'chiring” (Copy to console) block into Business login settings → OAuth redirect URIs.
Enter and verify the keys
Fill in “Instagram app ID” and “Instagram app secret”; “Scope'lar” (Scopes) is optional (empty = default list). Click “Saqlash va tekshirish” (Save and verify): Socialift asks Meta for an app access token with this pair and shows the result on the card.
Copy the webhook URL
After saving, the card shows Webhook URL, Webhook verify token, Deauthorize callback and Data deletion callback. Paste them into the matching fields in the Meta dashboard. Incoming events are verified with the secret from this card.
Connect the account
In “Ulanishlar” (Connections) click “Ulash” (Connect) on the “Instagram (Page'siz)” (without Page) card. The account appears as business or creator with its token expiry; “Token'ni yangilash” (Refresh token) extends it.
Subscribe the account to webhooks
Socialift doesn't subscribe Instagram Login accounts to
subscribed_appsautomatically. For each account, callPOST https://graph.instagram.com/v26.0/me/subscribed_apps?subscribed_fields=comments,messagesonce with that account's token.
Instagram Login in the Python SDK
Instagram.from_env() reads INSTAGRAM_APP_ID, INSTAGRAM_APP_SECRET and META_GRAPH_VERSION.
import asyncio
import secrets
from socialift import Instagram
REDIRECT_URI = "https://example.com/auth/instagram/callback" # same as OAuth redirect URIs
async def main() -> None:
# INSTAGRAM_APP_ID, INSTAGRAM_APP_SECRET (not the Meta App ID!), SOCIALIFT_LICENSE_KEY
async with Instagram.from_env() as ig:
state = secrets.token_urlsafe(32)
print(ig.login_url(redirect_uri=REDIRECT_URI, state=state))
code = input("code: ")
bundle = await ig.exchange_code(code, redirect_uri=REDIRECT_URI) # 60-day token
profile = await ig.profile(bundle.access_token)
print(profile.username, bundle.expires_at)
asyncio.run(main())Explicitly: Instagram(app_id="...", app_secret="..."). Refresh the token weekly with await ig.refresh_token(token).
For an account connected via a Page, use Instagram.via_facebook(app_secret=...) with the Page token instead.
Common mistakes
- Using the Meta App ID and App Secret for Instagram Login — you need the Instagram app ID and secret.
- The redirect URI differs from the one in OAuth redirect URIs.
- Requesting the old
business_*scopes — the new names areinstagram_business_*. - The account isn't professional (personal) — the API can't access it.
- Webhooks are configured, but the account isn't subscribed via
/me/subscribed_appsor the app isn't Live. - The account is private — comment and mention webhooks don't arrive.
- The token wasn't refreshed for 60 days and silently expired.
Frequently asked questions
Is the Instagram app ID the same as the Facebook App ID?
No. Instagram Login uses the Instagram app ID and Instagram app secret from Instagram → API setup with Instagram login. The Meta App ID and App Secret from App settings → Basic are for Facebook Login.
Does Instagram Login need a Facebook Page?
No — that's its main advantage. The account must still be professional (Business or Creator). If you need hashtag search, product tagging or ads, connect via Facebook Login and a Page.
How long does an Instagram Login token last?
The short-lived token is exchanged for a long-lived one valid for 60 days. You can refresh a token that is at least 24 hours old and still valid; without a refresh it expires after 60 days. The Socialift dashboard has a “Token'ni yangilash” (Refresh token) button for this.
Why aren't Instagram webhooks arriving?
Check that the app is Live, has Advanced Access for comments, the account is public and subscribed via POST /me/subscribed_apps.
Can I connect in Socialift without my own key?
Yes, if Socialift's shared Instagram Login key is configured — the card then shows “Socialift kaliti ishlatiladi” (Socialift key in use). With your own key the login dialog shows your app's name and webhooks are verified with your secret.