GET /api/fleet/agent_policies/{agentPolicyId}/full

Spaces method and path for this operation:

get /s/{space_id}/api/fleet/agent_policies/{agentPolicyId}/full

Refer to Spaces for more information.

Get a full agent policy by ID.

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

Path parameters

  • agentPolicyId string Required

    The ID of the agent policy

Query parameters

  • download boolean

    If true, returns the policy as a downloadable file

  • standalone boolean

    If true, returns the policy formatted for standalone agents

  • kubernetes boolean

    If true, returns the policy formatted for Kubernetes deployment

  • revision number

    If provided, returns the policy at the specified revision. Cannot be used with standalone or kubernetes flags.

Responses

  • 200 application/json

    Successful response

    Hide response attribute Show response attribute object
    • item string | object Required

      Any of:
  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
  • 404 application/json

    Not Found

GET /api/fleet/agent_policies/{agentPolicyId}/full
curl \
 --request GET 'https://localhost:5601/api/fleet/agent_policies/{agentPolicyId}/full' \
 --header "Authorization: $API_KEY"
Response examples (200)
The full agent policy configuration
{
  "item": {
    "agent": {
      "monitoring": {
        "logs": true,
        "metrics": true
      }
    },
    "id": "agent-policy-id-1",
    "inputs": [],
    "outputs": {
      "default": {
        "hosts": [
          "https://elasticsearch.example.com:9200"
        ],
        "type": "elasticsearch"
      }
    },
    "revision": 1
  }
}
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}
Response examples (404)
No agent policy was found with the given ID
{
  "error": "Not Found",
  "message": "Agent policy not found",
  "statusCode": 404
}