# How to remove roles from the user using workflow?

**URL:** <https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, sailpoint-identity-security\
**Created:** [May 20, 2025, 5:40pm UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977 "2025-05-20T17:40:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santhakumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/santhakumar/32/17329_2.png) [@Santhakumar](https://developer.sailpoint.com/discuss/u/Santhakumar)\
**Post date:** [May 20, 2025, 5:40pm UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/1 "2025-05-20T17:40:40Z")

</div>

Hi All,

I want to remove all non Birthright roles assigned to the user during the termination. I have tried manage Access in the workflow but it was throwing 400 bad request error. Also tried with submit access request api call to remove the role but before that I have used search to get the Revocable:true and passing the role id into the loop.

Inside the loop I have configured the submit access request api call where I have passed the identity and requested items field I have given the role id and type as role but it throws same error 400 bad request.

I don’t know what I missing here, any help would be appreciated.

Thanks,  
Shantha Kumar

---

<div class="post-metadata">

**Author:** ![suresh4iam](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/suresh4iam/32/29513_2.png) [@suresh4iam](https://developer.sailpoint.com/discuss/u/suresh4iam)\
**Post date:** [May 20, 2025, 10:10pm UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/2 "2025-05-20T22:10:10Z")

</div>

Can you check whether you are able to revoke the access from the Role via UI?

Sometimes it throw 400 error when there were pending tasks for the access items or for the identity and those are not listed in the [pending-tasks](https://developer.sailpoint.com/docs/api/beta/get-pending-tasks/) api.

---

<div class="post-metadata">

**Author:** ![Sivakrishna1993](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sivakrishna1993/32/25424_2.png) [@Sivakrishna1993](https://developer.sailpoint.com/discuss/u/Sivakrishna1993)\
**Post date:** [May 21, 2025, 4:33am UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/3 "2025-05-21T04:33:25Z")

</div>

Hi

Share us the error logs from workflows.so we can check and let you know the issue.

Best Regards,  
Siva.K

---

<div class="post-metadata">

**Author:** ![ManvithaNalabolu06](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/manvithanalabolu06/32/26315_2.png) [@ManvithaNalabolu06](https://developer.sailpoint.com/discuss/u/ManvithaNalabolu06)\
**Post date:** [May 21, 2025, 5:26am UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/4 "2025-05-21T05:26:45Z")

</div>

I think you’re passing the entire identity object instead of just the ID. Can you just check?

---

<div class="post-metadata">

**Author:** ![Santhakumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/santhakumar/32/17329_2.png) [@Santhakumar](https://developer.sailpoint.com/discuss/u/Santhakumar)\
**Post date:** [May 21, 2025, 9:07am UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/5 "2025-05-21T09:07:19Z")

</div>

This is what i configured in ISC.

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/4/1/41528b1fc8dc39505198e0781dc41d91e0262338.png)  
 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/0/d/0d5ac94343177171f567dd203c27787c3baa995d.png)  
 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/8/f/8fb53b4cd23b7d08247b772281ec0a60fb58303b.png)

In HTTP Request this is what i have given as input:

> {“requestType”:“REVOKE\_ACCESS”,“requestedFor”:[“{{$.loop.context.id}}”],“requestedItems”:[{“comment”:“Remove Role on termination”,“id”:“{{$.loop.loopInput}}”,“type”:“ROLE”}]}

The same i have tried in API postman it was removing the role.

---

<div class="post-metadata">

**Author:** ![Santhakumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/santhakumar/32/17329_2.png) [@Santhakumar](https://developer.sailpoint.com/discuss/u/Santhakumar)\
**Post date:** [May 21, 2025, 9:09am UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/6 "2025-05-21T09:09:57Z")

</div>

This is the error i have get in the workflow.

> {“error”:“task failed: activity error (type: sp:external:http:v2, scheduledEventID: 5, startedEventID: 6, identity: 1@sp-workflow-worker-stg-us-east-1-7457c9fb94-rjgqv@sp-workflow-engine): request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 400 - 400 Bad Request - {"detailCode":"400.1.404 Referenced object not found","trackingId":"4e017f2cb89a482f9932c4599644ff56","messages":[{"locale":"en-US","localeOrigin":"DEFAULT","text":"Referenced RequestedFor Identity/Identities {{$.loop.context.id}} was/were not found."},{"locale":"und","localeOrigin":"REQUEST","text":"Referenced RequestedFor Identity/Identities {{$.loop.context.id}} was/were not found."}],"causes":}”,“workflowId”:“74ef4321-3339-4d6b-b06a-eb9359d1a339-2”}

`

---

<div class="post-metadata">

**Author:** ![jesvin90](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/jesvin90/32/5301_2.png) [@jesvin90](https://developer.sailpoint.com/discuss/u/jesvin90)\
**Post date:** [May 21, 2025, 9:40am UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/7 "2025-05-21T09:40:47Z")

</div>

Hi @Santhakumar,

Can you share your WF JSON here.

Also, if it is a termination scenario, the BR roles are expected to be revoked during the processing right.? If that’s the case, you can add a wait of 5 or 10 minutes for the processing to complete so that only the revocable roles would remain. So you don’t have to look only for the revocable ones.

---

<div class="post-metadata">

**Author:** ![sidharth\_tarlapally](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sidharth_tarlapally/32/26178_2.png) [@sidharth\_tarlapally](https://developer.sailpoint.com/discuss/u/sidharth_tarlapally)\
**Post date:** [May 21, 2025, 9:42am UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/8 "2025-05-21T09:42:27Z")

</div>

@Santhakumar

Can u share the loop context part ?

---

<div class="post-metadata">

**Author:** ![Santhakumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/santhakumar/32/17329_2.png) [@Santhakumar](https://developer.sailpoint.com/discuss/u/Santhakumar)\
**Post date:** [June 24, 2025, 9:46am UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/10 "2025-06-24T09:46:12Z")

</div>

I have resolved the workflow.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [August 23, 2025, 9:46am UTC](https://developer.sailpoint.com/discuss/t/how-to-remove-roles-from-the-user-using-workflow/135977/11 "2025-08-23T09:46:33Z")

</div>

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