Replaced by
https://developer.sailpoint.com/idn/api/v3/patch-auth-user
Add capabilities
Use the following patch body to add one or more new capabilities to a user.
[
{
"op": "add",
"path": "/capabilities/-",
"value": "HELPDESK"
},
{
"op": "add",
"path": "/capabilities/-",
"value": "REPORT_ADMIN"
}
]
Remove capabilities
To remove capabilities, it is recommended to first get the list of capabilities the user has by calling https://developer.sailpoint.com/idn/api/v3/get-auth-user. This will provide you with an array of capabilities that the user currently has.
{
"tenant": "devrel",
"id": "2c9180867dfe694b017e208e354c57c0",
"uid": "aaron.nichols",
"profile": "c1b86aa411764a11b7851f281e5d6ee9",
"identificationNumber": "1c",
"email": "[email protected]",
"phone": null,
"workPhone": null,
"personalEmail": "[email protected]",
"firstname": "Aaron",
"lastname": "Nichols",
"displayName": "Aaron.Nichols",
"alias": "Aaron.Nichols",
"capabilities": [
"HELPDESK",
"ROLE_ADMIN"
],
"lastPasswordChangeDate": null,
"lastLoginTimestamp": 0,
"currentLoginTimestamp": 0,
"lastUnlockTimestamp": null
}
Then, craft a PATCH request that uses the replace
operation. This will require you to provide the full list of capabilities you want the user to have, minus any you don’t want them to have. It’s best to copy the capabilities from above and use them in your replace operation, minus the ones you don’t want. For example, if you wanted to remove the “ROLE_ADMIN” capability from the user above, you would use the following PATCH request payload.
[
{
"op": "replace",
"path": "/capabilities",
"value": [
"HELPDESK"
]
}
]
You can also use the remove
operation, but it requires you to know the index of the item you want to remove.
[
{
"op": "remove",
"path": "/capabilities/0"
}
]