Update user metadata not working

I am using the Management API to try to update an user metadata.
I am using this endpoint:

Update a User

PATCH/api/v2/users/{id

When I send my PATCH request I get the following answer from Auth0:

{"statusCode":400,"error":"Bad Request","message":"Payload validation error: '{message}'.","errorCode":"invalid_body"}

However, I am using a body according to the example of the API doc:

{
   "user_metadata": { "a" : "b" }
}

What’s wrong?

Hi @jose2 ,

Welcome to the Auth0 community!

Are you setting the Content-Type: application/json header to your update request?

1 Like

Yes, I found out right after writing the question that that was the problem. Please close this ticket.

jose2, thanks for reporting this error. I ran into this today and had no clue what’s causing the problem since the error message is (still) broken:
"Payload validation error: '{message}'."

if it matters, I got this error from the “Create User” API method, not “Update User” like jose2 did