Update user's profile - manager and locations

Hello,

It seems impossible to update "manager" and "locations" properties in the user's profile with the API endpoint :

PATH /api/v2/users/{userId}

The request seems always succesful (no error response) but no effect on the user's profile.

Using the UI to update a user's profile, I can see this request being made:

PUT https://api.mypurecloud.de/api/v2/users/{userId}/profile

However, this one is not published or documented anywhere.

Please help.

Thanks & Regards

Hello,

The PATCH /api/v2/users/{userId} does support the update of manager and locations (I just tried it).

What you may have missed with this API endpoint is that you must remove the state attribute from your request body, as it will take precedence (and Genesys Cloud will ignore other attributes value).
Here's the description of this state attribute: "(string) The state of the user. This property can be used to restore a deleted user or transition between active and inactive. If specified, it is the only modifiable field. Valid values: active, inactive, deleted."

This is a sample body I have used to change my manager and my location:

{
  "version": 90,
  "manager": "ID OF MY MANAGER",
  "locations": [
    {
      "coordinates": {},
      "notes": "",
      "locationDefinition": {
        "id": "ID OF MY LOCATION DEFINITION"
      }
    }
  ]
}

Version being the current version number of my user (from GET /api/v2/users/{userId}).

Regards,

2 Likes

Brilliant ! You're right. I was including the state attribute. Thank you very much.

Best regards

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.