IdentityNow: Patch Role membership criteria

I am looking for the sample API call to update existing membership criteria. Our role membership criteria are based on the identity attribute and life cycle state.

Hello @sivakumarnallu,

You can take a look at the patch Role API docs to get you started. patch-role | SailPoint Developer Community

On the right hand side there is a dropdown of Request Samples. The one that I believe will closely resemble what you are looking for is “Set the Membership Selection Criteria to a Standard Expression”.

Thank you for your reply. Yes, it works for single criteria. However, I need a few membership criteria should be created under one Criteria Group.

Attached screenshot for your reference. Could you pls share a sample JSON ?

If you save what you have in the screenshot within the UI, you can then grab the membership JSON you will need via API List Roles.

The JSON below is an example from a Role that I created within the UI.

        "membership": {
            "type": "STANDARD",
            "criteria": {
                "operation": "AND",
                "key": null,
                "stringValue": null,
                "children": [
                    {
                        "operation": "OR",
                        "key": null,
                        "stringValue": null,
                        "children": [
                            {
                                "operation": "EQUALS",
                                "key": {
                                    "type": "IDENTITY",
                                    "property": "displayName",
                                    "sourceId": null
                                },
                                "stringValue": "active",
                                "children": null
                            },
                            {
                                "operation": "EQUALS",
                                "key": {
                                    "type": "IDENTITY",
                                    "property": "firstname",
                                    "sourceId": null
                                },
                                "stringValue": "Tyler",
                                "children": null
                            },
                            {
                                "operation": "EQUALS",
                                "key": {
                                    "type": "IDENTITY",
                                    "property": "identificationNumber",
                                    "sourceId": null
                                },
                                "stringValue": "1234",
                                "children": null
                            }
                        ]
                    }
                ]
            },
            "identities": null
        }

Thank you for your help. This is what I am expecting and really appreciate your immediate response.