# Send Instagram message

> Send an Instagram DM or a private reply to a comment, with optional buttons.

Canonical: <https://www.tryadeli.com/docs/api/messages/send-instagram-message>

`POST https://app.tryadeli.com/api/v1/messages/instagram`

Authorization: `Bearer <API key>` — see [Authentication](https://www.tryadeli.com/docs/authentication)

Send an Instagram DM, or a **private reply** to the author of a comment, as
text or with up to three buttons. This is how a comment-to-DM flow works: reply
privately to a comment with a button, and when the person taps it, send them a
follow-up.

**Body**

| Name        | Type                      | Required | Description                                                                                                                                                                                                                |
| ----------- | ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accountId` | `uuid`                    | Yes      | A connected Instagram account in your organization.                                                                                                                                                                        |
| `profileId` | `uuid`                    |          | Optional, because accountId names its profile. If you pass both, they must agree.                                                                                                                                          |
| `recipient` | `{ id } \| { commentId }` | Yes      | `{ id }` is a person's Instagram-scoped id, such as a comment's `authorId` from [List comments](https://www.tryadeli.com/docs/api/comments/list-comments). `{ commentId }` sends a private reply to that comment's author. |
| `text`      | `string`                  | Yes      | 1–1,000 characters, or up to 640 with buttons.                                                                                                                                                                             |
| `buttons`   | `Button[]`                |          | 1–3 buttons. `{ type: "postback", title, payload }` sends `payload` back to you when tapped; `{ type: "url", title, url }` opens an `https` link. Titles are up to 20 characters, payloads up to 1,000.                    |

Success returns `201` and a message object with `type: "text"` or
`type: "buttons"`. `recipient` is the person's Instagram-scoped id, even for a
private reply, so you can message them again once they respond.

> **Note: Private replies**
>
> Instagram allows **one** private reply per comment, within 7 days of the
> comment. A second attempt returns `409 private_reply_already_sent`. An account
> connected before Unified Login through a Facebook Page (`authMethod:
>   "facebook_login"`) returns `400 unsupported_for_platform` until it is
> reconnected. After a private reply you can
> message the person again only once they respond, for example by tapping a
> postback button; until then a DM returns `409 window_closed`.

**Errors** — `401 unauthorized`, `400 invalid_request`,
`400 unsupported_for_platform`, `404 profile_not_found`,
`404 account_not_found`, `409 window_closed`, `409 private_reply_already_sent`,
`403 permission_required` with missing permission and reconnect details,
`422 connection_expired`, `502 provider_error`.

## Request examples

**cURL**

```bash
curl -X POST "https://app.tryadeli.com/api/v1/messages/instagram" \
  -H "Authorization: Bearer $ADELI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "00000000-0000-0000-0000-000000000000",
  "recipient": {
    "commentId": "17966240925214757"
  },
  "text": "Thanks for the comment! Tap below and I'\''ll send you the guide.",
  "buttons": [
    {
      "type": "postback",
      "title": "Send it",
      "payload": "guide-request-42"
    }
  ]
}'
```

**JavaScript**

```javascript
const response = await fetch("https://app.tryadeli.com/api/v1/messages/instagram", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ADELI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "00000000-0000-0000-0000-000000000000",
    recipient: {
      commentId: "17966240925214757",
    },
    text: "Thanks for the comment! Tap below and I'll send you the guide.",
    buttons: [
      {
        type: "postback",
        title: "Send it",
        payload: "guide-request-42",
      },
    ],
  }),
});
console.log(await response.json());
```

**Python**

```python
import os

import requests

response = requests.post(
    "https://app.tryadeli.com/api/v1/messages/instagram",
    headers={"Authorization": f"Bearer {os.environ['ADELI_API_KEY']}"},
    json={
        "accountId": "00000000-0000-0000-0000-000000000000",
        "recipient": {
            "commentId": "17966240925214757",
        },
        "text": "Thanks for the comment! Tap below and I'll send you the guide.",
        "buttons": [
            {
                "type": "postback",
                "title": "Send it",
                "payload": "guide-request-42",
            },
        ],
    },
)
print(response.json())
```

## Responses

### 201

```json
{
  "id": "instagram_message_aWdfbWlkMw",
  "providerId": "aWdfbWlkMw",
  "platform": "instagram",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "profileId": "00000000-0000-4000-8000-000000000001",
  "direction": "outbound",
  "type": "buttons",
  "recipient": "17841400000000001",
  "sender": "17841400000000000",
  "body": "Thanks for the comment! Tap below and I'll send you the guide.",
  "status": "sent",
  "occurredAt": "2026-10-27T21:20:00.000Z",
  "createdAt": "2026-10-27T21:20:00.000Z"
}
```

### 409

```json
{
  "error": {
    "code": "private_reply_already_sent",
    "message": "This comment has already received its one private reply"
  }
}
```
