Remove entry from Enterprise Connection Metadata

I’m trying to call [PATCH /api/v2/connections/{id}] to update the metadata but I have a scenario now that I need to remove some of the properties, but it I send null as the value, nothing changes and the old value remains there.

What strategy should I use to remove that property from the enterprise connection metadata?

Hi @bmiranda

Welcome back to the Auth0 Community!

Can you share with me the full request you are sending to the Management API to update the metadata? Please hide all sensitive information.

Thanks
Dawid

This is the body I use to set the properties, and it works fine:

{
        "Id": "xyz",
        "Name": "xyz",
        "Metadata": {
            "Property1": "something",
            "Property2": "something"
        }
    }

These are the bodies I used to try to remove the metadata:

Fails with 400:

{
        "Id": "xyz",
        "Name": "xyz",
        "Metadata": null
    }

Works but doesn’t change anything:

{
        "Id": "xyz",
        "Name": "xyz",
        "Metadata": {}
    }

Works but doesn’t change anything:

{
        "Id": "xyz",
        "Name": "xyz",
        "Metadata": {
            "Property1": null,
            "Property2": null
        }
    }

Works, changes to empty string, but I want to remove them:

{
        "Id": "xyz",
        "Name": "xyz",
        "Metadata": {
            "Property1": "",
            "Property2": ""
        }
    }