beel_delete_by_id
Remove a company (NIF) from your account to stop it from appearing and being billed. Only inactive or test-only NIFs can be deleted; live or invoiced ones are blocked.
Instructions
Removes a company (NIF) from the account: it stops appearing and stops being billed. Invoices already issued are retained, but the company-scoped API can no longer resolve them once the NIF is removed.
A NIF activated in Live cannot be removed (409 COMPANY_ACTIVE_IN_PRODUCTION), and
neither can one holding any invoice in Live — issued, draft or proforma
(409 COMPANY_HAS_INVOICES) — nor the account's primary NIF
(400 CANNOT_DELETE_PRIMARY). Switching off in Live is scheduled to the end of the paid
cycle, so the removal only becomes possible once that takes effect. NIFs never activated,
or activated only in Test, are removed right away, and invoices in Test never block.
Without an Idempotency-Key, a retry after a timeout answers 403 instead of the
original 204.
Endpoint: DELETE /v1/companies/{company_id}
⚠️ Fiscal guardrails — read before calling:
Which company an operation acts on, and how that is selected. (resource: beel://guardrails/multi-nif)
For the exhaustive rules and worked examples, call beel_docs_search.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_id | Yes | NIF (company) the operation acts on. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A NIF you do not reach answers `403`, and so does a NIF that does not exist, so the existence of a NIF in another account is never disclosed. |