Delete Corporate
Deletes a corporate and unlinks all of its sub-companies from the parent company. The companies themselves are kept.
HTTP Request
- URL:
/corporates/{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 corporate (not the parent company ID). Required. |
cURL Example
curl --location --request DELETE '<BASE_URL>/corporates/67bd786f177125410d15d694' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The corporate was deleted successfully.
- 400 Bad Request: The corporate ID is not valid.
- 401 Unauthorized: The access token is missing or invalid.
- 403 Forbidden: The access token does not have the required scope.
- 404 Not Found: No corporate matches the ID. The body is
{ "status": false, "message": "Corporate not found", "data": null }, withstatusinstead ofsuccess.
Sample JSON Response
{
"success": true,
"message": "Corporate deleted successfully"
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request succeeded. |
message | String | Result message. |
Notes
- The access settings between the parent company and its sub-companies are also removed, including the per-user access settings of the parent company's users in these sub-companies.
- Sub-companies that have other parents stay linked to those parents and remain sub-companies (
isSubCompanystaystrue). Sub-companies with no other parent become standalone companies. - This action cannot be undone.