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

# Delete Agent

`DELETE /agents/{id}`

## Request

- Base URL: `https://api.instruxi.dev/api/v1/enforcer`
- URL: `https://api.instruxi.dev/api/v1/enforcer/agents/{id}`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `X-API-Key`

Soft delete (manager() only): revokes every credential, disables its OAuth clients, deactivates the service account, removes it from every group (one audit event each) and hides the agent. Leaf rows stay owned by the service account. `purge=true` (tenant_manage only) also hard-deletes the agent row, its credentials and its clients.

## Path parameters

- `id` string, required

## Query parameters

- `purge` boolean

## Response `200`

OK

- InternalDeliveryHttpHandlerOKResponse
  - `success` boolean

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found

---

[API](https://skmtc.dev/instruxi/apis/enforcer-api.md) · [All operations](https://skmtc.dev/instruxi/apis/enforcer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/instruxi/apis/enforcer-api/revisions/fa82bc1becc0?raw)
