GET /users/{userId} – Retrieves user given the ID.


Headers:

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

Body:

  • None

Path Parameters:

  • userId: The ID or email of the user to retrieve. (required)

Query Parameters:

  • userPoolId: The Cognito user pool ID (required for Cognito)
  • provider: The authentication provider (optional). Defaults to auth0-user.

  • 200 OK – Returns a JSON-stringified User object.

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/user_123?provider=auth0-user
GET /users/user_123?userPoolId=us-east-1_1234test&provider=cognito-user
{
"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
}

  • 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.