DELETE /users/{userId} – Deletes a user with the given ID.


Headers:

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

Body:

  • Must conform to DeleteUserRequest, but the userId is a path parameter (not in body).

Path Parameters:

  • userId: The user ID of which user to delete (required)

Query Parameters:

  • None

  • 204 No Content – Indicates successful deletion with no content returned.

Status Code Meaning When it Happens
400 Bad Request Missing or invalid fields in request body
401 Unauthorized Missing or invalid authentication token
404 Not Found Specified user does not exist
500 Internal Server Error Unexpected error during user deletion
{
"error": "Detailed error message here"
}

DELETE /users/exampleUserId
{} // provider defaults to "auth0-user" if omitted
DELETE /users/exampleUserId
{
"provider": "cognito-user",
"userPoolId": "us-east-1_1234test"
}
{}

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