> For the complete documentation index, see [llms.txt](https://partners.botpenguin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partners.botpenguin.com/api-documentation/contact-and-chat-apis/get-all-contacts.md).

# Get All Contacts

## Get User Inbox

This API endpoint allows you to retrieve user data from the inbox. It provides various filtering options to customize the query.

**Endpoint URL:** [`https://api-v7.express-chat.com/inbox/users`](https://api-v7.express-chat.com)

**HTTP Method:** POST

#### Request Headers

* `Authorization`: A bearer token is required for authentication. Replace `[MASKED_TOKEN]` with your valid API token. This token is used to authenticate and authorize the request.

#### Request Body

The request body should be a JSON object containing various filtering criteria to customize the query. Here's a breakdown of the request body fields:

* `searchText` (string): Search text to filter users.
* `tags` (array): An array of tags to filter users.
* `status` (array): An array of status values to filter users.
* `isOnline` (boolean): Indicates whether users are online.
* `_botWebsite` (array): Filter users based on interactions on the website.
* `_botWhatsapp` (array): Filter users based on interactions on WhatsApp.
* `_botTelegram` (array): Filter users based on interactions on Telegram.
* `_botFacebook` (array): Filter users based on interactions on Facebook.
* `_agentAssigned` (array): Filter users assigned to specific agents.
* `segments` (array): An array of segments to filter users.
* `applicableFilters` (array): An array of applicable filters.
* `lastSeenAt` (object): Date range filter for the last seen timestamp.
* `createdAt` (object): Date range filter for the creation timestamp.
* `userInteracted` (boolean): Indicates whether users have interacted.
* `lastMessageBy` (array): Filter users based on the last message sender.
* `isLiveChatActive` (boolean): Indicates whether live chat is active for users.
* `hasOrdered` (object): Filter users based on their order history.

#### Sample Request

```bash
curl 'https://api-v7.express-chat.com/inbox/users' \
  -X 'POST' \
  -H 'Authorization: Bearer [MASKED_TOKEN]' \
  -H 'Content-Type: application/json' \
  -H 'authtype: Key' \
  -d '{
    "searchText": "",
    "tags": [],
    "status": [],
    "isOnline": false,
    "_botWebsite": [],
    "_botWhatsapp": [],
    "_botTelegram": [],
    "_botFacebook": [],
    "_agentAssigned": [],
    "segments": [],
    "applicableFilters": ["userInteracted"],
    "lastSeenAt": {
      "startAt": "",
      "endsAt": ""
    },
    "createdAt": {
      "startAt": "",
      "endsAt": ""
    },
    "userInteracted": true,
    "lastMessageBy": [],
    "isLiveChatActive": false,
    "hasOrdered": {
      "status": false,
      "lastAt": ""
    },
    "page": 1,
    "isExport": "none",
    "isContact": true
  }' \
  --compressed
```

Replace `[MASKED_TOKEN]` in the request with your actual API token and customize the request body filters as needed for your use case.

#### Response

The API will respond with a JSON object containing the user data based on the applied filters. The response format may vary depending on the data available and the applied filters.

Please replace `[MASKED_TOKEN]` in the request with your actual API token for actual usage.

#### Response Fields

| Field     | Type    | Description                                                                                              |
| --------- | ------- | -------------------------------------------------------------------------------------------------------- |
| `success` | Boolean | Indicates whether the API request was successful. `true` means the request was processed without errors. |
| `message` | String  | Contains an informational or error message. Empty when there is no message to display.                   |
| `data`    | Array   | Returns the response data. An empty array indicates no records were found or available.                  |
| `code`    | Number  | HTTP status code of the response. `200` indicates a successful request.                                  |

***

#### Example Response

```json
{
  "success": true,
  "message": "",
  "data": [],
  "code": 200
}
```

***

#### Notes

* A successful response with an empty `data` array means the API call worked correctly, but there is no data to return.
* Always check the `success` field before processing the `data`

### :question: Got any questions?

If you have any questions, you can look into our repository of FAQs, most likely, you will find your answer here, If not, write us at <support@botpenguin.com>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://partners.botpenguin.com/api-documentation/contact-and-chat-apis/get-all-contacts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
