Instagram DM API and comment automation
Get every Instagram DM and comment on your webhook and reply from your code — in the DM, publicly under the comment, or privately to the commenter. Every account you connected, one API key.
- ✓ DMs and comments
- ✓ Private replies to commenters
- ✓ Images, video and audio
- ✓ Hourly limits queued for you
Reply to an Instagram DM
Full reference →curl -X POST "https://api.iotabot.com/v1/messages" \
-H "Authorization: Bearer $IOTABOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"conversation_id": "6a4b9e21c3f1a2b3c4d5e6f7",
"text": "Yes, it comes in blue!"
}' \
-H "Idempotency-Key: order-1042-shipped"{
"data": {
"id": "6a4ba0f1c3f1a2b3c4d5e733",
"object": "message",
"status": "queued",
"channel": "instagram",
"conversation_id": "6a4b9e21c3f1a2b3c4d5e6f7",
"created_at": "2026-10-01T09:16:10.004Z"
}
}- DMs + comments
- both on one webhook
- Private replies
- DM a commenter about their comment
- Every account
- you connected, one API key
- Test mode
- simulate DMs and comments
Get started with the Instagram API in three steps
- 1
Connect Instagram
Connect your Instagram professional account to IotaBot.
- 2
Subscribe
Add a webhook endpoint for message.received and comment.received.
- 3
Reply from your code
POST /v1/messages with the conversation_id — in the DM, under the comment, or privately.
What you can build with the Instagram API
Every DM on your webhook
Text, images, video and audio from customers, the moment they arrive.
See how →Reply to DMs with media
Text, images, video and audio within 24 hours of the customer's last message.
See how →Messaging window check
See who you can DM right now and how long their 24-hour window has left — by username, user id or conversation, up to 100 at once.
See how →Comments on your webhook
Every comment on your posts arrives as comment.received with its own conversation.
See how →Public or private comment replies
Answer under the comment for everyone, or send the commenter a private DM with reply_as: "dm".
See how →Hand to your team
Stop the AI and put a conversation with your team — or give it back.
See how →Test mode
Simulate a DM or a comment with a test key; nothing is sent to Instagram.
See how →Instagram API use cases
Comment-to-DM funnels
Reply privately to everyone who comments a keyword, with the link or offer they asked for.
DMs into your CRM
Create a lead for every new DM and reply from your CRM.
Product questions
Answer "is this available?" comments with a public reply and the details in a DM.
AI with your own rules
Let IotaBot's AI answer DMs and step in from your code when needed.
Instagram's rules, said plainly
- The customer writes first — a DM or a comment. A business cannot open a DM out of nowhere.
- DM replies go within 24 hours of the customer's last message (window_closed otherwise).
- One private reply per comment, within 7 days of it (private_reply_used / private_reply_expired).
- Instagram limits automated DMs per hour; IotaBot queues past the limit instead of dropping messages.
Instagram API: frequently asked questions
What is the Instagram DM API?
It lets your software receive and reply to Instagram direct messages and comments. IotaBot sends each one to your webhook and lets you reply with POST /v1/messages.
Can I send the first DM to someone?
Not out of nowhere — Instagram only lets a business reply. When someone comments, you can reply privately with reply_as: "dm", once per comment within 7 days; when they DM you, you can reply for 24 hours.
Can I reply to Instagram comments through the API?
Yes. Send to the comment's conversation for a public reply under the customer's latest comment, or add reply_as: "dm" to reply privately in their DMs.
What can I send in a DM?
Text, images, video and audio. Instagram does not accept documents in DMs.
Is there a limit on DMs?
Instagram limits automated DMs per account per hour. IotaBot counts them and queues anything past the limit for the next hour instead of dropping it.
Do I need an Instagram business account?
Yes — an Instagram professional (business or creator) account, connected to IotaBot.
Can I test without a live account?
Yes. A test key can simulate DMs and comments (comment: true) and every reply, without anything reaching Instagram.
One API for every channel
The same endpoints, webhooks and errors on WhatsApp, Instagram, email and website chat.
Start building with the Instagram API
Create a key, send your first request, and try everything in test mode before it goes live.
