Delete Company
Permanently deletes a company, its addresses and its customer accounts, and removes it from any corporate structure it belongs to. See Corporate Hierarchy and Access.
HTTP Request
- URL:
/companies/{id} - Method:
DELETE - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_WRITE_COMPANY
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | The ID of the company to delete. |
cURL Example
curl --location --request DELETE '<BASE_URL>/companies/66b9b3b166169eecd60e5ba8' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The company was deleted successfully. An ID that matches no company also returns
200 OKwithsuccess: true. - 400 Bad Request: The access token is missing or invalid, or the company ID is not valid.
Sample JSON Response
{
"success": true,
"message": "Company deleted successfully"
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request succeeded. |
message | String | Result message. |
Notes
- If the company is a parent: its corporate is deleted. Each sub-company is unlinked from it and kept. A sub-company with no other parent becomes a standalone company. One with other parents stays a sub-company of those.
- If the company is a sub-company: it is removed from every parent's corporate. A corporate left with no sub-companies is kept, empty.
- Access: every parent-access record and per-user access record that involves the company is deleted. Access that a company above holds in a lower company through the removed link is removed if it can no longer be reached.
- Related data: the company's addresses are deleted. Its customer accounts are deleted too, and a copy of each is archived before deletion.
- Atomic: the detach and the delete happen in one transaction. If anything fails, nothing is changed.
- This action cannot be undone.