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

# List Users

> Retrieve all users for a current app.

#### Recipes

<AccordionGroup>
  <Accordion title="Filter users by multiple criteria">
    <Steps>
      <Step title="1. Set a filter">
        Use a `filter` parameter to set a filter.

        Set a value type, search operator, and value to filter users by. You can set as many filters as you need.

        Here, the two filters are set:

        1. The users are filtered by the `facebook_id` field with a value less than the `50000`.
        2. The users are filtered by the `created_at` field with a value greater than the `2019-08-27T21:08:55Z`.

        ```curl {3} theme={null}
        curl -X GET \
        -H "QB-Token: da6be1483635df69b2993352d053c7aa8b012bba" \
        https://api.quickblox.com/users.json?filter[]=number+facebook_id+lt+50000&filter[]=date+created_at+gt+2019-08-27T21:08:55Z
        ```
      </Step>

      <Step title="2. As a result, the API returns users filtered by two criteria.">
        1. The users with the `facebook_id` value less than the `50000` are returned.
        2. The users with the `created_at` value greater than the `2019-08-27T21:08:55Z` are returned.

        ```curl theme={null}
        curl -X GET \
        -H "QB-Token: da6be1483635df69b2993352d053c7aa8b012bba" \
        https://api.quickblox.com/users.json?filter[]=number+facebook_id+lt+50000&filter[]=date+created_at+gt+2019-08-27T21:08:55Z
        ```
      </Step>
    </Steps>
  </Accordion>

  <Accordion title="Filter users by criteria">
    <Steps>
      <Step title="1. Set a filter">
        Use a `filter` parameter to set a filter.

        Set a value type, search operator, and value to filter users by.

        In this case, the users are filtered by the `facebook_id` with a value less than `50000`.

        ```curl {3} theme={null}
        curl -X GET \
        -H "QB-Token: fdb5f5a28388a64aba5b2f57570b13f827012bba" \
        https://api.quickblox.com/users.json?filter[]=number+facebook_id+lt+50000&page=2&per_page=2&order=asc+date+created_at
        ```
      </Step>

      <Step title="2. As a result, the API returns users by the specified criteria.">
        The users with the `facebook_id` value greater than `50000` are returned.

        ```curl theme={null}
        curl -X GET \
        -H "QB-Token: fdb5f5a28388a64aba5b2f57570b13f827012bba" \
        https://api.quickblox.com/users.json?filter[]=number+facebook_id+lt+50000&page=2&per_page=2&order=asc+date+created_at
        ```
      </Step>
    </Steps>
  </Accordion>

  <Accordion title="List users with API key">
    <Steps>
      <Step title="1. Use 'Authorization' header to pass API key">
        ```curl {3} theme={null}
        curl -X GET \
        -H 'Content-Type: application/json' \
        -H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
        https://api.quickblox.com/users.json
        ```
      </Step>

      <Step title="2. As a result, the API returns a list of users.">
        ```curl theme={null}
        curl -X GET \
        -H 'Content-Type: application/json' \
        -H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
        https://api.quickblox.com/users.json
        ```
      </Step>
    </Steps>
  </Accordion>
</AccordionGroup>

**Search operators**

The request can contain all, some or none of these parameters. If this option is set, its value is the object to validate. For example, if a `created_at` value is specified, the request will return only instances by the specified `created_at`value. Filters require an exact match of property values ​​with an instance of the corresponding parameter value.

