PATCHes and arrays

You can include arrays in a PATCH request payload. For most arrays in Cloud API, PATCHing an array does not add the PATCH members to the members already existing in the array. Instead, the PATCH replaces the existing members with the PATCH members.

Here are some examples for the different InsuranceSuite applications:
  • ClaimCenter: In the Claim API, the Claim resource has a witnesses array. This is an array of ClaimContacts who are witnesses to the loss. The following PATCH payload will set the witnesses array to a single witness, the ClaimContact whose id is cc:1306. If there were witnesses in this array before the PATCH, those witnesses will be removed and the only witness will be ClaimContact cc:1306.
    {
      "data": {
        "attributes": {
          "witnesses": [
            {
              "contact": {
                "id": "cc:1306"
              }
            }
          ]
        }
      }
    }
  • PolicyCenter: In the Jobs API, the JobRoles resource has a roles array. This is an array of users on the job and the role of each user (such as Creator or Underwriter). The following PATCH payload will set the roles array to a single user (user default_data:1) with the role of Auditor. If there were user/role pairs in this array before the PATCH, those pairs will be removed and the only user/role pair will be user default_data:1/Auditor.
    {
      "data":
        {
          "attributes": {
            "roles": [
              {
                "group": "systemTables:1",
                "role": {
                  "code": "Auditor"
                },
                "user": "default_data:1"
              }
            ]
          }
        }
    }
  • BillingCenter: In the Admin API, the User resource has a roles array. This is an array of roles the user has (such as underwriter and billing admin). The following PATCH payload sets the roles array of a user to a single role (billing_clerical). If there were other roles in this array before the patch, they are removed and replaced with role billing_clerical.
    {
        "data": {
            "attributes": {
                "roles": [
                    {
                        "id": "billing_clerical"
                    }
                ]
            }
        }
    }

If you want a PATCH to be additive to an array, you must first determine the existing members of the array, and then specify an array in the PATCH with the existing members as well as the ones you wish to add.