Instagram DM API

Instagram DM API with an AI Agent

Your AI Connector is an Instagram DM API: send and receive Instagram direct messages from your app, let an AI agent answer them, and get each DM as a signed webhook. One key also covers WhatsApp, Messenger, SMS, Telegram, email, web chat, LINE, Viber, iMessage, Skool, LinkedIn, TikTok and Discord.

  • Instagram DMs
  • Messenger
  • SendPOST /contacts/send
  • Receivesigned webhooks
POST /contacts/send
curl https://api.youraiconnector.com/v1/contacts/send \
  -X POST \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "instagram",
    "instagram_id": "17841400000000000",
    "body": "Thanks for your message!"
  }'
Response201 Created
{
  "success": true,
  "message_id": "aB3dE5fG7hI9jK1lM2nO",
  "contact_id": "contact123",
  "channel": "instagram"
}

Answer Every Instagram DM with an Agent

Most DMs are the same handful of questions: price, availability, where you are, can I book. An agent created from your website answers them in the brand's voice, asks the qualifying questions and books the appointment, and a person can take over any chat from the inbox.

  1. Create the agent with POST /agents.
  2. Connect the Instagram account.
  3. Route Instagram to the agent.
  4. Subscribe to new_message webhooks to sync DMs into your own system.
PUT /entry-points/channel-defaults
curl https://api.youraiconnector.com/v1/entry-points/channel-defaults \
  -X PUT \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "channel": "instagram", "agent_id": "ag7HkQ2ZpLxR3mNb" }'
Response200 OK
{ "entry_point_id": "Xq81bTz0RkLm4Vw2" }
POST/agentsCreate the agent
POST/contacts/sendReply to a DM
POST/webhooksSync every DM

Built for Products and Platforms

Each DM becomes a contact you can tag, list, move through a pipeline as a deal, or hand a task to a person. Platforms run Instagram on an account per customer with sub_account_id and scoped keys. Read more on the multi-account API and the comparison with Unipile.

GET/contactsEvery DM is a contact
POST/dealsMove it through a pipeline
GET/tasksHand work to a person
POST/subaccountsAn account per customer

FAQ

Instagram DM API Questions

Is there an API for Instagram DMs?

Yes. Your AI Connector sends Instagram DMs with POST /contacts/send using channel: "instagram" and the instagram_id, and delivers incoming DMs to your server as signed webhooks.

Can an AI agent reply to Instagram DMs?

Yes. Route Instagram to an agent with PUT /entry-points/channel-defaults and it answers new conversations, qualifies leads and books appointments.

Which Instagram accounts can I connect?

Connect the business's Instagram account in the app or over the API; the connection is made on the account owner's consent screen.

Does it also handle Messenger?

Yes. Messenger is a separate channel on the same API and the same agent can answer both.

Can I manage Instagram DMs from Claude or ChatGPT?

Yes, through the MCP server at https://mcp.youraiconnector.com/mcp. Add it as a custom connector and sign in, or use your key from Claude Code.

Get Instagram DM API Access

Tell us what you are building and we reply by email with access.