---
title: "Search users"
method: GET
path: "/v1/{organization}/user/search/"
tags: ["User"]
---

# Search users

`GET /v1/{organization}/user/search/`

Search users in the organization using their names or emails.

#### Permissions
This endpoint may be impacted by the following permissions:
* Only users that the authenticated user has the `User:GetUserInfo` permission for will be returned.

## Path parameters

- `organization` string, required

## Query parameters

- `query` string, required — The search query. Any users whose name or email contains the query are returned.
- `user_id` string[] — The IDs of the users.

## Headers

- `x-mongo-cluster-name` string, nullable — The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
- `Sec-WebSocket-Protocol` string[]

## Response `200`

Succeeded.

- SrcAppEndpointsUserSearchUsersResponse
  - `users` SrcAppEndpointsUserSearchUsersResponseUserInstance[], required — Users in this organization.
    - `org_id` string, required — The ID of the organization that this user belongs to.
    - `user_id` string, required — The identifier of the user.
    - `first_name` string, required — The first name of the user.
    - `last_name` string, required — The last name of the user.
    - `email` string, required — Email of the user.
    - `user_stats` UserStats, required
      - `num_conversations` integer, required — The number of conversations the user has created.
      - `num_messages` integer, required — The number of messages the user has sent and received.
      - `last_message_time` string, date-time, nullable, required — The time of the last message the user sent or received. If `None`, the user hasn't started any conversations.
    - `role` string, required — The ID of the role of the user.
    - `preferences` PreferencesOutput, required — Preferences that the user can set to customize their experience.
      - `enable_response_recommendation` boolean — Whether to automatically recommend responses to the user if the user hasn't replied to the coach for a while.
      - `preferred_language` string, nullable — The preferred language to use for the user. This field must be in the ISO 639-3 format. The agent will attempt to converse with the user in this language. If not set, the agent's default spoken language is used.
      - `conversations_visible_to_admins` boolean — Whether the user's conversations are visible to the admins.
      - `user_model_visible_to_admins` boolean — Whether the user's user model is visible to the admins.
      - `timezone` string, nullable — The user's timezone in the IANA tz database format for all users in this organization. If not specified, UTC is used.
      - `audio_keyterms` string[] — A list of keyterms that are easy to get wrong during audio transcriptions that tend to occur commonly in audio sessions for this user.
    - `nonsensitive_variables` object, required — The user's nonsensitive variables.
    - `sensitive_variables` string[], required — The names of the user's sensitive variables. The values of these variables are not retrievable.

## Other responses

- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — Specified organization is not found.
- `422` — Invalid request path parameter or request query parameter failed validation.
- `429` — The user has exceeded the rate limit of 50 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

[API](https://skmtc.net/amigo/apis/amigo-api.md) · [All operations](https://skmtc.net/amigo/apis/amigo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/amigo/amigo-api/revisions/f0f28319e448/schema)
