---
title: "ktm tests archive"
description: "Archive a test (sets archived=true via PUT)"
sidebarTitle: "archive"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Archive a test (sets archived=true via PUT)

## Usage

```bash
ktm tests archive <id> [flags]
```

## Examples

```bash
ktm tests archive 99
```

## Arguments

| Argument | Required |
| --- | --- |
| `id` | Yes |

## Details

Flips the test's archived flag to true. No other fields are changed. The test stays in its current collection — use 'tests delete' to move it to trash instead.

Uses PATCH with a minimal body (only \{archived\}). This avoids the fragile full-payload round-trip that can 500 on tests whose action types aren't in the CLI registry.

## Notes

- Hides a test without deleting it; reversible with [`ktm tests unarchive`](/cli/commands/tests/unarchive). To move a test to trash instead, use [`ktm tests delete`](/cli/commands/tests/delete).

## Related

- [`ktm tests`](/cli/commands/tests)
- [`ktm tests delete`](/cli/commands/tests/delete)

<Note>
  Global flags (`--output`, `--debug`, `--host`, …) apply to every command. See the [command reference overview](/cli/commands/overview).
</Note>

## What's next?

<Columns cols={2}>
  <Card title="All commands" icon="terminal" href="/cli/commands/overview">
    Browse the full CLI reference.
  </Card>
  <Card title="Get started" icon="rocket" href="/cli/getting-started">
    Install the CLI and authenticate.
  </Card>
</Columns>
