Delete a chart of account
Repoints everything that referenced this account at a replacement account of the same type, then soft-deletes it. Requires the chart_of_accounts:delete permission.
Authorization
AuthorizationstringrequiredPath parameters
chartOfAccountIdstringrequiredId of the chart-of-account entry: a Snowflake for a company account, or the six-digit number for one of MagicDoor's built-in accounts.
Body
application/json
The body is required: an account can only be deleted by naming what takes its place.
replacementAccountIdstringrequiredId of the account that inherits everything pointing at the deleted one. It must be visible to the company, must have the same type, and must not be the account being deleted.
Response
200 · The account was replaced and deleted. The response has no body.
400 · The account is one of MagicDoor's built-in accounts, or `replacementAccountId` is the account being deleted.
401 · The access token is missing, expired, or not for this company.
403 · The caller does not hold the `chart_of_accounts:delete` permission.
404 · The account is not one of this company's own accounts, or `replacementAccountId` names no visible account.
422 · The replacement account has a different `type` than the account being deleted.
This is not a soft archive. Every record that referenced the deleted account is rewritten to point at replacementAccountId before the account disappears, and there is no endpoint that undoes it. Reports run after the call will attribute the old activity to the replacement account.