# Search Users

## Search Organization Members

<mark style="color:blue;">`GET`</mark> `https://{server_address}/api/v1/organization/search/users`

`sortBy` query parameter could accept the following values: `User Id`, `Name`, `Email`, `Status`, `Role`, `Organization Name`, `Devices Count` (stands for count of devices, that user own), `Country`, `Registered At`, `Phone Number`.

#### Query Parameters

| Name                                    | Type    | Description                                                                                               |
| --------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| query<mark style="color:red;">\*</mark> | John    | Search query. Should be up to 255 symbols.                                                                |
| page                                    | 0       | Page number starting from 0. First page by default.                                                       |
| size                                    | 20      | Page size. Should be from 1 to 100. 20 by default.                                                        |
| sortBy                                  | User Id | Field to sort result by.                                                                                  |
| sortOrder                               | ASC     | Sorting order. Could be `ASC` (ascending sort order) or `DESC` (descending sort order). `ASC` by default. |

#### Headers

| Name                                            | Type                   | Description |
| ----------------------------------------------- | ---------------------- | ----------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer {access\_token} |             |

{% tabs %}
{% tab title="200: OK Organization members" %}

```json
{
   "content": [
      {
         "id": 1080,
         "name": "John Doe",
         "email": "john@example.com",
         "roleId": 3,
         "orgId": 704,
         "isDev": false
      }
   ],
   "totalElements": 1
}
```

{% endtab %}
{% endtabs %}

Request examples:

```bash
# curl command example:
$ curl -H "Authorization: Bearer {accessToken}" https://fra1.blynk.cloud/api/v1/organization/search/users?query=john
$ curl -H "Authorization: Bearer eIdWHQqRfFmvP5LDDh-IGxPUzi7I27HthzCPAVmS" https://fra1.blynk.cloud/api/v1/organization/search/users?query=john
```
