# Release Child Organization

End the link to a child organization. Your company's keys can no longer reach it; the organization and its data are not deleted. A child with no Owner cannot be released.

`DELETE https://connect.mindcloud.co/v2/child-companies/:companyId`

Permissions: `child_company:manage`.

## Parameters

### Path

- `companyId` (string, required): The child organization's id, from List Child Organizations.

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

## Example request

```bash
curl --request DELETE \
  --url 'https://connect.mindcloud.co/v2/child-companies/K3vX9qLm2RtA' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN'
```

## Response fields

- `id` (string): The id of the resource that was deleted.

## Example response

```json
{
  "success": true,
  "data": {
    "id": "K3vX9qLm2RtA"
  }
}
```

## Errors

- 403 Access denied (API_KEY_PERMISSION_DENIED, COMPANY_SCOPE_MISMATCH): `FORBIDDEN` / `API_KEY_PERMISSION_DENIED` "This API key needs the child_company:manage permission for this operation."
- 404 Not a child of your company: `NOT_FOUND` "No active child organization with this id."
- 409 Child has no Owner: `CONFLICT` / `CHILD_HAS_NO_OWNER` "Add an Owner to the child organization before releasing it."
