Skip to main content
This flow can be executed using a human or a machine user.For machine users:
  • Send a valid Authorization header with of type Bearer TOKEN_VALUE where TOKEN_VALUE is the a JWT returned in the response from Machine User Token flow
For human users:
  • Allowed roles : Org User manager and Org Owner (Admin)
  • Send a valid Authorization header with of type Bearer TOKEN_VALUE where TOKEN_VALUE is the token returned in the response from Sign up or Sign in flow
In case your app supports cookie, you can enable request cookies as our API Automatically sets a cookie named session-token which is forwarded with each request to our api.
This API Will return users for an organization, based on the search criteria provided. If you want list of all users of an organization, you can refer Get All Users of organization endpoint.
To get users from an organization based on the search criteria, you need to make a POST request to the following endpoint:

Headers

1

x-iam-orgid

Specify the Organization Id here. Example: 281185056586736799
curl --request POST \
  --url https://dev-iam.razi.ai/v1/authorization/organizations/users/search \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Name: ' \
  --header 'X-Iam-Orgid: ' \
  --data '{
  "name": "example name",
  "email": "[email protected]",
  "userId": "698353537865",
  "role": "admin"
}'

Query Parameters

1

page (optional, number)

Specifies the page number to retrieve. Use this parameter to paginate through large sets of organizations. Defaults to 0 if not provided. Example: ?page=2
2

pageSize (required, number)

Specifies the number of organizations to return per page. This helps to control the size of the response data. pageSize must not be greater than 100. Example: ?pageSize=10

Search Parameters

The following parameters are supported to search users:
1

name

To search the users in the organization based on the name, you need to pass the name in the request body. This search parameter allows partial text matching.
2

email

To search the users in the organization based on the mail, you need to pass the email of the user in the request body. This search parameter allows partial text matching.
3

userId

To search the users in the organization based on the user’s ID, you need to pass the user id in the request body.
4

role

To search the users in the organization based on the user assigned role, you need to pass the role in the request body.
The search operation is exclusive and applies AND logic between parameters. This means that if multiple parameters are provided (e.g., name, email, and role), only users that match all specified criteria will be returned.
Upon successful request, you will receive a paginated response similar to the below:
{
  "metadata": {
    "total": 10
  },
  "users": [
    {
      "id": "1234567890",
      "email": "[email protected]",
      "roles": [
        "admin",
        "user"
      ],
      "firstName": "John",
      "lastName": "Doe",
      "displayName": "John Doe"
    }
  ]
}
  • metadata.total: The total number of users available in the organization.
  • users: A list of users objects, with details of the user returned based on the search criteria