---
title: "Archive topic"
method: POST
path: "/topics/{topicId}/archive"
tags: ["Topics"]
---

# Archive topic

`POST /topics/{topicId}/archive`

## Request

- Base URL: `https://api.modem.dev/v1`
- URL: `https://api.modem.dev/v1/topics/{topicId}/archive`
- Auth: HTTP bearer

Archive a topic or restore an archived topic by ID. Archive only the requested topic. Agent archive calls require a nonblank archivedReason; omit archivedReason when restoring. Superseded topics cannot be changed. Repeated calls preserve the original archive decision and history.

## Path parameters

- `topicId` string, uuid, required: ID of the topic to archive or restore.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `archived` boolean, required: True to archive; false to restore.
  - `archivedReason` string: Reason for archiving. Agent archive calls require a nonblank reason. Omit when restoring.

## Response `200`

OK

- object
  - `archived` boolean, required
  - `archivedAt` string, date-time, nullable, required
  - `archivedByUserId` union, required
    - string
    - string
  - `archivedReason` string, nullable, required
  - `topicId` string, uuid, required

## Other responses

- `400`: Invalid request (validation failed).
- `401`: Missing or invalid API key.
- `403`: The API key does not have access to this resource.
- `404`: The requested resource was not found.
- `409`: The request conflicts with an existing resource or idempotency operation.
- `429`: Rate limit exceeded.
- `500`: Internal server error.

---

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