GET /users – Retrieves user(s).

  • For Auth0, this endpoint returns only one user matching the query.
  • For Cognito, this endpoint returns a paginated list of users.
  • Returns comprehensive user profile information including security settings.
  • Sensitive information like passwords are never included in the response.

Headers:

  • Authorization: Bearer <access_token> (required)
  • Content-Type: application/json or application/x-www-form-urlencoded (required)

Body:

  • None

Path Parameters:

  • None

Query Parameters:

  • provider: The authentication provider (optional). Defaults to auth0-user.
  • Filters follow the type: UsersQueryFilter
  • For Auth0 (Although there are parameters for pagination, only one user will be returned):
  • q: Query string to search for users (e.g., email:"user@district123.com")
  • pageSize: Number of users to return (default: 1)
  • page: Page number to retrieve (default: 0)
  • sort: Field to sort by (e.g., created_at:-1 for descending)
  • fields: Comma-separated list of fields to include in the response
  • include_fields: Whether to include only the specified fields (true or false)
  • For Cognito:
  • userPoolId: The Cognito user pool ID (required for Cognito)
  • limit: Maximum number of users to return (default: 60, max: 60)
  • lastEvaluatedKey: Base64 encoded pagination token from previous response


Status Code Meaning When it Happens
400 Bad Request Missing or invalid parameters
401 Unauthorized Missing or invalid authentication token
404 Not Found User not found
500 Internal Server Error Unexpected error during user retrieval
{
"error": "Detailed error message here"
}

GET /users?q=email:"user@district123.com"
{
"id": "user_123",
"email": "user@district123.com",
"name": "John Doe",
"blocked": false,
"emailVerified": true,
"createdAt": "2025-09-12T12:00:00Z",
"updatedAt": "2025-09-12T12:00:00Z",
"appMetadata": {
// ...app metadata fields...
},
"userMetadata": {
// ...user metadata fields...
}
// Additional user fields
}
GET /users?userPoolId=us-east-1_1234test&limit=10&next=base64_encoded_pagination_token&provider=cognito-user
   [
{
"id": "generated_user_id",
"email": "user@example.com",
"name": "users full name",
"username": "same as id",
"emailVerified": "true",
"provider": "provider",
"connection": "userpool user is associated to",
"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",
"erpUserId": "erp id",
"erpTenants": "string list of tenants",
"appMetadata": {
"key": "value"
},
"userMetadata": {
"siteId": "siteId",
"homeroomId": "homeroomId",
}
}
],
"page": {
"size": 100,
"next": "base64 token"
}

  • Parameters

    • event: APIGatewayProxyEvent

      The API Gateway event containing the request.

    • context: Context
    • callback: Callback<APIGatewayProxyResult>

    Returns void | Promise<APIGatewayProxyResult>

    A Promise resolving to an API Gateway-compatible response.