Skip to navigation

Sub-accounts with parentAccountId

New: parentAccountId on accounts

Accounts can now be read and written as sub-accounts of another account.

FieldTypeDescription
parentAccountIdinteger, nullableID of the parent account. null for a top-level account.
  • Read: returned on GET /accounts, GET /accounts/{account_id}, GET /accounts/search, and the POST/PATCH responses.
  • Write: accepted on POST /accounts and PATCH /accounts/{account_id}. Send null on PATCH to 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 400 with field: "parentAccountId".
PATCH /accounts/2048
{
"parentAccountId": 1024
}

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 parentAccountId is not null.
  • Search with two properties and logic=and now also keeps updated_after, q, title and 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).