# Delete Fleet Agent Policies via Dev Tools?

**URL:** <https://discuss.elastic.co/t/delete-fleet-agent-policies-via-dev-tools/369175>\
**Category:** Kibana\
**Tags:** fleet\
**Created:** [October 21, 2024, 5:57pm UTC](https://discuss.elastic.co/t/delete-fleet-agent-policies-via-dev-tools/369175 "2024-10-21T17:57:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RedneckHutch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redneckhutch/32/138265_2.png) [@RedneckHutch](https://discuss.elastic.co/u/RedneckHutch)\
**Post date:** [October 21, 2024, 5:57pm UTC](https://discuss.elastic.co/t/delete-fleet-agent-policies-via-dev-tools/369175/1 "2024-10-21T17:57:48Z")

</div>

Hey everyone! We are in the process of deploying a large number of agent policies, but recently decided to change multiple configurations about them. Since we are early on in our deployment, we would like to out right delete them as we already have a script created to generate the new ones. Is this possible via the dev tools or can we online modify then existing ones instead of deleting them?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 21, 2024, 6:34pm UTC](https://discuss.elastic.co/t/delete-fleet-agent-policies-via-dev-tools/369175/2 "2024-10-21T18:34:17Z")

</div>

Hi @RedneckHutch Welcome to the community and thanks for trying Fleet / Agent

There is an API

> **[Kibana Fleet APIs | Fleet and Elastic Agent Guide \[8.15\] | Elastic](https://www.elastic.co/guide/en/fleet/current/fleet-api-docs.html)**

> **[Fleet APIs | Fleet and Elastic Agent Guide \[8.15\] | Elastic](https://www.elastic.co/guide/en/fleet/current/fleet-apis.html#deleteAgentPolicy)**

You can execute via REST API or in Kibana Dev Tools just prefix with ` kbn:/api/fleet` should work

```auto
GET kbn:/api/fleet/agent_policies

# Result
{
  "items": [
    {
      "id": "4b8add2c-1f58-4656-8c11-97c8ec225c7a",
      "version": "WzI1Mjg2LDMyXQ==",
      "description": "",
      "monitoring_enabled": [
        "logs",
        "metrics"
      ],
      "inactivity_timeout": 1209600,
      "schema_version": "1.1.1",
      "agents": 0,
      "name": "test-policy",
      "namespace": "default",
      "is_protected": false,
      "status": "active",
.....
}

# DELETE 

POST kbn:/api/fleet/agent_policies/delete
{
  "agentPolicyId" : "4b8add2c-1f58-4656-8c11-97c8ec225c7a"
}

# Result
{
  "id": "4b8add2c-1f58-4656-8c11-97c8ec225c7a",
  "name": "test-policy"
}
```

---

<div class="post-metadata">

**Author:** ![RedneckHutch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redneckhutch/32/138265_2.png) [@RedneckHutch](https://discuss.elastic.co/u/RedneckHutch)\
**Post date:** [October 22, 2024, 5:34pm UTC](https://discuss.elastic.co/t/delete-fleet-agent-policies-via-dev-tools/369175/3 "2024-10-22T17:34:52Z")

</div>

> [@stephenb](#):
>
> `POST kbn:/api/fleet/agent_policies/delete`

That worked. Thank you!
