beel_delete_company
Removes a company from the account, stopping its visibility and billing. Existing invoices are retained, but company-scoped API access ends once the NIF is removed.
Instructions
Removes a company from the account: it stops appearing and stops being billed.
Existing invoices: those already issued are retained, but the company-scoped API can no longer resolve them once the NIF is removed.
What blocks removal: a NIF activated in Live (
409 COMPANY_ACTIVE_IN_PRODUCTION), one holding any invoice in Live — issued, draft or proforma (409 COMPANY_HAS_INVOICES) — and the account's primary NIF (400 CANNOT_DELETE_PRIMARY).Deactivating first: switching off in Live is scheduled to the end of the paid cycle, so the removal only becomes possible once that takes effect.
Test: NIFs never activated, or activated only in Test, are removed right away, and invoices in Test never block.
Idempotency-Key: without one, a retry after a timeout answers403instead of the original204.
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 | Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. 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 company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. |