# Close Child Organization

Delete a child organization your company created. Its members lose access and its data is removed, as when an Owner deletes an organization. A child that joined by link request can only be released.

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

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 POST \
  --url 'https://connect.mindcloud.co/v2/child-companies/K3vX9qLm2RtA/close' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

## Response fields

- `id` (string): The id of the child organization that was closed.

## Errors

- 409 Not created by your company: `CONFLICT` / `CHILD_COMPANY_NOT_CREATED` "Your company did not create this organization, so it cannot close it. Release it instead."
