Live

Instagram: your direct messages

DMWire connects an Instagram professional account (Business or Creator) through a Meta app you own. Your agent answers the people who send you direct messages, within Instagram's 24 hour window.

You need your own Meta app first. Your own Meta app sets it up step by step.

There are two ways in. Pick the one that fits:

  • Through the Facebook Page the Instagram account is linked to. You sign in with Facebook on a page DMWire hosts and pick the Page. This connects Messenger for that Page too.
  • With an Instagram token your own app already obtained (Instagram login, no Facebook Page needed). You push the token to DMWire.

Connect through the Facebook Page

  1. Save your Meta app with the App ID, App Secret and configuration ID (set_meta_app), and paste the Instagram callback URL into it.
  2. Ask your agent to "connect Instagram", or call connect_instagram_messenger:
bash
curl -X POST https://api.dmwire.ai/v1/channels/meta/connect \
  -H "X-API-Key: $DMWIRE_API_KEY" -H "Content-Type: application/json" -d '{}'
  1. Open the connect_url from the answer in a browser. It is a page on api.dmwire.ai, valid for a short time. It sends you to Facebook, where your app asks for the permissions. Sign in with the Facebook account that manages the Page and allow them.
  2. Back on the page, pick the Page. The Instagram account linked to it is connected with it.

Your agent can follow along with get_instagram_messenger_status: pending, then pages_loaded, then connected (or failed with a reason, or expired). A script that does the Page pick itself uses list_pages and select_page.

Without a saved app, the connect call answers meta_app_required (409).

Connect with an Instagram token

  1. Save your Meta app with the Instagram app ID and secret (set_meta_app), and paste the Instagram login callback URL into it.
  2. Get a token for the account through your app's Instagram login, with instagram_business_basic and instagram_business_manage_messages.
  3. Push it with push_instagram_token:
bash
curl -X PUT https://api.dmwire.ai/v1/channels/instagram-login/token \
  -H "X-API-Key: $DMWIRE_API_KEY" -H "Content-Type: application/json" \
  -d '{"ig_user_id":"17841400000000000","access_token":"...","expires_in":5183944}'

ig_user_id is the user_id Instagram returns for the token on GET https://graph.instagram.com/me?fields=user_id,username. DMWire checks the token with Instagram, confirms the account is a professional one and subscribes it to your app's webhooks. Tokens are never refreshed for you: push a fresh one before it expires (60 days when you send no expiry). Pushing again for the same account replaces the token.

In the dashboard, the Instagram connect screen has both ways.

Sending

  • Instagram only lets you message people who wrote to the account. Address them by to.instagram_id (from their inbound message) or to.contact_id. Someone who never wrote is refused with needs_inbound_first (409).
  • A reply has to go out within 24 hours of the person's last message. Later, the send is refused with outside_window (409) until they write again.
  • Text, plus at most one media_url (an https link to a photo or video).

Disconnect

disconnect_instagram_token removes a pushed token. disconnect_instagram_messenger removes the Page connection, Instagram and Messenger together. The dashboard picks the right one.

Limits on Instagram

LimitValue
Instagram accounts per DMWire account1
Messages you send per day (free limits)50
Messages to one person who has not replied3, then DMWire waits for their reply

Instagram enforces its own rules on automated accounts on top of these. Answer people who wrote to you; DMWire never starts a chat on Instagram.

Last checked against the live service on 2026-10-23.