> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Block and unblock users to control messaging access.

A user can block another user if the user doesn't wish to receive any messages or notifications from the blocked user.\
Once any user is blocked, all the communication to and from the respective user will be completely blocked.\
Once the user is unblocked, the newly sent messages will start to receive. However the messages that was sent during the blocked period won't be visible.

### Available operations

| Method | Endpoint                    | Description               |
| ------ | --------------------------- | ------------------------- |
| POST   | `/users/{uid}/blockedusers` | Block one or more users   |
| GET    | `/users/{uid}/blockedusers` | List all blocked users    |
| DELETE | `/users/{uid}/blockedusers` | Unblock one or more users |

### Blocked user properties

The following table lists the properties that the Blocked User API supports.

| Parameters  | Type             | Description                                                       |
| ----------- | ---------------- | ----------------------------------------------------------------- |
| blockedUids | array of strings | (*optional*) Indicates the list of uids that needs to be blocked. |

### Error handling

| Error Code                  | Description                                 |
| --------------------------- | ------------------------------------------- |
| `AUTH_ERR_EMPTY_APIKEY`     | API key is missing from the request headers |
| `AUTH_ERR_APIKEY_NOT_FOUND` | The provided API key is invalid             |
| `ERR_UID_NOT_FOUND`         | The specified user UID does not exist       |

For the complete list of error codes, see [Error Guide](/articles/error-guide).
