Problem with post data to API with JS/React

Hi @adriann.kowalski,

Welcome to the Auth0 Community!

I understand that you are having problems with your PATCH request to the Management API /api/v2/users/ endpoint, specifically with the "Payload validation error: 'Expected type object but found type string'." error.

This error normally occurs when the payload’s Content-Type is in plain text, therefore returning the content as a string rather than a JSON object as expected.

After looking closely at your code snippet, I noticed that you need to specify the Content-Type header. Could you please include the following:

headers: {

Authorization: 'Bearer ${accessToken}',
Content-Type: 'application/json',

},

EDIT: If you encounter the “Invalid request payload JSON format” error after making these changes, please double check that your request is indeed in the correct format.

Please let me know whether this resolves your issue.

Thank you.