---
title: "Delete an agent"
method: DELETE
path: "/v1/{organization}/organization/agent/{agent_id}/"
tags: ["Organization"]
---

# Delete an agent

`DELETE /v1/{organization}/organization/agent/{agent_id}/`

Delete the specified agent from the organization. In practice, this endpoint marks the agent as deprecated, but will not delete
this agent nor any of its versions. It does prevent new services (or inactive services to be activated) from using this agent.

An error will be raised if this endpoint is called when an active service still utilizes this agent. However, any ongoing conversation using this agent
will continue to work.

#### Permissions:
* `Organization:DeleteAgent` for the agent to delete.

## Path parameters

- `agent_id` string, required — The ID of the agent to delete
- `organization` string, required

## Headers

- `x-mongo-cluster-name` string, nullable — The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
- `Sec-WebSocket-Protocol` string[]

## Response `200`

Succeeded.

- unknown

## Other responses

- `400` — An active service exists that utilizes this agent.
- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — The specified organization or agent does not exist.
- `409` — The specified agent is already deleted
- `422` — Invalid request path parameter failed validation.
- `429` — The user has exceeded the rate limit of 10 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

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