Auth0 API Request

I’m trying to make a patch request to my auth0 API endpoint, myaccount.auth0.com/api/v2/users/:id. I’ve set the headers to be application/json, but I still get the following error:

_body: "{"statusCode":400,"error":"Bad Request","message":"Invalid request payload JSON format"}"

The request I made looks like this:

headers.append('Content-Type', 'application/json');
var data: any = {
    "app_metadata": {
        "ward": "99999"
    }
};

return this._http.patch('https://pjlamb12.auth0.com/api/v2/users/auth0|571844c894efdc0a5b6a4144', data, {headers: headers}).map(res => res.json());

I matched the data I’m sending to the docs like it shows here.

Why would I be getting this error when posting a JSON object like the docs show? What could I be missing?

Leave a Reply

avatar
  Subscribe  
Notify of