| Operator | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| gt       | **Greater Than** operator  <br />  <br />Types: number, string, date  <br />  <br />Applicable to fields: id, created\_at, updated\_at, last\_request\_at, external\_user\_id, facebook\_id  <br />  <br />Example:  <br />filter\[]=number+external\_user\_id+gt+33  <br />filter\[]=date+updated\_at+gt+2019-05-23T18:07:19Z  <br />  <br />Will return users with `external_user_id` **greater than** 33.  <br />Will return users with updated\_at **greater than** 2019-05-23T18:07:19Z.                                                                                                                                                                                                                                                                                                                                    |
| lt       | **Less Than** operator  <br />  <br />Types: number, string, date  <br />  <br />Applicable to fields: id, created\_at, updated\_at, last\_request\_at, external\_user\_id, facebook\_id  <br />  <br />Example:  <br />filter\[]=number+id+lt+85000  <br />filter\[]=date+last\_request\_at+lt+2019-05-23T18:07:19Z  <br />  <br />Will return users with IDs **less than** 85000.  <br />Will return users with `last_request_at` **less than** 2019-05-23T18:07:19Z.                                                                                                                                                                                                                                                                                                                                                          |
| ge       | **Greater or Equal** to operator  <br />  <br />Types: number, string, date  <br />  <br />Applicable to fields: id, created\_at, updated\_at, last\_request\_at, external\_user\_id, facebook\_id  <br />  <br />Example:  <br />filter\[]=number+facebook\_id+ge+34524  <br />filter\[]=date+last\_request\_at+ge+2019-05-23T18:07:19Z  <br />  <br />Will return users with `facebook_id` **greater than or equal to** 34524.  <br />Will return users with `last_request_at` **greater than or equal to** 2019-05-23T18:07:19Z.                                                                                                                                                                                                                                                                                              |
| le       | **Less or Equal** to operator  <br />  <br />Types: number, string, date  <br />  <br />Applicable to fields: id, created\_at, updated\_at, last\_request\_at, external\_user\_id, facebook\_id  <br />  <br />Example:  <br />filter\[]=number+facebook\_id+le+34524  <br />filter\[]=date+created\_at+le+2019-05-23T18:07:19Z  <br />  <br />Will return users with `facebook_id` **less than or equal** 34524.  <br />Will return users with created\_at **less than or equal** 2019-05-23T18:07:19Z.                                                                                                                                                                                                                                                                                                                         |
| eq       | **Equal** to operator  <br />  <br />Types:number, string, date  <br />  <br />Applicable to fields: id, full\_name, email, login, phone, created\_at, updated\_at, last\_request\_at, external\_user\_id, facebook\_id  <br />  <br />Example:  <br />filter\[]=number+facebook\_id+eq+810  <br />filter\[]=[string+email+eq+test@gmail.com](mailto:string+email+eq+test@gmail.com)  <br />filter\[]=date+created\_at+eq+2019-04-22  <br />  <br />Will return a user with `facebook_id` **equal to** 810.  <br />Will return a user with email **equal to** [test@gmail.com.](mailto:test@gmail.com.)  <br />Will return a user with created\_at **equal to** 2019-04-22.                                                                                                                                                      |
| ne       | **Not Equal** to operator  <br />  <br />Types: number, string, date  <br />  <br />Applicable to fields: id, full\_name, email, login, phone, created\_at, updated\_at, last\_request\_at, external\_user\_id, facebook\_id  <br />  <br />Example:  <br />filter\[]=number+external\_user\_id +ne+810  <br />filter\[]=[string+email+ne+test@gmail.com](mailto:string+email+ne+test@gmail.com)  <br />filter\[]=date+created\_at+ne+2019-04-22T19:07:19Z  <br />  <br />Will return users with `external_user_id` **not equal to** 810.  <br />Will return users with email **not equal to** [test@gmail.com.](mailto:test@gmail.com.)  <br />Will return users with `created_at` **not equal to** 2019-04-22T19:07:19Z.                                                                                                       |
| between  | **Contained Between** values operator  <br />  <br />Types: number, string, date  <br />  <br />Applicable to fields: id, created\_at, updated\_at, last\_request\_at, external\_user\_id, facebook\_id  <br />  <br />Example: filter\[]=number+external\_user\_id+between+33,1000  <br />filter\[]=date+updated\_at+between+2019-04-22T19:07:19Z,2019-04-23T11:04:03Z  <br />  <br />Will return users with `external_user_id` **between** 3 and 1000.  <br />Will return users with `updated_at` **between** 2019-04-22T19:07:19Z and 2019-04-23T11:04:03Z.                                                                                                                                                                                                                                                                   |
| in       | **Contained IN** array operator  <br />  <br />Types: number, string, date  <br />  <br />Applicable to fields: id, full\_name, email, login, phone, created\_at, updated\_at, last\_request\_at, external\_user\_id, facebook\_id  <br />  <br />Example:  <br />filter\[]=number+external\_user\_id+in+33,555  <br />filter\[]=[string+email+in+test@test.com](mailto:string+email+in+test@test.com),[test@gmail.com](mailto:test@gmail.com)  <br />filter\[]=date+created\_at+in+2019-04-22T19:07:19Z,2019-04-22T19:08:38Z  <br />  <br />Will return users **with** `external_user_id` 33 and 555.  <br />Will return users **with** email [test@test.com](mailto:test@test.com) and [test@gmail.com.](mailto:test@gmail.com.)  <br />Will return users **with** `created_at` 2019-04-22T19:07:19Z and 2019-04-22T19:08:38Z. |

**Sort operators**

There can be any of the below-specified parameters or nothing in the query as the value for sorting. If there are other parameters within the query, the validation error is returned.

