Developer docs

IotaBot Instagram API

Every DM and comment on your webhook. Reply from your code.

Get an API key

Instagram private replies API: comment to DM

Send a commenter a DM about their comment. Once per comment, within 7 days.

POST/v1/messagesmessages:sendThe API key needs the messages:send permission. Without it the call is refused with 403 insufficient_scope.Sign in to try

DM the commenter

Send to the comment's conversation with reply_as: "dm". It answers their latest comment.

Request
curl -X POST "https://api.iotabot.com/v1/messages" \
  -H "Authorization: Bearer $IOTABOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "conversation_id": "6a4bc7…",
  "text": "Here is the link you asked for: https://acme.com/blue",
  "reply_as": "dm"
}' \
  -H "Idempotency-Key: order-1042-shipped"
Response · 202
{
  "data": {
    "id": "6a4ba0f1c3f1a2b3c4d5e733",
    "object": "message",
    "status": "queued",
    "channel": "instagram",
    "conversation_id": "6a4b9e21c3f1a2b3c4d5e6f7",
    "created_at": "2026-10-01T09:16:10.004Z"
  }
}
Errors
window_closedconversation_closedintegration_pausedprivate_reply_expiredprivate_reply_usedrecipient_opted_outunsupported_attachmentfile_already_usedattachments_too_largeapi_quota_exceededidempotency_key_reusedidempotency_in_progress
  • Instagram allows one private reply per comment, within 7 days of it.
  • Text only. When they answer, it continues as a normal DM conversation with the 24-hour window.
  • The message shows reply_as: "dm"; public replies show reply_as: "comment".
POST/v1/test/inboundSign in to try

Try it with a simulated comment

With a test key: comment: true starts a comment thread.

Request
curl -X POST "https://api.iotabot.com/v1/test/inbound" \
  -H "Authorization: Bearer $IOTABOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "channel": "instagram",
  "from": "sandbox-ig-user-1",
  "name": "Priya",
  "text": "Price?",
  "comment": true
}'
Response · 201
{
  "data": {
    "livemode": false,
    "conversation": {
      "id": "6a4bc1…",
      "object": "conversation",
      "channel": "instagram",
      "status": "open",
      "mode": "ai"
    },
    "message": {
      "id": "6a4bc2…",
      "object": "message",
      "direction": "inbound",
      "text": "Hi, where is my order #1042?",
      "status": "received"
    }
  }
}
Errors
test_key_requiredchannel_not_allowedwebsite_not_allowed
CodeStatusWhat to do
private_reply_used422The comment already has its private reply — Instagram allows one per comment. Once the customer answers, reply in their DM conversation.
private_reply_expired422Instagram allows a private reply (reply_as: "dm") only within 7 days of the comment. Reply publicly instead.
text_required400The message has no content for its channel (text, html, a template or attachments).