# Update Source (Full)

**URL:** <https://developer.sailpoint.com/discuss/t/update-source-full/17956>\
**Category:** SHF Discussion and Questions\
**Tags:** sailpoint-identity-security, apis\
**Created:** [September 21, 2023, 9:07pm UTC](https://developer.sailpoint.com/discuss/t/update-source-full/17956 "2023-09-21T21:07:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![swcoleman](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@swcoleman](https://developer.sailpoint.com/discuss/u/swcoleman)\
**Post date:** [September 21, 2023, 9:07pm UTC](https://developer.sailpoint.com/discuss/t/update-source-full/17956/1 "2023-09-21T21:07:20Z")

</div>

I am trying to update a source via the Update Source (Full) V3 API. I need to add the rules to the source for Connector and Cloud Rules. I am running into an issue and getting the following error.

“text”: “Illegal attempt to modify "id" field.”

i know from the documentation ([put-source | SailPoint Developer Community](https://developer.sailpoint.com/idn/api/v3/put-source)) that Some fields are immutable and cannot be changed, such as:

- id
- type
- authoritative
- connector
- connectorClass
- passwordPolicies

however the ID does not appear to be part of the body so not sure where it’s being changed.

Can someone point me in the right direction?

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [September 21, 2023, 9:28pm UTC](https://developer.sailpoint.com/discuss/t/update-source-full/17956/2 "2023-09-21T21:28:14Z")

</div>

> [@swcoleman](#):
>
> need to add the rules to the source for Connector and Cloud Rules

Why don’t you just PATCH the source?

[https://developer.sailpoint.com/idn/docs/rules/connector-rules#attaching-connector-related-rules-to-sources](https://developer.sailpoint.com/idn/docs/rules/connector-rules#attaching-connector-related-rules-to-sources)

Though the title says “Connector-executed” rules, it includes instructions for cloud rules as well

---

<div class="post-metadata">

**Author:** ![swcoleman](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@swcoleman](https://developer.sailpoint.com/discuss/u/swcoleman)\
**Post date:** [September 21, 2023, 10:26pm UTC](https://developer.sailpoint.com/discuss/t/update-source-full/17956/3 "2023-09-21T22:26:54Z")

</div>

Nithesh, that appears to working. I am running into an issue with this part.

### WebServiceAfterOperation Rule[​](https://developer.sailpoint.com/idn/docs/rules/connector-rules#webserviceafteroperation-rule)

`PATCH` /v3/sources/{id} Content-Type: `application/json-patch+json`

_Note: Replace [_] with the index location of the operation the way it is configured on the source. For example, 0, 1, 2, etc. You can use a `GET` call on the source first to verify the index location prior to executing the `PATCH` call to attach the rule\*

i don’t understand the structure of the “Get” call? I hadn’t made an API call 9 months ago. Thanks for the guidance.

---

<div class="post-metadata">

**Author:** ![gauravsajwan1](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gauravsajwan1/32/7856_2.png) [@gauravsajwan1](https://developer.sailpoint.com/discuss/u/gauravsajwan1)\
**Post date:** [September 22, 2023, 6:03am UTC](https://developer.sailpoint.com/discuss/t/update-source-full/17956/4 "2023-09-22T06:03:56Z")

</div>

Hello @swcoleman ,

First you need to make a GET to _ **https://{{tenant}}.api.identitynow.com/v3/sources/{source-id}** _  
where, _{{tenant}}_ is your org and _{source-id}_ is the id of your Web Service Source.  
In the GET response, search for your Web Service Operation (like Account Aggregation, Create Account, etc.) on which you want to apply the rule. Once found, check the index number (like 0, 1, 2, etc.).

Once you know the index, make a `PATCH` to _ **https://{{tenant}}.api.identitynow.com/v3/sources/{source-id}** _ Content-Type: `application/json-patch+json`

Body:

```auto
[
  {
    "op": "replace",
    "path": "/connectorAttributes/connectionParameters/{index}/afterRule",
    "value": "Example Rule"
  }
]

```

where {index} is the number value (like 0, 1, 2, etc.) which you received from previous GET response.

All the best!

---

<div class="post-metadata">

**Author:** ![swcoleman](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@swcoleman](https://developer.sailpoint.com/discuss/u/swcoleman)\
**Post date:** [September 22, 2023, 12:02pm UTC](https://developer.sailpoint.com/discuss/t/update-source-full/17956/5 "2023-09-22T12:02:20Z")

</div>

I don’t understand where to get the index value. Is that how far indented the row is? I don’t see anything labeled index in the response.

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [September 22, 2023, 12:40pm UTC](https://developer.sailpoint.com/discuss/t/update-source-full/17956/6 "2023-09-22T12:40:16Z")

</div>

It is the order how the operations are listed in Source Configuration (first one has index 0). You can check the order from the UI

> [@swcoleman](#):
>
> I don’t understand where to get the index value

---

<div class="post-metadata">

**Author:** ![swcoleman](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@swcoleman](https://developer.sailpoint.com/discuss/u/swcoleman)\
**Post date:** [September 22, 2023, 1:59pm UTC](https://developer.sailpoint.com/discuss/t/update-source-full/17956/7 "2023-09-22T13:59:11Z")

</div>

🙂 that makes sense me. Thanks a lot. I am glad we have a great community for those of us that are just learning some of this.

---

<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:** [November 21, 2023, 2:00pm UTC](https://developer.sailpoint.com/discuss/t/update-source-full/17956/8 "2023-11-21T14:00:01Z")

</div>

Closed on November 21, 2023, 2:00pm UTC

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