POST /users/search – Searches for users based on provided criteria.
Headers:
Authorization: Bearer <access_token>
Content-Type: application/json or application/x-www-form-urlencoded
Body:
Path Parameters:
Query Parameters:
The search results are paginated with configurable size limits.
200 OK
400
401
500
{ "error": "Detailed error message here"} Copy
{ "error": "Detailed error message here"}
POST /users/search{ "provider": "auth0-user", "query": { "query": { "bool": { "must": [ { "email": "user@district123.com" }, { "givenName": "John" } ], "filter": [ { "role": "admin" }, { "appMetadata.createdBy": "SCRIPT" } ], "must_not": [ { "blocked": true } ], "should": [ { "emailVerified": true } ], "minimum_should_match": "1", "boost": 1.0 } } }} Copy
POST /users/search{ "provider": "auth0-user", "query": { "query": { "bool": { "must": [ { "email": "user@district123.com" }, { "givenName": "John" } ], "filter": [ { "role": "admin" }, { "appMetadata.createdBy": "SCRIPT" } ], "must_not": [ { "blocked": true } ], "should": [ { "emailVerified": true } ], "minimum_should_match": "1", "boost": 1.0 } } }}
POST /users/search{ "provider": "cognito-user", "userPoolId": "us-east-1_1234test", "query": { "filter": { "email": "test@test.com", "username": "username", "firstName": "first name", "lastName": "last name", "principalId": "users principalId", "legacyOnlineOrderingId": "users auth0 online ordering id", "districtId": "guid", "role": "parent", "admin": "super", "createdAt": "date", "updatedAt": "date", }, "from": 0, "limit": 10, "sortBy": "filter field to sort by", "sort": "asc or desc", "next": "next token" }} Copy
POST /users/search{ "provider": "cognito-user", "userPoolId": "us-east-1_1234test", "query": { "filter": { "email": "test@test.com", "username": "username", "firstName": "first name", "lastName": "last name", "principalId": "users principalId", "legacyOnlineOrderingId": "users auth0 online ordering id", "districtId": "guid", "role": "parent", "admin": "super", "createdAt": "date", "updatedAt": "date", }, "from": 0, "limit": 10, "sortBy": "filter field to sort by", "sort": "asc or desc", "next": "next token" }}
{ "collection": [ { "id": "generated_user_id", "email": "user@district123.com", "username": "same as id", "emailVerified": "true", "provider": "provider", "connection": "userpool user is associated to", "name": "users full name", "firstName": "John", "lastName": "Doe", "phoneNumber": "+1234567890", "phoneVerified": "true", "status": "ACTIVE", "createdAt": "2023-12-20T00:00:00Z", "updatedAt": "2023-12-20T00:00:00Z", "disabled": false, "blocked": false, "principalId": "id associated to user", "legacyOnlineOrderingId": "id associated to user", "districtId": "district id associated to user", "admin": "admin role", "role": "role associated to user", "appMetadata": {}, "userMetadata": {} } ], "count": 1, "total": 100, "limit": 10, "next": "next token for pagination"} Copy
{ "collection": [ { "id": "generated_user_id", "email": "user@district123.com", "username": "same as id", "emailVerified": "true", "provider": "provider", "connection": "userpool user is associated to", "name": "users full name", "firstName": "John", "lastName": "Doe", "phoneNumber": "+1234567890", "phoneVerified": "true", "status": "ACTIVE", "createdAt": "2023-12-20T00:00:00Z", "updatedAt": "2023-12-20T00:00:00Z", "disabled": false, "blocked": false, "principalId": "id associated to user", "legacyOnlineOrderingId": "id associated to user", "districtId": "district id associated to user", "admin": "admin role", "role": "role associated to user", "appMetadata": {}, "userMetadata": {} } ], "count": 1, "total": 100, "limit": 10, "next": "next token for pagination"}
The API Gateway event containing the request.
A Promise resolving to an API Gateway-compatible response.
POST /users/search – Searches for users based on provided criteria.
📥 Request
Headers:
Authorization: Bearer <access_token>(required)Content-Type: application/json or application/x-www-form-urlencoded(required)Body:
Path Parameters:
Query Parameters:
Remarks
The search results are paginated with configurable size limits.
📤 Response
200 OK– Returns a JSON-stringified CollectionData of User objects.❗ Errors
400401500Error Response Format
📦 Examples
📥 Auth0 Request
📥 Cognito Request
📤 Response Example