# IDN: Update Role Membership using Patch API Call

**URL:** <https://developer.sailpoint.com/discuss/t/idn-update-role-membership-using-patch-api-call/6787>\
**Category:** SHF Discussion and Questions\
**Tags:** roles\
**Created:** [November 17, 2022, 12:32pm UTC](https://developer.sailpoint.com/discuss/t/idn-update-role-membership-using-patch-api-call/6787 "2022-11-17T12:32:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyanka\_7](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@Priyanka\_7](https://developer.sailpoint.com/discuss/u/Priyanka_7)\
**Post date:** [November 17, 2022, 12:32pm UTC](https://developer.sailpoint.com/discuss/t/idn-update-role-membership-using-patch-api-call/6787/1 "2022-11-17T12:32:31Z")

</div>

Hello,

I am trying to update the membership criteria for an existing role through the following beta API call  
API - https://{{tenant}}.api.identitynow.com/beta//roles/:id

```json
{
    "op": "replace",
    "path": "/membership",
    "value":{
        "type": "STANDARD",
        "criteria": {
            "operation": "AND",
            "key": null,
            "stringValue": null,
            "children": [
                {
                    "operation": "EQUALS",
                    "key": {
                        "type": "IDENTITY",
                        "property": "accessRequestsVisible",
                        "sourceId": null
                    },
                    "stringValue": "true",
                    "children": null
                },
                {
                    "operation": "EQUALS",
                    "key": {
                        "type": "IDENTITY",
                        "property": "cloudLifecycleState",
                        "sourceId": null
                    },
                    "stringValue": "active",
                    "children": null
                },
                {
                    "operation": "EQUALS",
                    "key": {
                        "type": "IDENTITY",
                        "property": "firstname",
                        "sourceId": null
                    },
                    "stringValue": "Mark",
                    "children": null
                }
            ]
        }     
    }
}

```

Error: 400  
The request was syntactically correct but its content is semantically invalid.  
Any insights on what’s missing here…

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [November 21, 2022, 3:15pm UTC](https://developer.sailpoint.com/discuss/t/idn-update-role-membership-using-patch-api-call/6787/2 "2022-11-21T15:15:00Z")

</div>

The request body for PATCH must be an array of operations. Your request body needs to be wrapped in `[]`. For example:

```json
[
  {
    "op": "replace",
    "path": "/membership",
    "value":{
       ...
    }
  }
]

```

---

<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:** [July 19, 2023, 2:23pm UTC](https://developer.sailpoint.com/discuss/t/idn-update-role-membership-using-patch-api-call/6787/3 "2023-07-19T14:23:52Z")

</div>

Closed on July 19, 2023, 2:23pm UTC


