---
title: "Delete the agent — only with zero live sessions (409 agent_has_sessions) [admin]"
method: DELETE
path: "/agents/{id}"
---

# Delete the agent — only with zero live sessions (409 agent_has_sessions) \[admin\]

`DELETE /agents/{id}`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/agents/{id}`
- Auth: HTTP bearer

An agent that never had a session is deleted (outcome deleted). One whose sessions were all deleted is archived instead (outcome archived), so their history keeps naming it: it stays readable, is listed with archived: true, and starts no new sessions — the same state POST /agents/{id}/archive leaves.

## Path parameters

- `id` string, required

## Response `200`

OK

- object
  - `ok` true, required
  - `outcome` 'deleted' | 'archived', required

## Other responses

- `default`: Error — { error: { code, message, request_id } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 breaking, 1 warning, 5 info
  - the `ok` response property const value `true` was removed for the status `200`
  - added the new `true` enum value to the `ok` response property for the response status `200`
  - added the optional property `error/request_id` to the response with the `default` status
  - the response property `error` became required for the status `default`
  - …3 more

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/agents/:id/delete.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/0d435187cd55?raw)
