Patch Lifecycle state

Trying to add another source to a lifecycle state. Since we have a lot of sources in there to disable idn says I have to use an api.

Using: https://{tenant}.api.identitynow.com/v3/identity-profiles/{identity-profile-id}/lifecycle-states/{lifecycle-state-id}

[
    {
        "op": "add",
        "path": "/accountActions-",
        "value": {
            "action": "DISABLE",
            "sourceIds": [
                "source ID",
                "source ID",
                "source ID"
            ]
        }
    }
]

getting error “The request was syntactically correct but its content is semantically invalid.”

This appears to work with a single source id but it replaces all of the other ids. Seems like it doesn’t add

[
    {
        "op": "add",
        "path": "/accountActions",
        "value": [
            {
                "action": "DISABLE",
                "sourceIds": [
                    "sourceid"
                ]
            }
        ]
    }
]

Looks like you have a dash in the path of your first example. Is that intentional? I think that’s the source of your syntax error.

@colin_mckibben Took out the dash on the second post. The operation doesn’t seem to add though. It only replaces what is there. Can’t see to add more than 1 or 2 source id though.

We have a lifecycle state, disable, that has a lot or sources. I can’ seem to add to that lifecycle state. Has more than 40 sources.

When using the add operation, you need to specify where in the array to add the element. Usually, adding it to the beginning of the array works fine. Try this:

[
    {
        "op": "add",
        "path": "/accountActions/0",
        "value": {
                "action": "DISABLE",
                "sourceIds": [
                    "sourceid"
                ]
        }
    }
]

Tried with the /0 but it looks like another group gets added. Sailpoint doesn’t read the second group of action… sourceid. Any other advice

        {
            "action": "DISABLE",
            "sourceIds": [
                "XXX"
            ]
        },
        {
            "action": "DISABLE",
            "sourceIds": [
                "XXX"
            ]
        }

I’m sorry, I thought you were trying to add an account action. It appears you just want to add additional sourceIds to an existing action. In that case, if you know the index number of the action you want to add sourceIds to, you can just replace all the sourceIds with the correct list. For example, if you want to replace the first account actions sourceIds, try this:

[
    {
        "op": "replace",
        "path": "/accountActions/0/sourceIds",
        "value": [
            "sourceid1",
            "sourceid2"
        ]
    }
]

Looks like that works. It would be nice to be able to just add a new source but I’ll take what I can get.

Thanks @colin_mckibben

To add a source to the beginning of the list, you would do the following:

[
    {
        "op": "add",
        "path": "/accountActions/0/sourceIds/0",
        "value": "sourceid1"
    }
]

Did this stop working in production?
Works in Sandbox but can’t seem to add or replace anymore in production for a lcs that has more than 40 sources

If it works in sandbox but not production I recommend you open a support ticket. They have the tools necessary to explore your tenant’s logs to see what is going on.

I have experienced this error if there is a sourceId present that does not exist in your tenat. For example when you delete a source from IDN, it’s sourceId will remain in the accountActions. Would be cool if IDN removed this from here too if a source is deleted, but they do not. I can also echo the replace operator is the way to go for what you are attempting.

Thanks @denvercape1

Support helped to identify what was going on. Didn’t realize that sources we deleted were still present in the lifecycle states. I’ll have to include in our processes to remove the source id from the lifecycle states.