---
title: "Update a topic"
method: PATCH
path: "/email/topics/{id}"
tags: ["Topics"]
---

# Update a topic

`PATCH /email/topics/{id}`

## Request

- Base URL: `https://www.unitpost.com/api/v1`
- URL: `https://www.unitpost.com/api/v1/email/topics/{id}`
- Auth: HTTP bearer

Update a topic's name or `default_opt_in` behavior, or pass `{ "archived": true | false }` to archive or restore it. Archiving a topic hides it and stops it from being targeted, but is blocked with `409` while an active campaign still targets it. To manage a single contact's preference, use [Set a contact's topic preference](#post-contacts-id-topics). Requires the `topics:write` capability.

## Request body

- TopicUpdate
  - `name` string
  - `description` string, nullable
  - `default_opt_in` boolean

## Response `200`

The updated topic.

- Topic
  - `object` 'topic', required
  - `id` string, required
  - `name` string, required
  - `description` string, nullable, required
  - `channel` 'email' | 'sms', required: Which channel the topic belongs to. Email topics are managed under `/email/topics`, SMS topics under `/sms/topics`.
  - `default_opt_in` boolean, required
  - `created_at` string, required
  - `updated_at` string, required

## Other responses

- `401`: Missing or invalid API key.
- `404`: Topic not found.
- `409`: A topic with that name already exists, or it's referenced by an active campaign.
- `422`: Validation error.

---

[API](https://skmtc.dev/unitpost/apis/unitpost-api.md) · [All operations](https://skmtc.dev/unitpost/apis/unitpost-api/llms.txt) · [OpenAPI document](https://skmtc.dev/unitpost/apis/unitpost-api/revisions/86ff7c890967?raw)
