How to create, update, delete and search users using API call

Hi Vignesh,

You first need to register an Application in the Auth0 Dashboard representing your web application (if you don’t have one), and configure it as Machine to Machine. That will let your app to negotiate an access token for the Management API using Client Credentials (server side without user intervention). After that, go and authorize that application (under the APIs tab in the application settings) to use the Auth0 management API (https://.us.auth0.com/api/v2/).

Once you have that configured, you can use the Client Credential Flow passing the Client ID/Secret and API audience. For example,

        var request = new HttpRequestMessage(HttpMethod.Post, $"https://{domain}/oauth/token");

        request.Content = new FormUrlEncodedContent(new[]

        {

            new KeyValuePair<string, string>("client_id", clientId),

            new KeyValuePair<string, string>("client_secret", clientSecret),

            new KeyValuePair<string, string>("audience", $"https://{domain}/api/v2/"),

            new KeyValuePair<string, string>("grant_type", "client_credentials")

        }); 

That will give you back an access token that you can use to consume the management API (bearer token). For example, for calling this endpoint, Auth0 Management API v2