DELETE /users/{userId}/authentication-methods/{authenticationMethodId} - Deletes a specific authentication method for a user by its ID.

  • Ensure the user has at least one remaining authentication method after deletion to prevent account lockout.
  • This operation is only available for Auth0

Headers:

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

Body:

  • provider: The authentication provider described in UserProvider. Defaults to auth0-user if not provided. (optional)

Path Parameters:

  • userId: The ID of the user whose authentication method is to be deleted. (required)
  • authenticationMethodId: The ID of the authentication method to delete. (required)

Query Parameters:

  • None

  • 204 No Content – Authentication method successfully deleted.

Status Code Meaning When it Happens
400 Bad Request Invalid request body, missing userId, or missing authenticationMethodId
401 Unauthorized Missing or invalid authentication token
404 Not Found User or authentication method not found
500 Internal Server Error Unexpected error during user creation
{
"error": "Detailed error message here"
}

 DELETE /users/exampleUserId/authentication-methods/exampleAuthMethodId
{} // provider defaults to "auth0-user" if omitted
{}

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