---
title: "Delete an agent policy"
method: POST
path: "/api/fleet/agent_policies/delete"
tags: ["Elastic Agent policies"]
---

# Delete an agent policy

`POST /api/fleet/agent_policies/delete`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/fleet/agent_policies/delete</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Delete an agent policy by ID.<br/><br/>[Required authorization] Route required privileges: fleet-agent-policies-all.

## Headers

- `kbn-xsrf` string, required

## Request body

- KibanaHTTPAPIsDeleteAgentPolicyRequest
  - `agentPolicyId` string, required — The ID of the agent policy
  - `force` boolean — bypass validation checks that can prevent agent policy deletion

## Response `200`

Successful response

- KibanaHTTPAPIsDeleteAgentPolicyResponse
  - `id` string, required
  - `name` string, required

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
