POST /api/fleet/agent_policies/delete

Spaces method and path for this operation:

post /s/{space_id}/api/fleet/agent_policies/delete

Refer to Spaces for more information.

Delete an agent policy by ID.

[Required authorization] Route required privileges: fleet-agent-policies-all.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json

Body

  • agentPolicyId string Required

    The ID of the agent policy

  • force boolean

    bypass validation checks that can prevent agent policy deletion

Responses

  • 200 application/json

    Successful response

    Hide response attributes Show response attributes object
    • id string Required
    • name string Required
  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
POST /api/fleet/agent_policies/delete
curl \
 --request POST 'https://localhost:5601/api/fleet/agent_policies/delete' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '{"agentPolicyId":"agent-policy-id-1"}'
Request example
Delete an agent policy by ID
{
  "agentPolicyId": "agent-policy-id-1"
}
Response examples (200)
The agent policy was successfully deleted
{
  "id": "agent-policy-id-1",
  "name": "My agent policy"
}
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}