# Create organization

Canonical page: https://docs.ovok.com/api/slim/organization/create-organization

`POST /v1/slim/organization`

Creates an organization (a zone in the Slim dashboard), optionally as a child of another zone.

**Auth:** Bearer token. The caller must be a practitioner, an admin, a super admin, or hold the "System Owner" access policy. The access policy must grant `Organization:create` (an admin or super admin who holds no access policy skips this check).
**Scope:** The organization is created in the caller's project (from the token). A super-admin caller can pass `?projectId=<uuid>` to create it in that project instead. Any other caller who passes `projectId` gets a 403.

## Behaviour

- `name` must be unique. The check is an exact name match against the organizations your token can search. With `?projectId`, the check runs in that project only.
- `parentOrganizationId`, when set, must name an organization in your own project. A sub-project's or parent project's organization is refused. The new zone's `partOf` points at it.
- `description`, when non-empty, is stored as the organization's narrative text. `null` or an empty string stores nothing.
- The write is atomic and takes a short write lock. A concurrent write to the same resources gets a 409.
- A zone-created entry is added to the change history. A failure to write that entry does not fail the request.
- The response is the created organization, in the same shape as `GET /v1/slim/organization/{id}`.

## Example

```bash
curl -X POST 'https://api.sandbox.ovok.com/v1/slim/organization' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Ward A",
    "parentOrganizationId": "87ea5dfc-8b8e-384d-8489-79496e706390",
    "description": "Ground floor"
  }'
```
