Hello!
We are using the Node Auth0 client to handle organizations. I cannot figure out how to delete values from an organizations metadata object.
Here is from the documentation on metadata in user accounts:
https://auth0.com/docs/manage-users/user-accounts/metadata/manage-metadata-api
When you send a
PATCH
call in which you have set a property’s value tonull
(for example,{user_metadata: {color: null}}
), Auth0 deletes the property/value from the database. Also, patching the metadata itself with an empty object removes the metadata completely.
However this does not seem to work for companies. I can create and update metadata values with no problem using client.organizations.update(). In this example I have created and updated “testkey” in metadata on an organization. But when I send
"id": "org_Brs6BbikHRG7IcRf",
"data": {
"metadata": {
"testkey": null
},
}
I get back the following error:
“Invalid request payload input”
I’ve also tried making a PATCH request to https://tentant.auth0.com/api/v2/organizations/org id with the same result
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid request payload input"
}
I’ve not found any instructions in the documentation on how to update metadata on an organization.
Am I doing this wrong or does the organization api not work properly?