Implementation
- How to Handle a High-Volume Chart of Accounts: step-by-step instructions and pseudocode for filtering, counting, and sequencing a sync against this limit
Active Account Limit
A company can have a maximum of 11,000 active Accounts (Chart of Accounts entries) at any time. This is a per-company limit, scoped bycompanyId, and it applies no matter how an Account was created, in the Pleo UI, via a single API call, or via a sync. It is not a separate allowance per integration or per sync.
If a create or unarchive request would push the company’s active Account count over this limit, it fails with an HTTP 400 error (BAD_REQUEST: “Too many active accounts for company {companyId}”).
Chart of Accounts Sync is a full reconciliation. After a sync, Pleo’s active Accounts exactly match your filtered AS list. Any active Pleo Account that isn’t in that list gets archived. So you can check your filtered AS list’s size against the 11,000 limit directly, without fetching or adding Pleo’s current active count.
This limit is separate from the batch creation size limit (max 1,000 Accounts per request), which is covered in How to Create Multiple Accounts in a Single Request.
Designing Sync for a Large Chart of Accounts
1. Filter to Expense-Relevant Accounts
Filter the Accounting System’s chart of accounts to the accounts relevant for expense categorisation in Pleo. This is typically expense-type and P&L (profit and loss) accounts. Asset, liability, equity, and bank accounts are generally not needed, so don’t sync them as active Accounts.2. Check the Filtered Count Against the Limit
Check the filtered set’s size against the 11,000 limit before making any Pleo API calls. See Active Account Limit above for the logic. If the count is over the limit, abort the sync and log a clear error instead of discovering this from a rejected API request.3. Archive Accounts No Longer in the Filtered Set First
Archive Accounts in this step. Account creation and unarchiving happen in the next step. Pleo never lets a company go over 11,000 active Accounts, and it checks the limit on both create and unarchive requests. If the company is close to the limit, a create or unarchive request sent before the archive step can be rejected with anHTTP 400, even though the sync’s final state would be within the limit.
4. Create or Unarchive the Remaining Accounts
Once the archive step has run, create the Accounts in the filtered set that are missing in Pleo, and unarchive the ones that were already archived in Pleo but that the sync now needs active. If you have many Accounts to create, use the batch endpoint instead of individual requests. See How to Create Multiple Accounts in a Single Request (max 1,000 Accounts per request). The batch endpoint only creates Accounts, it can’t unarchive them. Unarchive each one individually. See How to Create, Update, and Archive Accounts for that request.5. Handle a Rejection from Pleo
If a request is sent without the step 2 pre-check and Pleo rejects it for exceeding the limit, don’t return a generic “sync failed” message. Surface the API’s actual response. See How to Handle a High-Volume Chart of Accounts for the exact pre-check logic, operation ordering, and error-handling pseudocode for all five steps above.What Comes Next?
Related Reading
- Sync Accounts
- Chart of Accounts Sync Periodicity and Scheduling
- How to Handle a High-Volume Chart of Accounts
- How to Create Multiple Accounts in a Single Request
- Platform Capabilities: Chart of Accounts Sync