---
title: "Delete an agent"
method: DELETE
path: "/api/v1/agents/{id}"
tags: ["Agents"]
---

# Delete an agent

`DELETE /api/v1/agents/{id}`

## Request

- Base URL: `https://app.lastping.dev`
- URL: `https://app.lastping.dev/api/v1/agents/{id}`
- Auth: API key in header `X-Api-Key`

Permanently removes the agent from the project and returns 204 No
Content.

**This does NOT delete the agent's monitors.** Every monitor it owned
has its `agent_id` set to null and keeps
running, keeps its ping history and incidents, and keeps alerting
exactly as before — it simply becomes unowned. To remove the
monitors themselves, delete them individually via
`DELETE /api/v1/checks/{id}`.

## Response `204`

Agent deleted. Its former monitors are unowned, not deleted.

## Other responses

- `400`: id is not a valid UUID.
- `401`: Missing or invalid API key.
- `404`: Agent not found in this project.

---

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