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

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

# Hide Comment

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

Hide a comment allows you to make a comment hidden (or back to visible) from the public, so it stays visible only to the writer of the comment, their friends and the admin of the page.

**Settings**:

| Setting | Value |
| --- | --- |
| URL | `https://api.99digital.co.il/instagram/page/hideComment` |
| 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 you wish to do the action on (the id of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments)) | yes | 652346734563_3463234623 |
| hide | 1 - hide. 0 - unhide. If you leave it out, the comment is hidden. true / false work too, as a number or a string; any other value returns reason 8 | no (default 1) | 1 |

**Response**:

```json
{
  "status": "OK",
  "commentId": "15234562345623_952362434423178",
  "from": "463745743546345",
  "timestamp": 1600115719,
  "hidden": true,
  "reason": 1
}
```

**Response-Explain**:

| Parameter | Description |
| --- | --- |
| status | OK or FAIL |
| commentId | The comment ID you did the action on (hid or unhid) |
| from | Your ID for the service |
| timestamp | Time stamp of the message |
| hidden | true if the comment was hidden. false if the comment is not hidden |

**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 invalid or wrong (missing, or not a valid comment ID) |
| 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 | 'hide' is not 1 or 0 (or true / false) |
| 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 |
| 15 | Meta rejected the request: an invalid parameter, or a policy violation |
| 18 | General error, try again |

**Remarks**:

- Hiding is reversible: send `hide` 0 to make the comment visible again. To
  remove a comment for good, use
  [Delete Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/delete-comment).
- Hiding or unhiding an Instagram comment sends no webhook: Instagram does
  not report it (see [Instagram Comment](https://docs.99digital.co.il/facebook-api/webhooks/instagram-comment)).

## 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 you wish to do the action on — the `id` of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments). Example: `17870913679156914`. |
| `hide` | integer | No | 1 - hide, 0 - unhide. If you leave it out, the comment is hidden. `true` / `false` work too, as a number or a string; any other value returns reason 8. One of: `0` — Unhide — the comment is visible to the public again; `1` — Hide — the comment stays visible only to its writer, their friends and the admin of the page. Default: `1`. |

### Example: Hide

Hide the comment from the public.

```json
{
  "from": "463745743546345",
  "commentId": "17870913679156914",
  "hide": 1
}
```

### Example: Unhide

Make the comment visible to the public again.

```json
{
  "from": "463745743546345",
  "commentId": "17870913679156914",
  "hide": 0
}
```

## 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 change was made. 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 comment ID you did the action on (hid or unhid). Example: `17870913679156914`. |
| `hidden` | boolean | (one of: OK) `true` if the comment was hidden. `false` if the comment is not hidden. |
| `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 invalid or wrong (missing, or not a valid comment ID); `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` — 'hide' is not 1 or 0 (or true / false); `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; `15` — Meta rejected the request: an invalid parameter, or a policy violation; `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 comment is hidden.

```json
{
  "status": "OK",
  "from": "463745743546345",
  "timestamp": 1600115719,
  "reason": 1,
  "commentId": "17870913679156914",
  "hidden": true
}
```

#### Example: OK — unhidden

The comment is visible to the public again.

```json
{
  "status": "OK",
  "from": "463745743546345",
  "timestamp": 1600115719,
  "reason": 1,
  "commentId": "17870913679156914",
  "hidden": false
}
```

#### Example: Reason 4

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

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

#### Example: Reason 10

The connection has expired — do onboarding again.

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