Chart of accounts

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.

DELETE
https://services.magicdoor.com/accounting/company-portal/chart-of-accounts/{chartOfAccountId}

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

chartOfAccountIdstringrequired

Id 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.

example: 1830472847398404097

Body

application/json

The body is required: an account can only be deleted by naming what takes its place.

replacementAccountIdstringrequired

Id 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.

example: 690000

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.

Existing postings are rewritten

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.