---
title: "Delete Agent Namespace"
method: DELETE
path: "/v1/agents/{agent_id}"
tags: ["v1"]
---

# Delete Agent Namespace

`DELETE /v1/agents/{agent_id}`

## Request

- Base URL: `https://api.korely.ai`
- URL: `https://api.korely.ai/v1/agents/{agent_id}`
- Auth: HTTP bearer

Hard-delete an agent namespace: purge every memory + fact written under this
``agent_id``, so a typo or throwaway ``agent_id`` stops appearing in
``GET /v1/agents``. Soft-forgetting its data is not enough for that: the
listing counts any row carrying the namespace, forgotten ones included.
Returns the purge counts + an audit id. 404 if the namespace was never used
in this project.

``agent_id`` is percent-encoded as one path segment (``a/b`` is ``a%2Fb``);
any stored id is accepted, including one written before new ids were
required to be a single segment.

## Path parameters

- `agent_id` string, required

## Response `200`

Successful Response

- object

## Other responses

- `401`: `invalid_key`: the `Authorization: Bearer` key is missing, unknown, revoked or expired.
- `403`: `forbidden`: the key lacks the scope this operation needs; `message` names it.
- `404`: `not_found`: nothing with that id is reachable with this key.
- `422`: `invalid_request`: the body, a query parameter or a path parameter is malformed (`detail` is the list of fields that failed, `message` names the first), or the endpoint refuses a value (an empty content, an unreadable timestamp; `detail` is a sentence or `{code, message}`).
- `429`: `rate_limit_exceeded`: past the request ceiling, the per-minute one set on this install (`RATE_LIMIT_PER_MINUTE`) or, on the hosted service, the plan's minute, hour or day; `message` names the window and `Retry-After` the seconds until it resets.
- `500`: `internal_error`: the server failed on this request; `message` holds no detail of it.
- `503`: A dependency did not answer: the database while the key was checked (`unavailable`, see `Retry-After`), or the one `code` names. Nothing was written; retry.

---

[API](https://skmtc.dev/korely/apis/korely-agents-api.md) · [All operations](https://skmtc.dev/korely/apis/korely-agents-api/llms.txt) · [OpenAPI document](https://skmtc.dev/korely/apis/korely-agents-api/revisions/8a40bf09eca1?raw)
