Delete an account

DELETEhttps://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 isActive flag is set to false.
  • 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

idstringrequired
Prefixed 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
deactivatedboolean
True if the account was deactivated instead of deleted (has transactions).
deletedboolean
True if the account was permanently deleted.
messagestring
Explanation 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.