| Param | Possible values | Description                                                                                                                                                                                                                                                                                                                                       |
| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| order | asc, desc       | Types: string, number, date  <br />  <br />Applicable to fields: id, full\_name, email, login, phone, website, created\_at, updated\_at,  <br />last\_request\_at, external\_user\_id  <br />  <br />Example: order=asc+date  <br />+last\_request\_at  <br />  <br />Will return users with the `last_request_at` sorted in the ascending order. |

#### Query Parameters

<ParamField query="filter[]" type="string"> Review [Search Operators](#search-operators) section for more details. </ParamField>
<ParamField query="order" type="string"> Review [Sort operators](#sort-operators) section for more details. </ParamField>
<ParamField query="page" type="integer" default="1"> Page of results to return. </ParamField>
<ParamField query="per_page" type="integer" default="10"> Number of records to return in one request. Min: 1. Max: 100. </ParamField>

#### Headers

<ParamField header="QB-Token" type="string" required> A user session token. See [Authentication](/reference/authentication) page to learn more about the session token. </ParamField>

<ParamField header="Authorization" type="string" required default="ApiKey {your_api_key}"> API key from Dashboard. Expected format: `ApiKey {your_api_key}`. Must be used either QB-Token or Authorization.</ParamField>

#### Responses

<AccordionGroup>
  <Accordion title="200">
    A successful response

    <ResponseField name="current_page" type="integer" />

    <ResponseField name="per_page" type="integer" />

    <ResponseField name="total_entries" type="integer" />

    <ResponseField name="items" type="array of objects">
      <Expandable title="properties">
        <ResponseField name="user" type="object">
          <Expandable title="properties">
            <ResponseField name="id" type="integer" />

            <ResponseField name="full_name" type="string" />

            <ResponseField name="email" type="string" />

            <ResponseField name="login" type="string" />

            <ResponseField name="phone" type="string" />

            <ResponseField name="website" type="string" />

            <ResponseField name="created_at" type="string" />

            <ResponseField name="updated_at" type="string" />

            <ResponseField name="last_request_at" type="string" />

            <ResponseField name="external_user_id" type="integer" />

            <ResponseField name="facebook_id" type="string" />

            <ResponseField name="twitter_id" type="string" />

            <ResponseField name="blob_id" type="string" />

            <ResponseField name="custom_data" type="string" />

            <ResponseField name="age_over16" type="boolean" />

            <ResponseField name="allow_statistics_analysis" type="boolean" />

            <ResponseField name="allow_sales_activities" type="boolean" />

            <ResponseField name="parents_contacts" type="string" />

            <ResponseField name="user_tags" type="string" />
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>

  <Accordion title="403">
    An error response

    <ResponseField name="errors" type="object">
      <Expandable title="properties">
        <ResponseField name="base" type="array of strings" />
      </Expandable>
    </ResponseField>
  </Accordion>
</AccordionGroup>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET \
  -H "QB-Token: fdb5f5a28388a64aba5b2f57570b13f827012bba" \
  https://api.quickblox.com/users.json
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "current_page": 1,
    "per_page": 10,
    "total_entries": 2,
    "items": [
      {
        "user": {
          "id": 96753878,
          "full_name": "Peter Smith",
          "email": "peter@gmail.com",
          "login": "Peter",
          "phone": "+73123555",
          "website": "https://mysite.com",
          "created_at": "2019-08-27T20:49:07Z",
          "updated_at": "2019-09-01T12:23:08Z",
          "last_request_at": "2019-08-29T20:48:14Z",
          "external_user_id": 1236672,
          "facebook_id": "15868",
          "twitter_id": "9982366",
          "blob_id": null,
          "custom_data": "lead of marketing team",
          "age_over16": true,
          "allow_statistics_analysis": true,
          "allow_sales_activities": true,
          "parents_contacts": "",
          "user_tags": "Marketing,seo"
        }
      },
      {
        "user": {
          "id": 96754523,
          "full_name": "Alex Miller",
          "email": "alex@gmail.com",
          "login": "Alex",
          "phone": "+3123555",
          "website": "https://mysite.com",
          "created_at": "2019-08-27T21:08:55Z",
          "updated_at": "2019-09-01T12:36:59Z",
          "last_request_at": null,
          "external_user_id": 126672,
          "facebook_id": "5844",
          "twitter_id": "982366",
          "blob_id": null,
          "custom_data": null,
          "age_over16": true,
          "allow_statistics_analysis": true,
          "allow_sales_activities": true,
          "parents_contacts": "",
          "user_tags": "Android,web"
        }
      }
    ]
  }
  ```

  ```json 403 theme={null}
  {
    "errors": {
      "base": [
        "Users retrieving forbidden in admin panel, application settings. Setup it here https://admin.quickblox.com/apps/{app_id}/service/users/settings"
      ]
    }
  }
  ```
</ResponseExample>
