Spaces method and path for this operation:
get /s/{space_id}/api/fleet/agent_policies/{agentPolicyId}/download
Refer to Spaces for more information.
Download an agent policy by ID.
[Required authorization] Route required privileges: fleet-agent-policies-read OR fleet-setup.
Query parameters
-
If true, returns the policy as a downloadable file
-
If true, returns the policy formatted for standalone agents
-
If true, returns the policy formatted for Kubernetes deployment
-
If provided, returns the policy at the specified revision. Cannot be used with standalone or kubernetes flags.
GET
/api/fleet/agent_policies/{agentPolicyId}/download
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/agent_policies/{agentPolicyId}/download' \
--header "Authorization: $API_KEY"
Response examples (200)
The agent policy download response
{
"item": "id: agent-policy-id-1\\nrevision: 1\\noutputs:\\n default:\\n type: elasticsearch\\n hosts:\\n - https://elasticsearch.example.com:9200\\n"
}
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
}