# Delete an organization

> Permanently delete an organization.

`DELETE /api/organizations/{id}`

Delete an organization.

Permanently deletes an organization. Returns `204 No Content` on success.

> **Owners only, and only when empty**
>
> Deletion is restricted to owners, and only succeeds when the organization has no remaining instances. Detach or transfer instances first, otherwise the call returns a `403`.

## Path parameters

| Name | Type     | Required | Description             |
| ---- | -------- | -------- | ----------------------- |
| `id` | `string` | Yes      | Organization identifier |

## Response

**204** - Organization resource deleted

_No response body._

## Errors

**403** - Forbidden

| Property   | Type             | Required | Description                                                                                                                          |
| ---------- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `@context` | `object`         | -        |                                                                                                                                      |
| `@id`      | `string`         | Yes      |                                                                                                                                      |
| `@type`    | `string`         | Yes      |                                                                                                                                      |
| `title`    | `string \| null` | -        | A short, human-readable summary of the problem.                                                                                      |
| `detail`   | `string \| null` | -        | A human-readable explanation specific to this occurrence of the problem.                                                             |
| `status`   | `number \| null` | -        |                                                                                                                                      |
| `instance` | `string \| null` | -        | A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. |
| `type`     | `string`         | -        | A URI reference that identifies the problem type                                                                                     |

**404** - Not found

| Property   | Type             | Required | Description                                                                                                                          |
| ---------- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `@context` | `object`         | -        |                                                                                                                                      |
| `@id`      | `string`         | Yes      |                                                                                                                                      |
| `@type`    | `string`         | Yes      |                                                                                                                                      |
| `title`    | `string \| null` | -        | A short, human-readable summary of the problem.                                                                                      |
| `detail`   | `string \| null` | -        | A human-readable explanation specific to this occurrence of the problem.                                                             |
| `status`   | `number \| null` | -        |                                                                                                                                      |
| `instance` | `string \| null` | -        | A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. |
| `type`     | `string`         | -        | A URI reference that identifies the problem type                                                                                     |

**409** - The organization cannot be deleted in its current state

| Property     | Type      | Required | Description |
| ------------ | --------- | -------- | ----------- |
| `error_code` | `string`  | Yes      |             |
| `title`      | `string`  | Yes      |             |
| `detail`     | `string`  | Yes      |             |
| `status`     | `integer` | Yes      |             |

## Examples

### Example request

```bash
curl -X DELETE 'https://identity.flowkiwi.net/api/organizations/<organization_id>' \
  -H 'Authorization: Bearer {token}' \
  -H 'Accept: application/ld+json'
```
