Instagram Direct Messages (Addon)
Send and receive Instagram DMs from inside the MailTrixy inbox, alongside email and other channels. Shipped as an installable addon — same UX as WhatsApp setup.
Prerequisites
- Instagram Business or Creator account. Personal Instagram accounts cannot use the Messaging API — this is a Meta restriction.
- Facebook Page linked to the Instagram account. DMs are sent via the Page's access token. The Page-to-IG link is set up in Instagram's mobile app under Settings → Account → Linked Accounts.
- Meta App on developers.facebook.com. One-time admin setup (5 minutes), explained below.
- Addon installed. Upload the
instagram-addon-v1.0.0.zipvia Admin → Addons → Upload & Install → Activate.
Step 1 — Install the addon
- Admin → Addons → Choose File → pick
instagram-addon-v1.0.0.zip→ Upload & Install. - Click Activate on the Instagram Direct Messages card. Migrations run (creates
instagram_accountstable, adjusts the conversations channel column). - A new Settings button appears on the addon card. Click it to open the admin overview at
/admin/addons/instagram/settings.
Step 2 — Create a Meta App (one-time, admin)
- Go to developers.facebook.com and create a Business-type App.
- Add the Instagram product. Request these permissions:
instagram_basicinstagram_manage_messagespages_messaging
- Open your MailTrixy admin overview at
/admin/addons/instagram/settings. Copy the Webhook URL shown there (e.g.https://yourdomain.com/addons/instagram/webhook). - In Meta App Dashboard → Webhooks → Instagram → paste the Webhook URL as the Callback URL. Subscribe to the
messagesandmessaging_postbacksfields. - Submit the app for Meta App Review. This typically takes 1–5 business days. Apps in “Development Mode” can only message accounts that have a role on the Meta App, so production use needs approval.
Step 3 — Workspace owner connects (per workspace)
Same WhatsApp-style flow:
- User goes to Settings → Channels.
- An Instagram card appears (only shown when the addon is active). Click Configure.
- Paste the following values from Meta's Graph Explorer / App Dashboard:
- Page ID — the Facebook Page linked to the IG account.
- Page Name (optional) — for display.
- IG User ID — Instagram Business Account ID (run
GET /me/accountsthen readinstagram_business_account.id). - IG Username (optional) — for display.
- Page Access Token — long-lived token with
pages_messaging+instagram_manage_messagesscopes. - App Secret — Meta App → Settings → Basic → App secret (click Show). Used to verify webhook signatures.
- Click Save. Status flips to Connected.
- A personal Verify Token is generated and shown — paste it into Meta's webhook subscription form.
Using Instagram DMs in the inbox
- Incoming DMs appear in the inbox as conversations with channel = Instagram. Real-time via webhook.
- Filter the sidebar by clicking the Instagram channel button to see only IG conversations (shows up only when the addon is active).
- Reply from the same reply composer used for email/WhatsApp. Text only (no rich text, no attachments — Meta API limitation for non-attachment-uploaded media).
- Message length: Instagram caps DM bodies at 1,000 bytes. MailTrixy auto-truncates safely at UTF-8 code-point boundaries to fit.
- 24-hour window: Meta only allows replies within 24 hours of the customer's last message (the “customer messaging window”). Outside that window you must use approved Message Tags.
Admin overview page
At /admin/addons/instagram/settings the admin sees:
- How users connect info card with a button to open the user Channels page.
- Webhook URL with a Copy button.
- Connected workspaces — read-only list showing every workspace that has connected, merged from both backends.
- One-time Meta App setup checklist.
The admin page is informational only — credentials are entered per-workspace by the workspace owner at Settings → Channels.
Troubleshooting
| Symptom | Fix |
|---|---|
| Activate fails with “Data truncated for column 'channel'” | Pre-v1.4 bug, fixed. Update to v1.4 or later — the addon now converts the ENUM to VARCHAR safely. |
| Webhook verify fails (Meta shows red status) | Your Verify Token in Meta's form doesn't match the one shown in your workspace Channels → Instagram settings. Copy it exactly. |
| “Cannot DM, customer outside 24-hour window” | Wait for the customer to message you first, OR use approved Message Tags (requires Meta App review). |
| Connected but no incoming messages | In Meta App Dashboard → Webhooks → Instagram — verify you're subscribed to messages AND messaging_postbacks fields. |
| Webhook signature invalid in logs | Your App Secret in workspace settings doesn't match Meta App → Settings → Basic → App Secret. Re-copy and save. |