# Instagram messaging API setup with Instagram Login

> Set up Instagram DMs with Instagram Login: Business app, scopes, tokens, App Review, the messages webhook and the send call.

Published 2026-11-03. Z-API Omni team.

The Instagram API with Instagram Login lets an Instagram professional account receive and send DMs through `graph.instagram.com` with an Instagram User access token, and no linked Facebook Page. You need a Business type app, the `instagram_business_basic` and `instagram_business_manage_messages` permissions and a webhook subscribed to `messages`. App Review is required to serve accounts you don't own, and Meta's webhook setup page lists Advanced Access, which needs that review, for webhooks. Meta's Instagram Platform overview states that "The Instagram API with Unified Login is recommended for new integrations" and labels Instagram Login "Existing Instagram Login integrations" ([Instagram Platform overview](https://developers.facebook.com/documentation/instagram-platform/overview), accessed 2026-11-03).

## Which Instagram API Meta recommends

Meta's overview compares three setups. All three support messaging.

| | Unified Login | Instagram Login | Facebook Login |
| --- | --- | --- | --- |
| Meta's recommended use | "New integrations" | "Existing Instagram Login integrations" | "Existing Page-linked integrations" |
| Facebook Page | not required | "Not required" | required |
| Host | `graph.facebook.com` | `graph.instagram.com` | `graph.facebook.com` |
| Token | Business Integration System User access token | Instagram User access token | Facebook User or Page access token |
| Messaging permission | `instagram_*` family plus Facebook Login for Business permissions | `instagram_business_manage_messages` | `instagram_manage_messages`, through Messenger Platform |

