## Hide a chat

`POST /v1/chats/:dialogId/hide`

Removes a dialog from the current user's list, preserving messages and chat membership. A new message may return the dialog to the list.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|-------|----------|
| `dialogId` (path) | string | yes | The other user's numeric ID for direct messaging, `chatN` for a group chat or `me` for the current user. Source — [recent dialogs](/docs/chats/discovery/recent) |

No query parameters are accepted. Omit the request body or send `{}`. Additional body fields and non-object request bodies are rejected.

## Examples

### curl — personal key

```bash
curl -X POST https://vibecode.bitrix24.com/v1/chats/chat456/hide \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X POST https://vibecode.bitrix24.com/v1/chats/chat456/hide \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat456/hide', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const body = await res.json()
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat456/hide', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const body = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on success |
| `data` | boolean | `true` — the dialog is hidden |

## Response example

```json
{"success": true, "data": true}
```

## Error response example

400 — the unknown body field `folderId` was passed:

```json
{"success": false, "error": {"code": "INVALID_PARAMS", "message": "Body field `folderId` is not accepted by POST /v1/chats/:dialogId/hide. It takes no body fields."}}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | Unsupported query parameter, body field or request body type |
| 403 | `SCOPE_DENIED` | The key does not have the `im` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key permits reads only |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 refused access |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the action. Its code is preserved in `error.b24Code` |
| 401 | `TOKEN_MISSING` | No Bitrix24 tokens are configured for the key |
| 502 | `ME_ALIAS_RESOLUTION_FAILED` | The user could not be resolved for `me` |

For common API errors, see [Errors](/docs/errors).

## Known specifics

When the outcome of a network request is unknown, the platform does not retry hiding automatically.

## See also

- [Recent dialogs](/docs/chats/discovery/recent)
- [Leave a chat](/docs/chats/management/leave)
- [Chat management](/docs/chats/management)
