remove all groups with Manage Person API

I would like to remove all groups of a Person via Manage Person API. If I include a REPLACE tag with empty group list API response with "HTTP Status 400 – Bad Request" error:

{
"operation": "CREATE_OR_UPDATE",
"users": [
{
"properties": {
"Upn": "ext_-----",
},
"groups": {
"REPLACE": "[]"
}
}
]
}

Is there any way to remove all the groups the Person has?

  • Verified Answer

    Hello

    You have several syntax errors

    This is your payload - see the highlights

    {
    "operation": "CREATE_OR_UPDATE",
    "users": [
    {
    "properties": {
    "Upn": "ext_-----",
    },
    "groups": {
    "REPLACE": "[]"
    }
    }
    ]
    }
    It should be:
    {
    "operation": "CREATE_OR_UPDATE",
    "users": [
    {
    "properties": {
    "Upn": "ext_-----"
    },
    "groups": {
    "REPLACE": []
    }
    }
    ]
    }
    Best regards,
    Brindusa