Meta's documentation index had no dedicated Unified Login setup page on 2026-11-03, only these overview rows. This guide covers the Instagram Login route, for teams that maintain an Instagram Login integration or have chosen it for accounts without a Page. If the account is linked to a Page, Meta's Messenger Platform guide sends you to the Facebook Login route instead ([Instagram messaging get started](https://developers.facebook.com/documentation/business-messaging/instagram-messaging/get-started)).

## Create the app and choose scopes

The setup is for Instagram professionals, meaning businesses and creators. Meta states that it "does not require a Facebook Page to be linked to the Instagram professional account" and "cannot access ads or tagging" ([Instagram API with Instagram Login](https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-instagram-login), accessed 2026-11-03).

Create the app in the App Dashboard and "select Business during the creation process". The Instagram product then has a page named "API setup with Instagram business login" with a Generate token button ([get started](https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-instagram-login/get-started)).

The four scopes are `instagram_business_basic`, `instagram_business_content_publish`, `instagram_business_manage_messages` and `instagram_business_manage_comments`. They replaced the older `business_*` values, which Meta deprecated on January 27, 2025. For DMs you need the first and the third. Add `instagram_business_manage_comments` if you also answer comments, as in [private replies to Instagram comments](/academy/articles/instagram-comment-private-replies-api/).

## Get an Instagram User access token

### Send the user to the authorize URL

Meta's sample spreads the scope list over several lines. This adapted version, with placeholders, joins it into one comma-separated value ([Business Login for Instagram](https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-instagram-login/business-login)):

```text
https://www.instagram.com/oauth/authorize?client_id=INSTAGRAM_APP_ID&redirect_uri=REDIRECT_URI&response_type=code&scope=instagram_business_basic,instagram_business_manage_messages
```

### Exchange the code

The authorization code that comes back on your redirect URI is valid for 1 hour.

```shell
curl -X POST https://api.instagram.com/oauth/access_token \
  -F 'client_id=INSTAGRAM_APP_ID' \
  -F 'client_secret=INSTAGRAM_APP_SECRET' \
  -F 'grant_type=authorization_code' \
  -F 'redirect_uri=REDIRECT_URI' \
  -F 'code=AUTHORIZATION_CODE'
```

The get-started page says "Access tokens from the business login flow are short-lived and valid for 1 hour."

### Swap it for a long-lived token

Meta's sample breaks the URL across lines inside the quotes, which curl will not accept, so here it is on one line:

```shell
curl -i -X GET "https://graph.instagram.com/access_token?grant_type=ig_exchange_token&client_secret=INSTAGRAM_APP_SECRET&access_token=SHORT_LIVED_TOKEN"
```

The long-lived token lasts 60 days; Meta's sample shows `expires_in` of 5183944. Refresh it with a GET to `https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token`. The token must be at least 24 hours old, unexpired, and granted `instagram_business_basic`. A token you don't refresh within 60 days expires and can't be refreshed, so schedule the refresh well before day 60. Tokens from the App Dashboard's Generate token button are also long-lived, valid for 60 days.

## Access level and App Review

The access level depends on whose accounts your app serves ([App Review for Instagram](https://developers.facebook.com/documentation/instagram-platform/app-review), accessed 2026-11-03).

| Your app serves | Access level | App Review |
| --- | --- | --- |
| A business you own or manage | Standard Access | not required |
| Several businesses, as a Tech Provider | Advanced Access | required |

Meta adds that "To request Advanced Access to certain permissions, you need to make at least 1 successful API call." Each permission needs a screencast and test instructions in the submission. App settings need a 1024x1024 icon, a privacy policy URL, a category and a business email. "Web or mobile Web is the only platform that currently supports Instagram API with Instagram Login."

## Subscribe to the messages webhook

Your app "must be published or Live to receive notifications for app users". The requirements table on Meta's webhook setup page lists Advanced Access for Instagram Login ([webhooks setup](https://developers.facebook.com/documentation/instagram-platform/webhooks/setup), accessed 2026-11-03). Neither that page nor the App Review page says whether a Standard Access app serving your own account receives webhooks. Test with your own account before you plan to skip review. [Webhook verified but DMs never arrive](/academy/articles/instagram-login-webhook-verified-dms-not-arriving/) walks through the other checks.

Set the callback URL and verify token in the dashboard. Meta's verification GET carries `hub.mode` (always `subscribe`), `hub.verify_token` and `hub.challenge`, "An `int` you must pass back to us". Then subscribe each professional account. Meta's sample splits this URL across lines too, so it is joined here:

```shell
curl -i -X POST "https://graph.instagram.com/v26.0/me/subscribed_apps?subscribed_fields=messages&access_token=INSTAGRAM_USER_ACCESS_TOKEN"
```

`/me` stands in for the account ID, and success returns `{"success": true}`. Every notification carries `X-Hub-Signature-256`, "preceded with `sha256=`", an HMAC made with your app's App Secret. The page does not say whether that means the Instagram app secret or the Meta app secret, so test both if the check fails. [Webhook signature verification](/academy/articles/whatsapp-webhook-signature-verification-x-hub-signature-256/) has the code.

Answer every notification with 200. Meta retries unacknowledged ones "over the next 36 hours", then drops them, and asks your server to "handle deduplication". Key on `message.mid`, as in [the n8n idempotency pattern](/academy/articles/n8n-duplicate-webhooks-idempotency/). Skip events with `is_echo: true`, which Meta sets when your app user sent the message ([webhook examples](https://developers.facebook.com/documentation/instagram-platform/webhooks/examples)).

### The field names differ between two Meta pages

The webhook fields page lists `messages`, `messaging_postbacks`, `messaging_seen`, `message_reactions`, `messaging_referral`, `messaging_optins`, `messaging_handover` and `standby`. Each needs `instagram_business_basic` and `instagram_business_manage_messages` ([webhook fields](https://developers.facebook.com/documentation/instagram-platform/webhooks/fields)). The messaging API page spells two of them `messaging_reactions` and `messaging_referrals`. Copy the names from your App Dashboard, or subscribe and send a test reaction before you depend on either spelling. `messages` is the same on both pages.

## Send a reply

The send call goes to the professional account's ID, or to `/me/messages`. Meta's sample has no line continuations; they are added here so it runs ([messaging API](https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-instagram-login/messaging-api), accessed 2026-11-03):

```shell
curl -X POST "https://graph.instagram.com/v26.0/IG_ID/messages" \
     -H "Authorization: Bearer INSTAGRAM_USER_ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
           "recipient": { "id": "IGSID" },
           "message": { "text": "TEXT_OR_LINK" }
         }'
```

The response is `{"recipient_id": "IGSID", "message_id": "MESSAGE-ID"}`. The IGSID is the Instagram-scoped ID from the inbound webhook's `sender.id`. Your app can send "Only after an Instagram user has sent your app user's Instagram professional account a message".

| Content | Limit |
| --- | --- |
| Text | UTF-8, 1000 bytes or less |
| Image | png or jpeg, up to 8 MB, up to 10 per message |
| Audio | aac, m4a, wav or mp4, up to 25 MB |
| Video | mp4, ogg, avi, mov or webm, up to 25 MB |
| File | pdf, up to 25 MB |

Group messaging and inbox folders are not supported. Conversations from people who don't follow the account land in Requests, and "Messages in the Requests folder that have not been active for 30 days will not be returned in API calls."

## The 24-hour window and the human agent tag

The standard window lasts 24 hours "For most user actions", and up to 7 days after a Click-to-Direct ad. If a person on your team needs more time, the app "can tag the response to use the separate 7-day Human Agent window". The Human Agent feature "requires successful completion of the App Review process" and "is only available with business verification" ([Human Agent](https://developers.facebook.com/documentation/development/features-reference/human-agent)). The Instagram Login pages do not print the request body for a tagged send, so test it before production. [The Instagram 24-hour window and human agent tag](/academy/articles/instagram-messaging-api-24-hour-window-human-agent-tag/) covers the rules.

Meta's policy adds that "Some message tags are available only for Messenger Platform and not IG Messaging API", and one-time notifications are not available for Instagram ([policy](https://developers.facebook.com/documentation/business-messaging/messenger-platform/policy)).

## Rate limits: Meta publishes two numbers

| Source | Text, links, reactions, stickers | Audio or video |
| --- | --- | --- |
| [Instagram Platform overview](https://developers.facebook.com/documentation/instagram-platform/overview) | 100 calls per second per professional account | 10 per second |
| [Messenger Platform rate limiting](https://developers.facebook.com/documentation/business-messaging/messenger-platform/overview/rate-limiting) | 300 calls per second per professional account | 10 per second |

Both pages accessed 2026-11-03. The Messenger page covers the Facebook Login route, but it names Instagram professional accounts directly. Until Meta reconciles the two pages, the lower figure of 100 per second is the safer one to design for. The overview also caps the Conversations API at 2 calls per second per account and puts all endpoints under Instagram Business Use Case rate limiting.

If you also run WhatsApp, Messenger or Telegram, [one message model for the four channels](/academy/articles/whatsapp-instagram-messenger-telegram-one-message-model/) maps the Instagram webhook next to the others.

*Z-API Omni team*
