# Leave Parent Organization

Stop being a child organization. Your parent's keys lose access at once, and the parent is told.

`POST https://connect.mindcloud.co/v2/companies/:companyId/leave-parent`

Permissions: `company:parent:manage`.

## Parameters

### Path

- `companyId` (string, required): The company's id: your key's own (from Who Am I?), or the one X-Company-Id names.

### 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/companies/K3vX9qLm2RtA/leave-parent' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

## Response fields

- `id` (string): Unique id of the company.
- `name` (string): The company's name.
- `description` (string): The company's description.
- `timezone` (string): The company's timezone key, an abbreviation such as EDT or PST rather than an IANA zone name.
- `region` (string): Where the company keeps its data: us-west-1 (United States), eu-north-1 (European Union) or sa-east-1 (Brazil).
  Allowed values:
    - `us-west-1`
    - `eu-north-1`
    - `sa-east-1`
- `isPersonal` (boolean): True for personal workspaces rather than team companies.
- `logo` (string): The company's logo URL.
- `parent` (object): The parent organization, or null when the company has none. Its API keys can act in this company.
  - `id` (string): The parent's company id.
  - `name` (string): The parent's name.
  - `origin` (string): created when the parent created this company, linked when this company accepted the parent.
    Allowed values:
      - `created`
      - `linked`
  - `linkedOn` (date): When the link started.
- `memberCount` (number): Members of the company, including people whose invite is pending.
- `roleCount` (number): Roles you can assign: the built-in roles plus your custom roles (List Roles).
- `domainDiscovery` (object): Whether people who sign up with an email at one of these domains can find and join the company.
  - `isEnabled` (boolean): True when domain discovery is on.
  - `domains` (array): The email domains it applies to.
- `embedded` (object): MindCloud Embedded for the company.
  - `isEnabled` (boolean): True when Embedded is enabled, so end users can connect their own accounts.
- `isDeleted` (boolean): True after the company was deleted.
- `createdOn` (date): When the company was created.
- `updatedOn` (date): When it was last changed.

## Errors

- 404 No parent: `NOT_FOUND` "This organization has no parent."
