# Create an agent policy **POST /api/fleet/agent_policies** **Spaces method and path for this operation:**
post /s/{space_id}/api/fleet/agent_policies
Refer to [Spaces](http://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. [Required authorization] Route required privileges: fleet-agent-policies-all. ## Servers - http://localhost:5601: http://localhost:5601 () ## Authentication methods - Api key auth - Basic auth ## Parameters ### Headers - **kbn-xsrf** (string) A required header to protect against CSRF attacks ### Query parameters - **sys_monitoring** (boolean) ### Body: application/json (object) - **advanced_settings** (object) - **agent_features** (array[object]) - **agentless** (object) - **data_output_id** (string | null) - **description** (string) - **download_source_id** (string | null) - **fleet_server_host_id** (string | null) - **force** (boolean) - **global_data_tags** (array[object]) User defined data tags that are added to all of the inputs. The values can be strings or numbers. - **has_fleet_server** (boolean) - **id** (string) - **inactivity_timeout** (number) - **is_default** (boolean) - **is_default_fleet_server** (boolean) - **is_managed** (boolean) - **is_protected** (boolean) - **keep_monitoring_alive** (boolean | null) When set to true, monitoring will be enabled but logs/metrics collection will be disabled - **monitoring_diagnostics** (object) - **monitoring_enabled** (array[string]) - **monitoring_http** (object) - **monitoring_output_id** (string | null) - **monitoring_pprof_enabled** (boolean) - **name** (string) - **namespace** (string) - **overrides** (object | null) 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. - **required_versions** (array[object] | null) - **space_ids** (array[string]) - **supports_agentless** (boolean | null) Indicates whether the agent policy supports agentless integrations. Deprecated in favor of the Fleet agentless policies API. - **unenroll_timeout** (number) ## Responses ### 200 OK: A successful request. #### Body: application/json (object) - **item** (object) ### 400 A bad request. #### Body: application/json (object) - **error** (string) - **errorType** (string) - **message** (string) - **statusCode** (number) [Powered by Bump.sh](http://bump.sh)