Sub-accounts with parentAccountId
New: parentAccountId on accounts
Accounts can now be read and written as sub-accounts of another account.
- Read: returned on
GET /accounts,GET /accounts/{account_id},GET /accounts/search, and thePOST/PATCHresponses. - Write: accepted on
POST /accountsandPATCH /accounts/{account_id}. SendnullonPATCHto unlink an account from its parent. - Rules: the parent must be an account in your company and must itself be top-level (1 level of nesting). An account that already has sub-accounts cannot become one, and an account cannot be its own parent. Breaking a rule returns
400withfield: "parentAccountId".
Changed: GET /accounts/search includes sub-accounts
Search used to leave sub-accounts out of its results, while GET /accounts returned them, so the two disagreed. Search now returns sub-accounts like any other account.
- To find the sub-accounts of an account:
?prop1=parentAccountId&op1=eq&value1=1024. - To keep only top-level accounts, drop results whose
parentAccountIdis notnull. - Search with two properties and
logic=andnow also keepsupdated_after,q,titleand the other list filters you pass. Before, the two-property clause could replace them.
Updated: GET /properties?record_type=account
The built-in parent field is now listed as parentAccountId for accounts (it was listed as accountId).
