# Set a contact's topic choice

`PUT /v1/contacts/{id}/topics/{topicId}`

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

Any member, or a key with `contacts:write` (never an agent key), as for consent. Recorded in consent history with the member or key as actor. With `channel`, the choice is for that channel only (keep Product updates by email, not by push); without it, it holds for every channel and clears channel choices.

## Path parameters

- `id` (string, required, uuid)
- `topicId` (string, required, uuid)

## Request body

- `subscribed` (boolean, required) — True to join the topic, false to leave it.
- `channel` (string, optional, one of `email`, `push`) — One channel's choice; omitted, the choice holds for every channel.

## 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)
- `subscribed` (boolean, required) — Whether campaigns and journey steps on this topic reach the contact.
- `channels` (object, required) — The same per channel: a channel's own choice wins over `subscribed` there.
  - `email` (boolean, required)
  - `push` (boolean, required)

## Example

```bash
curl -X PUT https://api.kirora.io/v1/contacts/018f2a4e-6b1c-7d3e-9f40-37386ae05a6b/topics/018f2a4e-6b1c-7d3e-9f40-84e01f695a6b \
  -H "Authorization: Bearer $KIRORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subscribed": true
  }'
```

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",
    "subscribed": true,
    "channels": {
      "email": true,
      "push": true
    }
  }
}
```
