Delete an account
DELETE
https://app.speybooks.com/api/v1/accounts/{id}Removes an account from the chart. The behaviour depends on the account's state:
- System accounts cannot be deleted.
- Accounts with transactions are deactivated instead of
deleted. The
isActiveflag is set tofalse. - Accounts with children cannot be deleted until child accounts are removed or reassigned.
- Accounts with no transactions or children are permanently deleted.
The checks apply in that order, so an account with both transactions and children is deactivated. To reactivate a deactivated account, use the update endpoint.
Path parameters
idstringrequiredPrefixed account ID (e.g. acc_1200).
Response
200Account deleted or deactivated. If the account has posted transactions, it is deactivated instead of deleted. Check the response for deleted vs deactivated status.
Show response fields
deactivatedbooleanTrue if the account was deactivated instead of deleted (has transactions).
deletedbooleanTrue if the account was permanently deleted.
messagestringExplanation when the account was deactivated rather than deleted.
Error codes
400Cannot delete system account, or account has child accounts that must be removed first.
404Account not found.