---
title: "Archive an agent (soft-delete)"
method: DELETE
path: "/agents/{id}"
tags: ["Agents"]
---

# Archive an agent (soft-delete)

`DELETE /agents/{id}`

Soft-deletes the agent. **If the agent's auto-created workspace
has no other active agents**, the workspace is also
soft-deleted in the same transaction. Hand-supplied workspaces
(those passed in `workspaceId` on create) are never
auto-deleted.

## Response `200`

Archived

- object
  - `agent` object, required
    - `object` 'agent', required
    - `id` string, uuid, required
    - `deletedAt` string, date-time, required
  - `workspace` object, required
    - `object` 'workspace', required
    - `id` string, uuid, required
    - `deletedAt` string, date-time, nullable, required — ISO timestamp when the workspace cascade-deleted along with the agent, or `null` when it was preserved (hand-supplied, or still has other active agents). Only auto-created workspaces are ever cascade-deleted.

## Other responses

- `404` — Agent not found (or belongs to another org)

---

[API](https://skmtc.net/origami/apis/origami-agent-api.md) · [All operations](https://skmtc.net/origami/apis/origami-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/origami/origami-agent-api/revisions/8083ad7fe081/schema)
