Can I trigger an automation or send an Instagram DM through an API?

Answered by Sanjay, founder of InstantDM (official Meta Business Partner) ·Last checked

Short answer

Yes, you can trigger an automation or send an Instagram DM through an API. In InstantDM, click API & MCP on Home, open API and click Generate New Key. Your app can then send a DM (POST /send_message) or start a flow (POST /trigger_flow) at openapi.instantdm.com. The API is on Trendsetter, Trendsetter Pro and the Multi plans, and on Free for the first 8 days. Instagram still only lets you message people who contacted you first.

Ask an AI with this answer: Ask ChatGPT Ask Claude Plain text version

What an Instagram DM API can and can't do

People usually ask this when they want their own website, CRM or a tool like Make, n8n or Zapier to start an Instagram conversation. That works, with one limit that applies to every tool: Instagram's official API only lets a business message people who contacted it first. A person must have sent you a DM, replied to your story or commented on your post. After their last message you have 24 hours to send normal messages. See the Instagram 24-hour window. A comment allows one private reply.

So an API can't send a cold DM to a list of usernames. What it can do is answer people who already reached out, from your own system, and start your automations for them.

How to send a DM or start a flow through the API

  1. In InstantDM, click API & MCP at the top right of Home.
  2. Open the API section and click Generate New Key. Copy the key and keep it private.
  3. Give the key and the API Docs link to your developer, or paste it into Make, n8n or Zapier as an HTTP request header.
  4. To send a DM, call POST /send_message. To start one of your flows for a person, call POST /trigger_flow with the flow's ID. The base address is openapi.instantdm.com.
  5. Test with your own second Instagram account first. Message your business account, then send to that account through the API.
  6. Check the flow ID carefully. Today the API answers "Flow triggered" even when the ID doesn't match any flow, so a wrong ID fails silently.

If Generate New Key can't be clicked, your plan doesn't include the API. It works again as soon as you move to an eligible plan.

InstantDM API plans, credits and limits

  • Plans: the API is on Trendsetter, Trendsetter Pro and all Multi plans. Free accounts can use it for their first 8 days. Legend Pro has no API.
  • Credits: reading posts, comments and conversations is free. Each DM or reply sent through the API uses 1 credit, and a refused send isn't billed.
  • Rules: InstantDM never uses Meta's message tags. API sends follow the same 24-hour window and one-private-reply rule as your automations.
  • Events out: to get new comments, DMs and button taps pushed to your app, turn on webhooks on the same page. See Webhooks and API and Instagram DMs to n8n, Make or Zapier.
  • AI assistants: the MCP section lets Claude and other assistants send DMs and start flows from a chat. See connect an AI assistant.

Questions people also ask

Can I DM someone who never messaged me through the API?

No. Instagram's API only lets a business message people who messaged it or commented, and normal messages only within 24 hours of their last message. The API passes Instagram's error back to you when a send is refused.

Is the API on Legend Pro?

No. Legend Pro has no API access. You need Trendsetter, Trendsetter Pro or a Multi plan. New Free accounts can try it during their first 8 days.

Does sending through the API cost credits?

Reading data is free. Each DM or reply sent through the API uses 1 credit. A flow started with trigger_flow uses credits for the messages the flow sends.

I have three Instagram accounts. Does one key cover all of them?

No. An API key belongs to one InstantDM account. Switch to each account and generate its own key there. Each account needs an eligible plan.

Can I use it from Claude or ChatGPT instead of writing code?

Yes. The same API & MCP page has an MCP connection that AI assistants can use to send DMs and start flows for you.

Related questions

Step-by-step guides