v53

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-076771,7565.2 MB
Elastic Agent policies

Create an agent policy

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</span></div>

Refer to Spaces for more information.

Create a new agent policy.<br/><br/>[Required authorization] Route required privileges: fleet-agent-policies-all.

post/api/fleet/agent_policies

Query parameters

sys_monitoringboolean

Whether to add the system integration to the new agent policy

Headers

kbn-xsrfstring required
Example:true

A required header to protect against CSRF attacks

Request body

data_output_idstring nullable
descriptionstring
download_source_idstring nullable
fleet_server_host_idstring nullable
forceboolean
has_agent_version_conditionsboolean
has_fleet_serverboolean
idstring
inactivity_timeoutnumber
is_defaultboolean
is_default_fleet_serverboolean
is_managedboolean
is_protectedboolean
is_verifierboolean
keep_monitoring_aliveboolean nullable

When set to true, monitoring will be enabled but logs/metrics collection will be disabled

min_agent_versionstring nullable
monitoring_enabledstring[]
monitoring_output_idstring nullable
monitoring_pprof_enabledboolean
namestring required
namespacestring required
overridesobject nullable

Override settings that are defined in the agent policy. Input settings cannot be overridden. The override option should be used only in unusual circumstances and not as a routine procedure.

space_idsstring[]
supports_agentlessboolean nullable

Indicates whether the agent policy supports agentless integrations. Deprecated in favor of the Fleet managed integrations API.

unenroll_timeoutnumber

Response

Successful response