# Create an organization

> Create a new organization owned by the authenticated partner.

`POST /api/organizations`

Create a new organization.

Creates a new organization. The authenticated partner (from the bearer token) automatically becomes its first owner.

> **No organization header**
>
> This is the one call you make before you have an organization, so it takes no `X-Flowkiwi-Organization-Id` header - authorization comes from the partner identity in your token.

## Request body

| Property | Type     | Required | Description |
| -------- | -------- | -------- | ----------- |
| `name`   | `string` | Yes      |             |

## Response

**201** - The created organization, with the authenticated partner as its sole owner

| Property     | Type             | Required | Description |
| ------------ | ---------------- | -------- | ----------- |
| `@context`   | `object`         | -        |             |
| `@id`        | `string`         | Yes      |             |
| `@type`      | `string`         | Yes      |             |
| `id`         | `string \| null` | -        |             |
| `name`       | `string`         | -        |             |
| `created_at` | `string`         | -        |             |
| `updated_at` | `string`         | -        |             |
| `owners`     | `Member[]`       | -        |             |
| `members`    | `Member[]`       | -        |             |

## Errors

**400** - Invalid input

| 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                                                                                     |

**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                                                                                     |

**422** - An error occurred

| Property     | Type             | Required | Description |
| ------------ | ---------------- | -------- | ----------- |
| `@context`   | `object`         | -        |             |
| `@id`        | `string`         | Yes      |             |
| `@type`      | `string`         | Yes      |             |
| `status`     | `integer`        | -        |             |
| `violations` | `object[]`       | -        |             |
| `detail`     | `string`         | -        |             |
| `type`       | `string`         | -        |             |
| `title`      | `string \| null` | -        |             |
| `instance`   | `string \| null` | -        |             |

## Examples

### Example request

```bash
curl -X POST 'https://identity.flowkiwi.net/api/organizations' \
  -H 'Authorization: Bearer {token}' \
  -H 'Accept: application/ld+json' \
  -H 'Content-Type: application/ld+json' \
  -d '{
  "name": "Acme Corp"
}'
```

### Example response

```json
{
  "@context": "/api/contexts/Organization",
  "@id": "/api/organizations/0196f3a0-1111-7000-8000-000000000001",
  "@type": "Organization",
  "id": "0196f3a0-1111-7000-8000-000000000001",
  "name": "Acme Corp",
  "created_at": "2026-01-15T09:30:00+00:00",
  "updated_at": "2026-01-20T14:05:00+00:00",
  "owners": [
    {
      "@id": "/api/members/0196f3a0-2222-7000-8000-000000000001",
      "@type": "Member",
      "id": "0196f3a0-2222-7000-8000-000000000001",
      "email": "jane@acme.example",
      "name": "Jane Doe",
      "role": "owner",
      "joined_at": "2026-01-15T09:30:00+00:00"
    }
  ],
  "members": []
}
```
