I did some testing on my personal tenant, and here is what I found.
You can do a PUT
request to update account attributes. A PUT
request will trigger account aggregation automatically, which you can track with the task ID that is returned from the PUT
request. A word of caution, you must provide all of the account attributes in the PUT
body, even if there are some that you aren’t changing. Any attribute not present will be set to null, which could end up deleting the account. Here is an example of what I did to change the following account title:
Account for Jack Ryan:
{
"sourceId": "2c9180887671ff8c01767b4671fb7d5e",
"identityId": "2c918085771b670d01771c567e700917",
"attributes": {
"manager": "Colin McKibben",
"familyName": "Ryan",
"givenName": "Jack",
"name": "jack.ryan",
"e-mail": "[email protected]",
"groups": [
"DevRel"
],
"location": "Boston",
"id": "E002",
"title": "Developer Advocate",
"idNowDescription": "7d989fe20855bc7965c536f675fd082e919a56ae474791892b692fe8f14acdd9"
},
"authoritative": true,
"description": null,
"disabled": false,
"locked": false,
"nativeIdentity": "E002",
"systemAccount": false,
"uncorrelated": false,
"uuid": null,
"manuallyCorrelated": false,
"hasEntitlements": true,
"id": "2c918085771b670d01771c567e710918",
"name": "jack.ryan",
"created": "2021-01-19T20:29:26.513Z",
"modified": "2021-02-08T15:49:57.733Z"
}
PUT
https://devrel.api.identitynow.com/beta/accounts/2c918085771b670d01771c567e710918
Body:
{
"attributes": {
"manager": "Colin McKibben",
"familyName": "Ryan",
"givenName": "Jack",
"name": "jack.ryan",
"e-mail": "[email protected]",
"groups": [
"DevRel"
],
"location": "Boston",
"id": "E002",
"title": "Engineer",
"idNowDescription": "7d989fe20855bc7965c536f675fd082e919a56ae474791892b692fe8f14acdd9"
}
}
Response:
202 Accepted
{
"id": "2c918084785b737d017864a994562efa"
}
The only attribute I changed was title
. Notice how I still provide all of the other attributes unchanged? You must do this for PUT
otherwise the server will remove any attribute you don’t specify in the body.
The resulting behavior is that the identity’s title changed to “Engineer”, and any account provisioning rules that look for changes in “title” were triggered.
I tried to do the same update with the PATCH
endpoint, but I am running into the same issue as you. It gives me a 400 Bad Request
with the following body:
[/attributes/title is not a valid patch field for the account model.
]
Although the docs don’t yet reflect it, the PATCH
endpoint only supports updates to /identityId
and /manuallyCorrelated
. So PATCH
won’t work for your needs. You will need to use PUT
.