How might I go about using the API to search for a user by email, but ensuring that it is an exact match?

I was able to accomplish this by installing a plugin called “PHP Snippits” that lets you add code as if you were adding it to functions.php, but through the admin panel. Then I did some reasearch on how to add a custom endpoint and then how to query a user and came up with this. It seems to be working well, and is better than what I had originally hoped for. I just pass the endpoint the email and I get back the specific userID I needed.

add_action( 'rest_api_init', function () {
    register_rest_route( 'endpoint/v1', 'email/(?P<stringvar>[^/]+)', array(
        'methods'             => 'GET',
        'callback'            => 'user_email',
        'permission_callback' => function () {
            return current_user_can('edit_others_posts');
        },
    ) );
});

function user_email($data) {

    // Get user by their email address
    $user = get_user_by( 'email', $data['stringvar']);
    $userId = $user->ID;
    $user_data = [$userId, $data['stringvar']];


    wp_reset_postdata();

    return rest_ensure_response($user_data);
}