---
title: "Archive thread"
method: POST
path: "/v1/threads/{threadId}/archive"
tags: ["threads"]
---

# Archive thread

`POST /v1/threads/{threadId}/archive`

Archive a captain thread. If the thread is actively running, the archive succeeds first and then the API attempts to stop the active run on a best-effort basis.

## Path parameters

- `threadId` string, required

## Request body

- ArchiveThreadBody
  - `impersonateUserEmail` string, email

## Response `200`

Success

- ArchiveThreadResponse
  - `id` string, required
  - `status` 'active' | 'idle' | 'archived', required

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `422` — Validation error
- `500` — Internal error

---

[API](https://skmtc.dev/capy/apis/capy-api.md) · [All operations](https://skmtc.dev/capy/apis/capy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/capy/capy-api/revisions/c9ea28cb32b6/schema)
