# Delete an agent

> Deletes an agent by ID. Fails with `409` if the agent has dependent generations or traces, unless `force=true` is passed, in which case those generations and traces are deleted along with the agent.

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Delete an agent"}
>
</Heading>

<MethodEndpoint
  method={"delete"}
  path={"/api/v1/agents/{agent_id}"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Deletes an agent by ID. Fails with `409` if the agent has dependent generations or traces, unless `force=true` is passed, in which case those generations and traces are deleted along with the agent.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
>
  <Translate id="theme.openapi.request.title">Request</Translate>
</Heading>

<ParamsDetails
  {...require("./delete-agent.ParamsDetails.json")}
>
  
</ParamsDetails>

<RequestSchema
  {...require("./delete-agent.RequestSchema.json")}
>
  
</RequestSchema>

<StatusCodes
  {...require("./delete-agent.StatusCodes.json")}
>
  
</StatusCodes>
