# Inbox and automations (/growsocmed/docs/developers/inbox-and-automations)

Read and answer Instagram DMs, and set up automatic answers through the API.

## Inbox [#inbox]

The Inbox holds the Instagram DM conversations of your accounts.

- [`GET /inbox/conversations`](/growsocmed/docs/api-reference/inbox/list-conversations): latest message first. `status` is `open` (default), `needs_you` (an AI agent handed the conversation to the team), `done` or `all`; `q` searches.
- [`GET /inbox/conversations/{id}/messages`](/growsocmed/docs/api-reference/inbox/list-messages): oldest first; reading marks the conversation read.
- [`POST /inbox/conversations/{id}/messages`](/growsocmed/docs/api-reference/inbox/send-message): send `text` (up to 1,000 characters) and/or one `media_id` from the media library (a photo up to 8 MB or a video up to 25 MB).
- [`PATCH /inbox/conversations/{id}`](/growsocmed/docs/api-reference/inbox/update-conversation): `status` `open` or `done`; `needs_you: false` hands the conversation back to the AI agent. [`POST /inbox/conversations/resolve`](/growsocmed/docs/api-reference/inbox/resolve-conversations) does the same for many.
- Also: [retry a failed DM](/growsocmed/docs/api-reference/inbox/retry-message), [react with a heart](/growsocmed/docs/api-reference/inbox/react-to-message), [show typing](/growsocmed/docs/api-reference/inbox/send-typing), [download an attachment](/growsocmed/docs/api-reference/inbox/download-attachment), [saved replies](/growsocmed/docs/api-reference/inbox/list-saved-replies), and [let an agent draft a reply](/growsocmed/docs/api-reference/inbox/draft-message-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 [#automations]

An automation answers things that arrive after it is switched on, on one account. Create one with [`POST /automations`](/growsocmed/docs/api-reference/automations/create-automation):

```json
{
  "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. | Instagram |
| `dm_keyword` | Answers DMs that contain keywords. | Instagram |
| `default_reply` | Answers DMs no other automation answered, at most once per person per `frequency`. | Instagram |
| `story_reply` | Answers replies to your stories. | Instagram |
| `story_mention` | Answers people who mention you in their story. | Instagram |
| `ice_breaker` | Questions shown when someone opens a chat, each with its answer (1–4). | Instagram |
| `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`](/growsocmed/docs/api-reference/automations/list-automations) returns each automation with its counts (sent, skipped, failed, clicks, follows, click rate), and [`GET /automations/{id}/runs`](/growsocmed/docs/api-reference/automations/list-automation-runs) the latest runs with their outcome and reason. The [`automation.run`](/growsocmed/docs/developers/webhooks) webhook reports each run as it ends.