---
title: "Archive or unarchive an agent"
method: DELETE
path: "/agent/{id}/archive"
tags: ["Agents"]
---

# Archive or unarchive an agent

`DELETE /agent/{id}/archive`

Soft-archives the agent — it is excluded from listings and stops accepting calls,
but all data is preserved and the operation is fully reversible.

Pass `?on=false` to unarchive (restore) a previously archived agent.

**409 is returned when:**
- The agent is already in the requested state (`"Agent is already archived"` / `"Agent is already active"`)
- The agent is linked to an active campaign (`"Agent is associated with the [status] campaign "[name]". Complete or remove the campaign before archiving."`)

## Path parameters

- `id` string, required

## Query parameters

- `on` boolean

## Response `200`

Agent archived or unarchived successfully

- object
  - `status` boolean
  - `data` object
    - `message` 'Agent archived' | 'Agent unarchived' — Human-readable outcome message

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `403` — Forbidden access
- `404` — Agent not found
- `409` — Conflict — agent is already in the requested state, or is linked to an active campaign.
- `500` — Internal server error

---

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