<!-- Generated from the canonical 99 Digital API documentation. Do not edit this file. -->

Canonical page: https://docs.99digital.co.il/facebook-api/instagram-pages/private-reply

# Private Reply

`POST https://api.99digital.co.il/instagram/page/privateReply`

This endpoint allows you to send a direct message private reply (DM) to a user that left a comment on your post.

You are allowed to send a one-time private reply to a person who wrote a public comment on your media post: you can only send one private reply per comment, within 7 days of when it was written.

If the user replies, you can keep chatting with them during a 24-hour open session. You can reply to them directly in Instagram DM, or using the Instagram Messenger API if you connected it.

**Settings**:

| Setting | Value |
| --- | --- |
| URL | `https://api.99digital.co.il/instagram/page/privateReply` |
| Method | JSON via POST |
| Header | Your API key for the service (the `apiKey` header) |

**Body**:

| Parameter | Description / Example | Mandatory | Example |
| --- | --- | --- | --- |
| from | The ID you received for the connection | yes | 463745743546345 |
| commentId | The comment ID that was posted on your media post, of which you wish to send the private reply to the visitor (the id of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments)) | yes | 652346734563_3463234623 |
| body | The private message (DM) you want to send to the visitor that wrote the comment. 1,000 bytes maximum (UTF-8): an English letter, a digit or a space is 1 byte, a Hebrew letter 2 bytes, and an emoji usually 4 bytes | yes | Thank you for the comment! Here are our special deals |

**Response**:

```json
{
  "status": "OK",
  "commentId": "15234562345623_425235245346",
  "from": "463745743546345",
  "messageId": "aWdfZG06MTpnaDoxMjM0NTY3ODkwOjM0",
  "body": "Thank you for the comment! Here are our special deals",
  "timestamp": 1600115719,
  "reason": 1
}
```

**Response-Explain**:

| Parameter | Description |
| --- | --- |
| status | OK or FAIL |
| commentId | The original commentId provided in the request (the comment you replied to) |
| messageId | The DM message ID (the ID of the private message that was sent) |
| timestamp | Time stamp of the message |
| from | Your ID for the service |
| body | The message you wrote |

**reason**:

| Value | Information |
| --- | --- |
| 1 | Not FAIL. The status is OK |
| 2 | Your "from" account does not exist (for example, its onboarding is not finished yet) or is missing, or JSON syntax error |
| 3 | Wrong apiKey (the apiKey header is missing or wrong) |
| 4 | commentId is missing (or is not a valid comment ID) |
| 5 | Missing or invalid content: the 'body' is missing or empty |
| 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) |
| 7 | The connection is not active (it was disabled) |
| 8 | The "body" is more than 1,000 bytes long |
| 10 | You must do the onboarding again, the connection has expired |
| 11 | A permission is missing: the connection does not have Meta's permission for this action |
| 12 | Rate limit error. Too many requests. Please wait a few minutes and try again |
| 13 | The commentId is invalid or wrong: the comment was not found, or it is not accessible |
| 14 | You already sent a private reply to this comment, or it is more than 7 days old. Meta allows one private reply, within 7 days |
| 15 | The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content |
| 18 | General error, try again |

## Authentication

`apiKey` in the header — Your API key for the service.

## Request body

Content type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. |
| `commentId` | string | Yes | The comment ID that was posted on your media post, of which you wish to send the private reply to the visitor (the `id` of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments)). Example: `17870913679156914`. |
| `body` | string | Yes | The private message (DM) you want to send to the visitor that wrote the comment. 1,000 bytes maximum (UTF-8): an English letter, a digit or a space is 1 byte, a Hebrew letter 2 bytes, and an emoji usually 4 bytes. Example: `Thank you for the comment! Here are our special deals.`. |

### Example (generated from the schema)

```json
{
  "from": "463745743546345",
  "commentId": "17870913679156914",
  "body": "Thank you for the comment! Here are our special deals."
}
```

## Responses

### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `status` | string | (one of: OK) OK or FAIL. `OK` — the private reply was sent. Always `OK`. |
| `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. |
| `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1600115719`. |
| `commentId` | string | (one of: OK) The original commentId provided in the request (the comment you replied to). Example: `17870913679156914`. |
| `messageId` | string | (one of: OK) The DM message ID (the ID of the private message that was sent). Example: `aWdfZG06MTpnaDoxMjM0NTY3ODkwOjM0`. |
| `body` | string | (one of: OK) The message you wrote. Example: `Thank you for the comment! Here are our special deals.`. |
| `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. |
| `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. |
| `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (for example, its onboarding is not finished yet) or is missing, or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `4` — The 'commentId' is missing (or is not a valid comment ID); `5` — Missing or invalid content — the 'body' is missing or empty; `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — The connection is not active (it was disabled); `8` — The 'body' is more than 1,000 bytes long; `10` — You must do the onboarding again, the connection has expired; `11` — A permission is missing: the connection does not have Meta's permission for this action; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `commentId` is invalid or wrong: the comment was not found, or it is not accessible; `14` — You already sent a private reply to this comment, or it is more than 7 days old — Meta allows one private reply, within 7 days; `15` — The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error, try again. |
| `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. |

#### Example: OK

The private reply was sent to the person who wrote the comment.

```json
{
  "status": "OK",
  "from": "463745743546345",
  "timestamp": 1600115719,
  "reason": 1,
  "commentId": "17870913679156914",
  "messageId": "aWdfZG06MTpnaDoxMjM0NTY3ODkwOjM0",
  "body": "Thank you for the comment! Here are our special deals."
}
```

#### Example: Reason 4

'commentId' is missing or is not a valid comment ID.

```json
{
  "status": "FAIL",
  "reason": 4
}
```

#### Example: Reason 5

'body' is missing or empty.

```json
{
  "status": "FAIL",
  "reason": 5
}
```

#### Example: Reason 8

'body' is more than 1,000 bytes long.

```json
{
  "status": "FAIL",
  "reason": 8
}
```

#### Example: Reason 13

The comment was not found, or it is not accessible.

```json
{
  "status": "FAIL",
  "reason": 13,
  "from": "463745743546345"
}
```
