# Rename an organization

> Change an organization's display name.

`PATCH /api/organizations/{id}`

Rename an organization.

Updates an organization's display name. Only owners can rename. The body is a [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7396) document.

> **Owners only**
>
> Renaming is restricted to organization owners. Members without the owner role receive a `403`.

## Path parameters

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

## Request body

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

## Response

**200** - Organization resource updated

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

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

**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 PATCH 'https://identity.flowkiwi.net/api/organizations/<organization_id>' \
  -H 'Authorization: Bearer {token}' \
  -H 'Accept: application/ld+json' \
  -H 'Content-Type: application/merge-patch+json' \
  -d '{}'
```

### Example response

```json
{
  "@context": "string",
  "@id": "string",
  "@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": [
    {
      "@context": "string",
      "@id": "string",
      "@type": "Member",
      "id": "0196f3a0-2222-7000-8000-000000000002",
      "email": "john@acme.example",
      "name": "John Smith",
      "role": "member",
      "joined_at": "2026-01-18T11:00:00+00:00"
    }
  ],
  "members": [
    {
      "@context": "string",
      "@id": "string",
      "@type": "Member",
      "id": "0196f3a0-2222-7000-8000-000000000002",
      "email": "john@acme.example",
      "name": "John Smith",
      "role": "member",
      "joined_at": "2026-01-18T11:00:00+00:00"
    }
  ]
}
```
