Search for Users by Email with Auth0 Management API Endpoint

Problem statement

If Auth0 is the Identify Provider (IdP), the email address associated with a user is saved in lowercase, regardless of how it was initially provided. In cases where Auth0 is not the idP, the email could contain upper-case letters. The Get User by email endpoint (GET /api/v2/users-by-email) allows us to search emails based on cases, so there is a need that the search to be made using the correct capitalization.

This article explains how to search for emails without knowing whether the email contains upper-case or lower-case.

Solution

Call the GET /api/v2/users endpoint to search for users. This endpoint is case-insensitive. Below can be found a screenshot of the call.