Inbox and automations
Read and answer Instagram DMs, and set up automatic answers through the API.
Inbox
The Inbox holds the Instagram DM conversations of your accounts.
GET /inbox/conversations: latest message first.statusisopen(default),needs_you(an AI agent handed the conversation to the team),doneorall;qsearches.GET /inbox/conversations/{id}/messages: oldest first; reading marks the conversation read.POST /inbox/conversations/{id}/messages: sendtext(up to 1,000 characters) and/or onemedia_idfrom the media library (a photo up to 8 MB or a video up to 25 MB).PATCH /inbox/conversations/{id}:statusopenordone;needs_you: falsehands the conversation back to the AI agent.POST /inbox/conversations/resolvedoes the same for many.- Also: retry a failed DM, react with a heart, show typing, download an attachment, saved replies, and let an agent draft a reply.
Instagram only allows a business to answer within 24 hours of the person's last message. A message Instagram refuses is kept as failed, so you can retry it.
Automations
An automation answers things that arrive after it is switched on, on one account. Create one with POST /automations:
{
"account_id": "6b1e…",
"name": "Price list by DM",
"kind": "comment_to_dm",
"trigger": { "posts": "all", "match": "contains", "keywords": ["price", "harga"] },
"actions": {
"dmText": "Here is our price list.",
"buttons": [{ "title": "Price list", "url": "https://example.com/prices" }],
"trackClicks": true,
"replyVariants": ["Sent you a DM!"]
},
"delay": "natural",
"once_per_person": true,
"enabled": true
}kind | Does | Platforms |
|---|---|---|
comment_to_dm | Sends a DM to people who comment. | |
dm_keyword | Answers DMs that contain keywords. | |
default_reply | Answers DMs no other automation answered, at most once per person per frequency. | |
story_reply | Answers replies to your stories. | |
story_mention | Answers people who mention you in their story. | |
ice_breaker | Questions shown when someone opens a chat, each with its answer (1–4). | |
comment_reply | Replies publicly to comments (Threads, Facebook and others need at least 3 replyVariants). | Instagram, Facebook Page, Threads, YouTube, TikTok, Telegram |
comment_hide | Hides comments with the listed words. | Instagram, Facebook Page, Threads, YouTube, TikTok, Telegram |
comment_like | Likes comments. | Facebook Page, TikTok |
TikTok automations need TikTok Business connected on the account.
trigger: posts (all, next for the next post, or a list of platform post ids), match (any, contains, exact), keywords (up to 200), includeReplies, frequency (hour, day, week). actions: dmText (up to 1,000 characters, 640 with buttons), replyVariants (up to 5), agentId (an AI agent answers instead), buttons (up to 3 links), trackClicks, requireFollow (the DM is sent once the person follows), heart, markAutomated, iceBreakers. delay is fast, natural (default) or relaxed. Automations are created switched off unless you send enabled: true.
GET /automations returns each automation with its counts (sent, skipped, failed, clicks, follows, click rate), and GET /automations/{id}/runs the latest runs with their outcome and reason. The automation.run webhook reports each run as it ends.