# Update a topic

`PATCH /v1/topics/{id}`

Requires an API key with the `topics:write` scope. [About keys and scopes](/docs/api/authentication)

Admin. Changing `mode` changes who the topic reaches at once; contacts who chose explicitly keep their choice.

## Path parameters

- `id` (string, required, uuid)

## Request body

- `name` (string, optional, 1–100 characters) — Unique within the workspace.
- `description` (string | null, optional, up to 500 characters)
- `mode` (string, optional, one of `opt_out`, `opt_in`, default `"opt_out"`) — Who the topic reaches: everyone who has not left, or only who joined.

## Returns

Returns `200 OK`. Otherwise returns an error; [Errors](/docs/api/errors) lists every code and which to retry.

- `id` (string, required, uuid)
- `name` (string, required)
- `description` (string | null, required)
- `mode` (string, required, one of `opt_out`, `opt_in`) — `opt_out` reaches everyone who has not left; `opt_in` only those who joined.
- `createdAt` (string, required, date-time)
- `updatedAt` (string, required, date-time)

## Example

```bash
curl -X PATCH https://api.kirora.io/v1/topics/018f2a4e-6b1c-7d3e-9f40-37386ae05a6b \
  -H "Authorization: Bearer $KIRORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Weekend specials",
    "description": "description_example",
    "mode": "opt_out"
  }'
```

Response `200`:

```json
{
  "data": {
    "id": "018f2a4e-6b1c-7d3e-9f40-37386ae05a6b",
    "name": "Weekend specials",
    "description": "description_example",
    "mode": "opt_out",
    "createdAt": "2030-03-14T09:30:00Z",
    "updatedAt": "2030-03-14T09:30:00Z"
  }
}
```
