---
title: "Update Topic"
method: PATCH
path: "/api/v1/topics/{topic_id}"
tags: ["Basics"]
---

# Update Topic

`PATCH /api/v1/topics/{topic_id}`

Updates a topic's name and/or description. Only the supplied fields change. Renaming to a name already used by another active topic on the website returns `400`. Renames don't affect metrics or prompt grouping — everything joins on the topic's `id`, not its name. Returns a before/after snapshot.

## Path parameters

- `topic_id` string, uuid, required

## Request body

- object
  - `website_id` string, uuid, required — Website that owns the topic.
  - `name` string — New topic name. Trimmed; blank rejected.
  - `description` string, nullable — New topic description. Send null to clear.

## Response `200`

Topic updated

- object
  - `id` string, uuid, required
  - `name` string, required
  - `description` string, nullable, required
  - `before` object, required — Pre-update snapshot.
    - `name` string, required
    - `description` string, nullable, required

## Other responses

- `400` — Bad request - Validation error
- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - You don't have access to this website
- `404` — Not found - Topic not found, deleted, or on another website
- `500` — Internal server error

---

[API](https://skmtc.net/athenahq/apis/athenahq-api.md) · [All operations](https://skmtc.net/athenahq/apis/athenahq-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/athenahq/athenahq-api/versions/6c5d71622cb9/schema)
