Path parameters
-
id
string Required The identifier for the rule.
curl \
--request GET 'https://<KIBANA_URL>/api/alerting/rule/{id}' \
--header "Authorization: $API_KEY"
{
"actions": [
{
"alerts_filter": {
"query": {
"dsl": "string",
"filters": [
{
"$state": {
"store": "appState"
},
"meta": {},
"query": {}
}
],
"kql": "string"
},
"timeframe": {
"days": [
1
],
"hours": {
"end": "string",
"start": "string"
},
"timezone": "string"
}
},
"connector_type_id": "string",
"frequency": {
"notify_when": "onActionGroupChange",
"summary": true,
"throttle": "string"
},
"group": "string",
"id": "string",
"params": {},
"use_alert_data_for_template": true,
"uuid": "string"
}
],
"active_snoozes": [
"string"
],
"alert_delay": {
"active": 42.0
},
"api_key_created_by_user": true,
"api_key_owner": "string",
"consumer": "string",
"created_at": "string",
"created_by": "string",
"enabled": true,
"execution_status": {
"error": {
"message": "string",
"reason": "read"
},
"last_duration": 42.0,
"last_execution_date": "string",
"status": "ok",
"warning": {
"message": "string",
"reason": "maxExecutableActions"
}
},
"flapping": {
"look_back_window": 42.0,
"status_change_threshold": 42.0
},
"id": "string",
"is_snoozed_until": "string",
"last_run": {
"alerts_count": {
"active": 42.0,
"ignored": 42.0,
"new": 42.0,
"recovered": 42.0
},
"outcome": "succeeded",
"outcome_msg": [
"string"
],
"outcome_order": 42.0,
"warning": "read"
},
"mapped_params": {},
"monitoring": {
"run": {
"calculated_metrics": {
"p50": 42.0,
"p95": 42.0,
"p99": 42.0,
"success_ratio": 42.0
},
"history": [
{
"duration": 42.0,
"outcome": "succeeded",
"success": true,
"timestamp": 42.0
}
],
"last_run": {
"metrics": {
"duration": 42.0,
"gap_duration_s": 42.0,
"gap_range": {
"gte": "string",
"lte": "string"
},
"total_alerts_created": 42.0,
"total_alerts_detected": 42.0,
"total_indexing_duration_ms": 42.0,
"total_search_duration_ms": 42.0
},
"timestamp": "string"
}
}
},
"mute_all": true,
"muted_alert_ids": [
"string"
],
"name": "string",
"next_run": "string",
"notify_when": "onActionGroupChange",
"params": {},
"revision": 42.0,
"rule_type_id": "string",
"running": true,
"schedule": {
"interval": "string"
},
"scheduled_task_id": "string",
"snooze_schedule": [
{
"duration": 42.0,
"id": "string",
"rRule": {
"byhour": [
42.0
],
"byminute": [
42.0
],
"bymonth": [
42.0
],
"bymonthday": [
42.0
],
"bysecond": [
42.0
],
"bysetpos": [
42.0
],
"byweekday": [
"string"
],
"byweekno": [
42.0
],
"byyearday": [
42.0
],
"count": 42.0,
"dtstart": "string",
"freq": 0,
"interval": 42.0,
"tzid": "string",
"until": "string",
"wkst": "MO"
},
"skipRecurrences": [
"string"
]
}
],
"tags": [
"string"
],
"throttle": "string",
"updated_at": "string",
"updated_by": "string",
"view_in_app_relative_url": "string"
}
Path parameters
-
id
string Required The identifier for the rule. If it is omitted, an ID is randomly generated.
Body
-
actions
array[object] An action that runs under defined conditions.
Default value is
[]
(empty). -
alert_delay
object Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.
Additional properties are NOT allowed.
-
consumer
string Required The name of the application or feature that owns the rule. For example:
alerts
,apm
,discover
,infrastructure
,logs
,metrics
,ml
,monitoring
,securitySolution
,siem
,stackAlerts
, oruptime
. -
enabled
boolean Indicates whether you want to run the rule on an interval basis after it is created.
Default value is
true
. -
flapping
object | null When flapping detection is turned on, alerts that switch quickly between active and recovered states are identified as “flapping” and notifications are reduced.
Additional properties are NOT allowed.
-
name
string Required The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.
-
notify_when
string | null Indicates how often alerts generate actions. Valid values include:
onActionGroupChange
: Actions run when the alert status changes;onActiveAlert
: Actions run when the alert becomes active and at each check interval while the rule conditions are met;onThrottleInterval
: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specifynotify_when
at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.Values are
onActionGroupChange
,onActiveAlert
, oronThrottleInterval
. -
rule_type_id
string Required The rule type identifier.
-
schedule
object Required The check interval, which specifies how frequently the rule conditions are checked.
Additional properties are NOT allowed.
-
throttle
string | null Use the
throttle
property in the actionfrequency
object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. params
object The parameters for the rule.
Any of: params_property_apm_anomalyobject params_property_apm_error_countobject params_property_apm_transaction_durationobject params_property_apm_transaction_error_rateobject params_es_query_dsl_ruleobject params_es_query_esql_ruleobject params_es_query_kql_ruleobject params_index_threshold_ruleobject params_property_infra_inventoryobject Countobject Ratioobject params_property_infra_metric_thresholdobject params_property_slo_burn_rateobject params_property_synthetics_uptime_tlsobject params_property_synthetics_monitor_statusobject
curl \
--request POST 'https://<KIBANA_URL>/api/alerting/rule/{id}' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"name":"my Elasticsearch query ESQL rule","params":{"size":0,"esqlQuery":{"esql":"FROM kibana_sample_data_logs | KEEP bytes, clientip, host, geo.dest | where geo.dest != \"GB\" | STATS sumbytes = sum(bytes) by clientip, host | WHERE sumbytes \u003e 5000 | SORT sumbytes desc | LIMIT 10"},"threshold":[0],"timeField":"@timestamp","searchType":"esqlQuery","timeWindowSize":1,"timeWindowUnit":"d","thresholdComparator":"\u003e"},"actions":[{"id":"d0db1fe0-78d6-11ee-9177-f7d404c8c945","group":"query matched","params":{"level":"info","message":"Elasticsearch query rule '{{rule.name}}' is active:\n- Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}}"},"frequency":{"summary":false,"notify_when":"onActiveAlert"}}],"consumer":"stackAlerts","schedule":{"interval":"1d"},"rule_type_id":".es-query"}'
{
"name": "my Elasticsearch query ESQL rule",
"params": {
"size": 0,
"esqlQuery": {
"esql": "FROM kibana_sample_data_logs | KEEP bytes, clientip, host, geo.dest | where geo.dest != \"GB\" | STATS sumbytes = sum(bytes) by clientip, host | WHERE sumbytes > 5000 | SORT sumbytes desc | LIMIT 10"
},
"threshold": [
0
],
"timeField": "@timestamp",
"searchType": "esqlQuery",
"timeWindowSize": 1,
"timeWindowUnit": "d",
"thresholdComparator": ">"
},
"actions": [
{
"id": "d0db1fe0-78d6-11ee-9177-f7d404c8c945",
"group": "query matched",
"params": {
"level": "info",
"message": "Elasticsearch query rule '{{rule.name}}' is active:\n- Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}}"
},
"frequency": {
"summary": false,
"notify_when": "onActiveAlert"
}
}
],
"consumer": "stackAlerts",
"schedule": {
"interval": "1d"
},
"rule_type_id": ".es-query"
}
{
"name": "my Elasticsearch query KQL rule",
"params": {
"size": 100,
"aggType": "count",
"groupBy": "all",
"threshold": [
1000
],
"searchType": "searchSource",
"timeWindowSize": 5,
"timeWindowUnit": "m",
"searchConfiguration": {
"index": "90943e30-9a47-11e8-b64d-95841ca0b247",
"query": {
"query": "\"\"geo.src : \"US\" \"\"",
"language": "kuery"
}
},
"thresholdComparator": ">",
"excludeHitsFromPreviousRun": true
},
"consumer": "alerts",
"schedule": {
"interval": "1m"
},
"rule_type_id": ".es-query"
}
{
"name": "my Elasticsearch query rule",
"params": {
"size": 100,
"index": [
"kibana_sample_data_logs"
],
"esQuery": "\"\"\"{\"query\":{\"match_all\" : {}}}\"\"\"",
"threshold": [
100
],
"timeField": "@timestamp",
"timeWindowSize": 1,
"timeWindowUnit": "d",
"thresholdComparator": ">"
},
"actions": [
{
"id": "fdbece50-406c-11ee-850e-c71febc4ca7f",
"group": "query matched",
"params": {
"level": "info",
"message": "The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}} ongoing, and {{alerts.recovered.count}} recovered alerts."
},
"frequency": {
"summary": true,
"throttle": "1d",
"notify_when": "onThrottleInterval"
}
},
{
"id": "fdbece50-406c-11ee-850e-c71febc4ca7f",
"group": "recovered",
"params": {
"level": "info",
"message": "Recovered"
},
"frequency": {
"summary": false,
"notify_when": "onActionGroupChange"
}
}
],
"consumer": "alerts",
"schedule": {
"interval": "1d"
},
"rule_type_id": ".es-query"
}
{
"name": "my rule",
"tags": [
"cpu"
],
"params": {
"index": [
".test-index"
],
"aggType": "avg",
"groupBy": "top",
"aggField": "sheet.version",
"termSize": 6,
"termField": "name.keyword",
"threshold": [
1000
],
"timeField": "@timestamp",
"timeWindowSize": 5,
"timeWindowUnit": "m",
"thresholdComparator": ">"
},
"actions": [
{
"id": "48de3460-f401-11ed-9f8e-399c75a2deeb",
"group": "threshold met",
"params": {
"level": "info",
"message": "Rule '{{rule.name}}' is active for group '{{context.group}}':\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}"
},
"frequency": {
"summary": false,
"notify_when": "onActionGroupChange"
}
}
],
"consumer": "alerts",
"schedule": {
"interval": "1m"
},
"alert_delay": {
"active": 3
},
"rule_type_id": ".index-threshold"
}
{
"name": "my tracking rule",
"params": {
"index": "kibana_sample_data_logs",
"entity": "agent.keyword",
"indexId": "90943e30-9a47-11e8-b64d-95841ca0b247",
"geoField": "geo.coordinates",
"dateField\"": "@timestamp",
"boundaryType": "entireIndex",
"boundaryIndexId": "0cd90abf-abe7-44c7-909a-f621bbbcfefc",
"boundaryGeoField": "location",
"boundaryNameField": "name",
"boundaryIndexTitle": "boundary*"
},
"consumer": "alerts",
"schedule": {
"interval": "1h"
},
"rule_type_id": ".geo-containment"
}
{
"id": "e0d62360-78e8-11ee-9177-f7d404c8c945",
"name": "my Elasticsearch query ESQL rule",
"tags": [],
"params": {
"size": 0,
"aggType": "count",
"groupBy": "all",
"esqlQuery": {
"esql": "FROM kibana_sample_data_logs | keep bytes, clientip, host, geo.dest | WHERE geo.dest != \"GB\" | stats sumbytes = sum(bytes) by clientip, host | WHERE sumbytes > 5000 | sort sumbytes desc | limit 10"
},
"threshold": [
0
],
"timeField": "@timestamp",
"searchType": "esqlQuery",
"timeWindowSize": 1,
"timeWindowUnit": "d",
"thresholdComparator": ">",
"excludeHitsFromPreviousRun\"": "true,"
},
"actions": [
{
"id": "d0db1fe0-78d6-11ee-9177-f7d404c8c945",
"uuid": "bfe370a3-531b-4855-bbe6-ad739f578844",
"group": "query matched",
"params": {
"level": "info",
"message": "Elasticsearch query rule '{{rule.name}}' is active:\n- Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}}"
},
"frequency": {
"summary": false,
"throttle": null,
"notify_when": "onActiveAlert"
},
"connector_type_id": ".server-log"
}
],
"enabled": true,
"running": false,
"consumer": "stackAlerts",
"mute_all": false,
"revision": 0,
"schedule": {
"interval": "1d"
},
"throttle": null,
"created_at": "2023-11-01T19:00:10.453Z",
"created_by": "elastic",
"updated_at": "2023-11-01T19:00:10.453Z",
"updated_by": "elastic\",",
"notify_when": null,
"rule_type_id": ".es-query",
"api_key_owner": "elastic",
"muted_alert_ids": [],
"execution_status": {
"status": "pending",
"last_execution_date": "2023-11-01T19:00:10.453Z"
},
"scheduled_task_id": "e0d62360-78e8-11ee-9177-f7d404c8c945",
"api_key_created_by_user": false
}
{
"id": "7bd506d0-2284-11ee-8fad-6101956ced88",
"name": "my Elasticsearch query KQL rule\"",
"tags": [],
"params": {
"size": 100,
"aggType": "count",
"groupBy": "all",
"threshold": [
1000
],
"searchType": "searchSource",
"timeWindowSize": 5,
"timeWindowUnit": "m",
"searchConfiguration": {
"index": "90943e30-9a47-11e8-b64d-95841ca0b247",
"query": {
"query": "\"\"geo.src : \"US\" \"\"",
"language": "kuery"
}
},
"thresholdComparator": ">",
"excludeHitsFromPreviousRun": true
},
"actions": [],
"enabled": true,
"running": false,
"consumer": "alerts",
"mute_all": false,
"revision": 0,
"schedule": {
"interval": "1m"
},
"throttle": null,
"created_at": "2023-07-14T20:24:50.729Z",
"created_by": "elastic",
"updated_at": "2023-07-14T20:24:50.729Z",
"updated_by": "elastic",
"notify_when": null,
"rule_type_id": ".es-query",
"api_key_owner": "elastic",
"muted_alert_ids": [],
"execution_status": {
"status": "pending",
"last_execution_date": "2023-07-14T20:24:50.729Z"
},
"scheduled_task_id": "7bd506d0-2284-11ee-8fad-6101956ced88",
"api_key_created_by_user": false
}
{
"id": "58148c70-407f-11ee-850e-c71febc4ca7f",
"name": "my Elasticsearch query rule",
"tags": [],
"params": {
"size": 100,
"index": [
"kibana_sample_data_logs"
],
"aggType": "count",
"esQuery": "\"\"\"{\"query\":{\"match_all\" : {}}}\"\"\"",
"groupBy": "all",
"threshold": [
100
],
"timeField": "@timestamp",
"searchType": "esQuery",
"timeWindowSize": 1,
"timeWindowUnit": "d",
"thresholdComparator": ">",
"excludeHitsFromPreviousRun": true
},
"actions": [
{
"id": "fdbece50-406c-11ee-850e-c71febc4ca7f",
"uuid": "53f3c2a3-e5d0-4cfa-af3b-6f0881385e78",
"group": "query matched",
"params": {
"level": "info",
"message": "The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}} ongoing, and {{alerts.recovered.count}} recovered alerts."
},
"frequency": {
"summary": true,
"throttle": "1d",
"notify_when": "onThrottleInterval"
},
"connector_type_id": ".server-log"
},
{
"id": "fdbece50-406c-11ee-850e-c71febc4ca7f",
"uuid": "2324e45b-c0df-45c7-9d70-4993e30be758",
"group": "recovered",
"params": {
"level": "info",
"message": "Recovered"
},
"frequency": {
"summary": false,
"throttle": null,
"notify_when": "onActionGroupChange"
},
"connector_type_id": ".server-log"
}
],
"enabled": true,
"running": false,
"consumer": "alerts",
"mute_all": false,
"revision": 0,
"schedule": {
"interval": "1d"
},
"throttle": null,
"created_at": "2023-08-22T00:03:38.263Z",
"created_by": "elastic",
"updated_at": "2023-08-22T00:03:38.263Z",
"updated_by": "elastic",
"notify_when": null,
"rule_type_id": ".es-query",
"api_key_owner": "elastic",
"muted_alert_ids": [],
"execution_status": {
"status": "pending",
"last_execution_date": "2023-08-22T00:03:38.263Z"
},
"scheduled_task_id": "58148c70-407f-11ee-850e-c71febc4ca7f",
"api_key_created_by_user": false
}
{
"id": "41893910-6bca-11eb-9e0d-85d233e3ee35",
"name": "my rule",
"tags": [
"cpu"
],
"params": {
"index": [
".test-index"
],
"aggType": "avg",
"groupBy": "top",
"aggField": "sheet.version",
"termSize": 6,
"termField": "name.keyword",
"threshold": [
1000
],
"timeField": "@timestamp",
"timeWindowSize": 5,
"timeWindowUnit": "m",
"thresholdComparator": ">"
},
"actions": [
{
"id": "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2",
"uuid": "07aef2a0-9eed-4ef9-94ec-39ba58eb609d",
"group": "threshold met",
"params": {
"level": "info",
"message": "Rule {{rule.name}} is active for group {{context.group} :\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}"
},
"frequency": {
"summary": false,
"throttle": null,
"notify_when": "onActionGroupChange"
},
"connector_type_id": ".server-log"
}
],
"enabled": true,
"running": false,
"consumer": "alerts",
"mute_all": false,
"revision": 0,
"schedule": {
"interval": "1m"
},
"throttle": null,
"created_at": "2022-06-08T17:20:31.632Z",
"created_by": "elastic",
"updated_at": "2022-06-08T17:20:31.632Z",
"updated_by": "elastic",
"alert_delay": {
"active": 3
},
"notify_when": null,
"rule_type_id": ".index-threshold",
"api_key_owner": "elastic",
"muted_alert_ids": [],
"execution_status": {
"status": "pending",
"last_execution_date": "2022-06-08T17:20:31.632Z"
},
"scheduled_task_id": "425b0800-6bca-11eb-9e0d-85d233e3ee35",
"api_key_created_by_user": false
}
{
"id": "b6883f9d-5f70-4758-a66e-369d7c26012f",
"name": "my tracking rule",
"tags": [],
"params": {
"index": "kibana_sample_data_logs",
"entity": "agent.keyword",
"indexId": "90943e30-9a47-11e8-b64d-95841ca0b247",
"geoField": "geo.coordinates",
"dateField": "@timestamp",
"boundaryType": "entireIndex",
"boundaryIndexId": "0cd90abf-abe7-44c7-909a-f621bbbcfefc",
"boundaryGeoField": "location",
"boundaryNameField": "name",
"boundaryIndexTitle": "boundary*"
},
"actions": [],
"enabled": true,
"running": false,
"consumer": "alerts",
"last_run": {
"outcome": "succeeded",
"warning": null,
"outcome_msg": null,
"alerts_count": {
"new": 0,
"active": 0,
"ignored": 0,
"recovered": 0
},
"outcome_order": 0
},
"mute_all": false,
"next_run": "2024-02-15T03:26:38.033Z",
"revision": 1,
"schedule": {
"interval": "1h"
},
"throttle": null,
"created_at": "2024-02-14T19:52:55.920Z",
"created_by": "elastic",
"updated_at": "2024-02-15T03:24:32.574Z",
"updated_by": "elastic",
"notify_when": null,
"rule_type_id": ".geo-containment",
"api_key_owner": "elastic",
"muted_alert_ids": [],
"execution_status": {
"status": "ok",
"last_duration": 74,
"last_execution_date": "2024-02-15T03:25:38.125Z"
},
"scheduled_task_id": "b6883f9d-5f70-4758-a66e-369d7c26012f",
"api_key_created_by_user": false
}
Get CCR Remote synced integrations status
[Required authorization] Route required privileges: fleet-settings-read AND integrations-read.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/remote_synced_integrations/status' \
--header "Authorization: $API_KEY"
{
"custom_assets": {
"additionalProperty1": {
"name": "string",
"package_name": "string",
"package_version": "string",
"sync_status": "completed",
"type": "string"
},
"additionalProperty2": {
"name": "string",
"package_name": "string",
"package_version": "string",
"sync_status": "completed",
"type": "string"
}
},
"error": "string",
"integrations": [
{
"error": "string",
"id": "string",
"package_name": "string",
"package_version": "string",
"sync_status": "completed",
"updated_at": "string"
}
]
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Delete a data view
WARNING: When you delete a data view, it cannot be recovered.
Path parameters
-
viewId
string Required An identifier for the data view.
curl \
--request DELETE 'https://<KIBANA_URL>/api/data_views/data_view/ff959d40-b880-11e8-a6d9-e546fe2bba5f' \
--header "Authorization: $API_KEY" \
--header "kbn-xsrf: string"
{
"error": "Not Found",
"message": "Saved object [index-pattern/caaad6d0-920c-11ed-b36a-874bd1548a00] not found",
"statusCode": 404
}
Preview a saved object reference swap
Preview the impact of swapping saved object references from one data view identifier to another.
Body
Required
-
delete
boolean Deletes referenced saved object if all references are removed.
forId
string | array[string] Limit the affected saved objects to one or more by identifier.
-
forType
string Limit the affected saved objects by type.
-
fromId
string Required The saved object reference to change.
-
fromType
string Specify the type of the saved object reference to alter. The default value is
index-pattern
for data views. -
toId
string Required New saved object reference value to replace the old value.
curl \
--request POST 'https://<KIBANA_URL>/api/data_views/swap_references/_preview' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '{"toId":"xyz-123","fromId":"abcd-efg"}'
{
"toId": "xyz-123",
"fromId": "abcd-efg"
}
{
"result": [
{
"id": "string",
"type": "string"
}
]
}
Upgrade an agent
[Required authorization] Route required privileges: fleet-agents-all.
Path parameters
-
agentId
string Required
Body
-
force
boolean -
skipRateLimitCheck
boolean -
source_uri
string -
version
string Required
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agents/{agentId}/upgrade' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"force":true,"skipRateLimitCheck":true,"source_uri":"string","version":"string"}'
# Headers
kbn-xsrf: true
# Payload
{
"force": true,
"skipRateLimitCheck": true,
"source_uri": "string",
"version": "string"
}
{}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Get an agent action status
[Required authorization] Route required privileges: fleet-agents-read.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/agents/action_status' \
--header "Authorization: $API_KEY"
{
"items": [
{
"actionId": "string",
"cancellationTime": "string",
"completionTime": "string",
"creationTime": "string",
"expiration": "string",
"hasRolloutPeriod": true,
"is_automatic": true,
"latestErrors": [
{
"agentId": "string",
"error": "string",
"hostname": "string",
"timestamp": "string"
}
],
"nbAgentsAck": 42.0,
"nbAgentsActionCreated": 42.0,
"nbAgentsActioned": 42.0,
"nbAgentsFailed": 42.0,
"newPolicyId": "string",
"policyId": "string",
"revision": 42.0,
"startTime": "string",
"status": "COMPLETE",
"type": "UPGRADE",
"version": "string"
}
]
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Bulk reassign agents
[Required authorization] Route required privileges: fleet-agents-all.
Body
agents
array[string] | string Required -
batchSize
number -
includeInactive
boolean Default value is
false
. -
policy_id
string Required
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agents/bulk_reassign' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"agents":["string"],"batchSize":42.0,"includeInactive":false,"policy_id":"string"}'
# Headers
kbn-xsrf: true
# Payload
{
"agents": [
"string"
],
"batchSize": 42.0,
"includeInactive": false,
"policy_id": "string"
}
{
"actionId": "string"
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Get an agent policy
Get an agent policy by ID.
[Required authorization] Route required privileges: fleet-agent-policies-read OR fleet-agents-read OR fleet-setup.
Path parameters
-
agentPolicyId
string Required
Query parameters
-
format
string Values are
simplified
orlegacy
.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/agent_policies/{agentPolicyId}' \
--header "Authorization: $API_KEY"
{
"item": {
"advanced_settings": {},
"agent_features": [
{
"enabled": true,
"name": "string"
}
],
"agentless": {
"resources": {
"requests": {
"cpu": "string",
"memory": "string"
}
}
},
"agents": 42.0,
"data_output_id": "string",
"description": "string",
"download_source_id": "string",
"fleet_server_host_id": "string",
"global_data_tags": [
{
"name": "string",
"value": "string"
}
],
"has_fleet_server": true,
"id": "string",
"inactivity_timeout": 1209600,
"is_default": true,
"is_default_fleet_server": true,
"is_managed": true,
"is_preconfigured": true,
"is_protected": true,
"keep_monitoring_alive": false,
"monitoring_diagnostics": {
"limit": {
"burst": 42.0,
"interval": "string"
},
"uploader": {
"init_dur": "string",
"max_dur": "string",
"max_retries": 42.0
}
},
"monitoring_enabled": [
"logs"
],
"monitoring_http": {
"buffer": {
"enabled": false
},
"enabled": true,
"host": "string",
"port": 42.0
},
"monitoring_output_id": "string",
"monitoring_pprof_enabled": true,
"name": "string",
"namespace": "string",
"overrides": {},
"package_policies": [
"string"
],
"required_versions": [
{
"percentage": 42.0,
"version": "string"
}
],
"revision": 42.0,
"schema_version": "string",
"space_ids": [
"string"
],
"status": "active",
"supports_agentless": false,
"unenroll_timeout": 42.0,
"unprivileged_agents": 42.0,
"updated_at": "string",
"updated_by": "string",
"version": "string"
}
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Get a package file
[Required authorization] Route required privileges: integrations-read OR fleet-setup OR fleet-all.
Path parameters
-
pkgName
string Required -
pkgVersion
string Required -
filePath
string Required
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath}' \
--header "Authorization: $API_KEY"
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Get installed packages
[Required authorization] Route required privileges: integrations-read OR fleet-setup OR fleet-all.
Query parameters
-
dataStreamType
string Values are
logs
,metrics
,traces
,synthetics
, orprofiling
. -
showOnlyActiveDataStreams
boolean -
nameQuery
string -
searchAfter
array[string | number] -
perPage
number Default value is
15
. -
sortOrder
string Values are
asc
ordesc
. Default value isasc
.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/epm/packages/installed' \
--header "Authorization: $API_KEY"
{
"items": [
{
"dataStreams": [
{
"name": "string",
"title": "string"
}
],
"description": "string",
"icons": [
{
"dark_mode": true,
"path": "string",
"size": "string",
"src": "string",
"title": "string",
"type": "string"
}
],
"name": "string",
"status": "string",
"title": "string",
"version": "string"
}
],
"searchAfter": [
"string"
],
"total": 42.0
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Create an enrollment API key
[Required authorization] Route required privileges: fleet-agents-all.
Body
-
expiration
string -
name
string -
policy_id
string Required
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/enrollment_api_keys' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"expiration":"string","name":"string","policy_id":"string"}'
# Headers
kbn-xsrf: true
# Payload
{
"expiration": "string",
"name": "string",
"policy_id": "string"
}
{
"action": "created",
"item": {
"active": true,
"api_key": "string",
"api_key_id": "string",
"created_at": "string",
"id": "string",
"name": "string",
"policy_id": "string"
}
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Get settings
[Required authorization] Route required privileges: fleet-settings-read.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/settings' \
--header "Authorization: $API_KEY"
{
"item": {
"delete_unenrolled_agents": {
"enabled": true,
"is_preconfigured": true
},
"has_seen_add_data_notice": true,
"id": "string",
"output_secret_storage_requirements_met": true,
"preconfigured_fields": [
"fleet_server_hosts"
],
"prerelease_integrations_enabled": true,
"secret_storage_requirements_met": true,
"use_space_awareness_migration_started_at": "string",
"use_space_awareness_migration_status": "pending",
"version": "string"
}
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
{
"message": "string"
}
Generate a Logstash API key
[Required authorization] Route required privileges: fleet-settings-all.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/logstash_api_keys' \
--header "Authorization: $API_KEY" \
--header "kbn-xsrf: true"
{
"api_key": "string"
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Update output
Update output by ID.
[Required authorization] Route required privileges: fleet-settings-all OR fleet-agent-policies-all.
Path parameters
-
outputId
string Required
Body
object
-
allow_edit
array[string] -
ca_sha256
string | null -
ca_trusted_fingerprint
string | null -
config_yaml
string | null -
hosts
array[string(uri)] At least
1
element. -
id
string -
is_default
boolean -
is_default_monitoring
boolean -
is_internal
boolean -
is_preconfigured
boolean -
name
string -
preset
string Values are
balanced
,custom
,throughput
,scale
, orlatency
. -
proxy_id
string | null -
secrets
object Additional properties are NOT allowed.
-
shipper
object | null Additional properties are NOT allowed.
-
ssl
object | null Additional properties are NOT allowed.
-
type
string Value is
elasticsearch
.
curl \
--request PUT 'https://<KIBANA_URL>/api/fleet/outputs/{outputId}' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"allow_edit":["string"],"ca_sha256":"string","ca_trusted_fingerprint":"string","config_yaml":"string","hosts":["https://example.com"],"id":"string","is_default":true,"is_default_monitoring":true,"is_internal":true,"is_preconfigured":true,"name":"string","preset":"balanced","proxy_id":"string","secrets":{"ssl":{"key":{"id":"string"}}},"shipper":{"compression_level":42.0,"disk_queue_compression_enabled":true,"disk_queue_enabled":false,"disk_queue_encryption_enabled":true,"disk_queue_max_size":42.0,"disk_queue_path":"string","loadbalance":true,"max_batch_bytes":42.0,"mem_queue_events":42.0,"queue_flush_timeout":42.0},"ssl":{"certificate":"string","certificate_authorities":["string"],"key":"string","verification_mode":"full"},"type":"elasticsearch"}'
# Headers
kbn-xsrf: true
# Payload
{
"allow_edit": [
"string"
],
"ca_sha256": "string",
"ca_trusted_fingerprint": "string",
"config_yaml": "string",
"hosts": [
"https://example.com"
],
"id": "string",
"is_default": true,
"is_default_monitoring": true,
"is_internal": true,
"is_preconfigured": true,
"name": "string",
"preset": "balanced",
"proxy_id": "string",
"secrets": {
"ssl": {
"key": {
"id": "string"
}
}
},
"shipper": {
"compression_level": 42.0,
"disk_queue_compression_enabled": true,
"disk_queue_enabled": false,
"disk_queue_encryption_enabled": true,
"disk_queue_max_size": 42.0,
"disk_queue_path": "string",
"loadbalance": true,
"max_batch_bytes": 42.0,
"mem_queue_events": 42.0,
"queue_flush_timeout": 42.0
},
"ssl": {
"certificate": "string",
"certificate_authorities": [
"string"
],
"key": "string",
"verification_mode": "full"
},
"type": "elasticsearch"
}
# Headers
kbn-xsrf: true
# Payload
{
"allow_edit": [
"string"
],
"ca_sha256": "string",
"ca_trusted_fingerprint": "string",
"config_yaml": "string",
"hosts": [
"https://example.com"
],
"id": "string",
"is_default": true,
"is_default_monitoring": true,
"is_internal": true,
"is_preconfigured": true,
"kibana_api_key": "string",
"kibana_url": "string",
"name": "string",
"preset": "balanced",
"proxy_id": "string",
"secrets": {
"service_token": {
"id": "string"
},
"ssl": {
"key": {
"id": "string"
}
}
},
"service_token": "string",
"shipper": {
"compression_level": 42.0,
"disk_queue_compression_enabled": true,
"disk_queue_enabled": false,
"disk_queue_encryption_enabled": true,
"disk_queue_max_size": 42.0,
"disk_queue_path": "string",
"loadbalance": true,
"max_batch_bytes": 42.0,
"mem_queue_events": 42.0,
"queue_flush_timeout": 42.0
},
"ssl": {
"certificate": "string",
"certificate_authorities": [
"string"
],
"key": "string",
"verification_mode": "full"
},
"sync_integrations": true,
"sync_uninstalled_integrations": true,
"type": "remote_elasticsearch"
}
# Headers
kbn-xsrf: true
# Payload
{
"allow_edit": [
"string"
],
"ca_sha256": "string",
"ca_trusted_fingerprint": "string",
"config_yaml": "string",
"hosts": [
"string"
],
"id": "string",
"is_default": true,
"is_default_monitoring": true,
"is_internal": true,
"is_preconfigured": true,
"name": "string",
"proxy_id": "string",
"secrets": {
"ssl": {
"key": {
"id": "string"
}
}
},
"shipper": {
"compression_level": 42.0,
"disk_queue_compression_enabled": true,
"disk_queue_enabled": false,
"disk_queue_encryption_enabled": true,
"disk_queue_max_size": 42.0,
"disk_queue_path": "string",
"loadbalance": true,
"max_batch_bytes": 42.0,
"mem_queue_events": 42.0,
"queue_flush_timeout": 42.0
},
"ssl": {
"certificate": "string",
"certificate_authorities": [
"string"
],
"key": "string",
"verification_mode": "full"
},
"type": "logstash"
}
# Headers
kbn-xsrf: true
# Payload
{
"allow_edit": [
"string"
],
"auth_type": "none",
"broker_timeout": 42.0,
"ca_sha256": "string",
"ca_trusted_fingerprint": "string",
"client_id": "string",
"compression": "gzip",
"compression_level": [],
"config_yaml": "string",
"connection_type": [],
"hash": {
"hash": "string",
"random": true
},
"headers": [
{
"key": "string",
"value": "string"
}
],
"hosts": [
"string"
],
"id": "string",
"is_default": false,
"is_default_monitoring": false,
"is_internal": true,
"is_preconfigured": true,
"key": "string",
"name": "string",
"partition": "random",
"password": [],
"proxy_id": "string",
"random": {
"group_events": 42.0
},
"required_acks": 1,
"round_robin": {
"group_events": 42.0
},
"sasl": {
"mechanism": "PLAIN"
},
"secrets": {
"password": {
"id": "string"
},
"ssl": {
"key": {
"id": "string"
}
}
},
"shipper": {
"compression_level": 42.0,
"disk_queue_compression_enabled": true,
"disk_queue_enabled": false,
"disk_queue_encryption_enabled": true,
"disk_queue_max_size": 42.0,
"disk_queue_path": "string",
"loadbalance": true,
"max_batch_bytes": 42.0,
"mem_queue_events": 42.0,
"queue_flush_timeout": 42.0
},
"ssl": {
"certificate": "string",
"certificate_authorities": [
"string"
],
"key": "string",
"verification_mode": "full"
},
"timeout": 42.0,
"topic": "string",
"type": "kafka",
"username": [],
"version": "string"
}
{
"item": {
"allow_edit": [
"string"
],
"ca_sha256": "string",
"ca_trusted_fingerprint": "string",
"config_yaml": "string",
"hosts": [
"https://example.com"
],
"id": "string",
"is_default": false,
"is_default_monitoring": false,
"is_internal": true,
"is_preconfigured": true,
"name": "string",
"preset": "balanced",
"proxy_id": "string",
"secrets": {
"ssl": {
"key": {
"id": "string"
}
}
},
"shipper": {
"compression_level": 42.0,
"disk_queue_compression_enabled": true,
"disk_queue_enabled": false,
"disk_queue_encryption_enabled": true,
"disk_queue_max_size": 42.0,
"disk_queue_path": "string",
"loadbalance": true,
"max_batch_bytes": 42.0,
"mem_queue_events": 42.0,
"queue_flush_timeout": 42.0
},
"ssl": {
"certificate": "string",
"certificate_authorities": [
"string"
],
"key": "string",
"verification_mode": "full"
},
"type": "elasticsearch"
}
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Upgrade a package policy
Upgrade a package policy to a newer package version.
[Required authorization] Route required privileges: fleet-agent-policies-all AND integrations-all.
Body
-
packagePolicyIds
array[string] Required
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/package_policies/upgrade' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"packagePolicyIds":["string"]}'
# Headers
kbn-xsrf: true
# Payload
{
"packagePolicyIds": [
"string"
]
}
[
{
"body": {
"message": "string"
},
"id": "string",
"name": "string",
"statusCode": 42.0,
"success": true
}
]
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Create a Fleet Server host
[Required authorization] Route required privileges: fleet-settings-all.
Body
-
host_urls
array[string] Required At least
1
element. -
id
string -
is_default
boolean Default value is
false
. -
is_internal
boolean -
is_preconfigured
boolean Default value is
false
. -
name
string Required -
proxy_id
string | null -
secrets
object Additional properties are NOT allowed.
-
ssl
object | null Additional properties are NOT allowed.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/fleet_server_hosts' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"host_urls":["string"],"id":"string","is_default":false,"is_internal":true,"is_preconfigured":false,"name":"string","proxy_id":"string","secrets":{"ssl":{"es_key":{"id":"string"},"key":{"id":"string"}}},"ssl":{"certificate":"string","certificate_authorities":["string"],"client_auth":"optional","es_certificate":"string","es_certificate_authorities":["string"],"es_key":"string","key":"string"}}'
# Headers
kbn-xsrf: true
# Payload
{
"host_urls": [
"string"
],
"id": "string",
"is_default": false,
"is_internal": true,
"is_preconfigured": false,
"name": "string",
"proxy_id": "string",
"secrets": {
"ssl": {
"es_key": {
"id": "string"
},
"key": {
"id": "string"
}
}
},
"ssl": {
"certificate": "string",
"certificate_authorities": [
"string"
],
"client_auth": "optional",
"es_certificate": "string",
"es_certificate_authorities": [
"string"
],
"es_key": "string",
"key": "string"
}
}
{
"item": {
"host_urls": [
"string"
],
"id": "string",
"is_default": false,
"is_internal": true,
"is_preconfigured": false,
"name": "string",
"proxy_id": "string",
"secrets": {
"ssl": {
"es_key": {
"id": "string"
},
"key": {
"id": "string"
}
}
},
"ssl": {
"certificate": "string",
"certificate_authorities": [
"string"
],
"client_auth": "optional",
"es_certificate": "string",
"es_certificate_authorities": [
"string"
],
"es_key": "string",
"key": "string"
}
}
}
{
"error": "string",
"errorType": "string",
"message": "string",
"statusCode": 42.0
}
Sync machine learning saved objects
Synchronizes Kibana saved objects for machine learning jobs and trained models. This API runs automatically when you start Kibana and periodically thereafter.
Query parameters
-
simulate
boolean When true, simulates the synchronization by returning only the list of actions that would be performed.
curl \
--request GET 'https://<KIBANA_URL>/api/ml/saved_objects/sync' \
--header "Authorization: $API_KEY"
{
"datafeedsAdded": {},
"datafeedsRemoved": {},
"savedObjectsCreated": {
"anomaly-detector": {
"myjob1": {
"success": true
},
"myjob2": {
"success": true
}
}
},
"savedObjectsDeleted": {}
}
{
"error": "Unauthorized",
"message": "string",
"statusCode": 401
}
Roles
Manage the roles that grant Elasticsearch and Kibana privileges.
Path parameters
-
name
string Required Minimum length is
1
.
curl \
--request DELETE 'https://<KIBANA_URL>/api/security/role/{name}' \
--header "Authorization: $API_KEY" \
--header "kbn-xsrf: true"
Update a Knowledge Base Entry
Update a Knowledge Base Entry
Path parameters
-
id
string(nonempty) Required The Knowledge Base Entry's
id
valueMinimum length is
1
.
Body
object
Required
-
global
boolean Whether this Knowledge Base Entry is global, defaults to false
-
name
string Required Name of the Knowledge Base Entry
-
namespace
string Kibana Space, defaults to 'default' space
-
users
array[object] Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users.
Could be any string, not necessarily a UUID
-
kbResource
string Required Knowledge Base resource name for grouping entries, e.g. 'security_labs', 'user', etc
Values are
security_labs
oruser
. -
source
string Required Source document name or filepath
-
text
string Required Knowledge Base Entry content
-
type
string Required Discriminator Entry type
Value is
document
. -
required
boolean Whether this resource should always be included, defaults to false
-
vector
object Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings
curl \
--request PUT 'https://<KIBANA_URL>/api/security_ai_assistant/knowledge_base/entries/{id}' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"global":true,"name":"string","namespace":"string","users":[{"id":"string","name":"string"}],"kbResource":"security_labs","source":"string","text":"string","type":"document","required":true,"vector":{"modelId":"string","tokens":{"additionalProperty1":42.0,"additionalProperty2":42.0}}}'
{
"global": true,
"name": "string",
"namespace": "string",
"users": [
{
"id": "string",
"name": "string"
}
],
"kbResource": "security_labs",
"source": "string",
"text": "string",
"type": "document",
"required": true,
"vector": {
"modelId": "string",
"tokens": {
"additionalProperty1": 42.0,
"additionalProperty2": 42.0
}
}
}
{
"global": true,
"name": "string",
"namespace": "string",
"users": [
{
"id": "string",
"name": "string"
}
],
"description": "string",
"field": "string",
"index": "string",
"queryDescription": "string",
"type": "index",
"inputSchema": [
{
"description": "string",
"fieldName": "string",
"fieldType": "string"
}
],
"outputFields": [
"string"
]
}
{
"global": true,
"name": "string",
"namespace": "string",
"users": [
{
"id": "string",
"name": "string"
}
],
"createdAt": "string",
"createdBy": "string",
"id": "string",
"updatedAt": "string",
"updatedBy": "string",
"kbResource": "security_labs",
"source": "string",
"text": "string",
"type": "document",
"required": true,
"vector": {
"modelId": "string",
"tokens": {
"additionalProperty1": 42.0,
"additionalProperty2": 42.0
}
}
}
{
"global": true,
"name": "string",
"namespace": "string",
"users": [
{
"id": "string",
"name": "string"
}
],
"createdAt": "string",
"createdBy": "string",
"id": "string",
"updatedAt": "string",
"updatedBy": "string",
"description": "string",
"field": "string",
"index": "string",
"queryDescription": "string",
"type": "index",
"inputSchema": [
{
"description": "string",
"fieldName": "string",
"fieldType": "string"
}
],
"outputFields": [
"string"
]
}
{
"error": "string",
"message": "string",
"statusCode": 42.0
}
Add and remove detection alert tags
And tags to detection alerts, and remove them from alerts.
You cannot add and remove the same alert tag in the same request.
curl \
--request POST 'https://<KIBANA_URL>/api/detection_engine/signals/tags' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"ids":["549c7129c76cbd554aba1bd638f8a49dde95088f5832e50218358e7eca1cf16e"],"tags":{"tags_to_add":["Duplicate"],"tags_to_remove":[]}}'
{
"ids": [
"549c7129c76cbd554aba1bd638f8a49dde95088f5832e50218358e7eca1cf16e"
],
"tags": {
"tags_to_add": [
"Duplicate"
],
"tags_to_remove": []
}
}
{
"ids": [
"549c7129c76cbd554aba1bd638f8a49dde95088f5832e50218358e7eca1cf16e"
],
"tags": {
"tags_to_add": [],
"tags_to_remove": [
"Duplicate"
]
}
}
{
"took": "68,",
"noops": "0,",
"total": "1,",
"batches": "1,",
"deleted": "0,",
"retries": {
"bulk": "0,",
"search": 0
},
"updated": "1,",
"failures": [],
"timed_out": "false,",
"throttled_millis": "0,",
"version_conflicts": "0,",
"requests_per_second": "-1,",
"throttled_until_millis": "0,"
}
{
"error": "string",
"message": "string",
"statusCode": 42
}
{
"message": "string",
"status_code": 42
}
{
"error": "string",
"message": "string",
"statusCode": 42
}
{
"message": "string",
"status_code": 42
}
Create an endpoint exception list
Create an endpoint exception list, which groups endpoint exception list items. If an endpoint exception list already exists, an empty response is returned.
curl \
--request POST 'https://<KIBANA_URL>/api/endpoint_list' \
--header "Authorization: $API_KEY"
{
"_version": "string",
"created_at": "2025-05-04T09:42:00Z",
"created_by": "string",
"description": "This list tracks allowlisted values.",
"id": "9e5fc75a-a3da-46c5-96e3-a2ec59c6bb85",
"immutable": true,
"list_id": "simple_list",
"meta": {},
"name": "My exception list",
"namespace_type": "agnostic",
"os_types": [
"linux"
],
"tags": [
"string"
],
"tie_breaker_id": "string",
"type": "detection",
"updated_at": "2025-05-04T09:42:00Z",
"updated_by": "string",
"version": 42
}
{}
{
"error": "string",
"message": "string",
"statusCode": 42
}
{
"message": "string",
"status_code": 42
}
{
"error": "string",
"message": "string",
"statusCode": 42
}
{
"error": "string",
"message": "string",
"statusCode": 42
}
{
"message": "string",
"status_code": 42
}
Body
Required
-
agent_type
string List of agent types to retrieve. Defaults to
endpoint
.Values are
endpoint
,sentinel_one
,crowdstrike
, ormicrosoft_defender_endpoint
. -
alert_ids
array[string(nonempty)] A list of alerts
id
s.At least
1
element. Minimum length of each is1
. -
case_ids
array[string] Case IDs to be updated (cannot contain empty strings)
At least
1
element. Minimum length of each is1
. -
comment
string Optional comment
-
endpoint_ids
array[string] Required List of endpoint IDs (cannot contain empty strings)
At least
1
element. Minimum length of each is1
. -
parameters
object Required Optional parameters object
curl \
--request POST 'https://<KIBANA_URL>/api/endpoint/action/get_file' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"comment":"Get my file","parameters":{"path":"/usr/my-file.txt"},"endpoint_ids":["ed518850-681a-4d60-bb98-e22640cae2a8"]}'
{
"comment": "Get my file",
"parameters": {
"path": "/usr/my-file.txt"
},
"endpoint_ids": [
"ed518850-681a-4d60-bb98-e22640cae2a8"
]
}
{
"data": {
"id": "27ba1b42-7cc6-4e53-86ce-675c876092b2",
"hosts": {
"ed518850-681a-4d60-bb98-e22640cae2a8": {
"name": "gke-endpoint-gke-clu-endpoint-node-po-e1a3ab89-4c4r"
}
},
"agents": [
"ed518850-681a-4d60-bb98-e22640cae2a8"
],
"status": "pending",
"command": "get-file",
"outputs": {},
"agentType": "endpoint",
"createdBy": "myuser",
"isExpired": false,
"startedAt": "2023-07-28T19:00:03.911Z",
"agentState": {
"ed518850-681a-4d60-bb98-e22640cae2a8": {
"isCompleted": false,
"wasSuccessful": false
}
},
"parameters": {
"path": "/usr/my-file.txt"
},
"isCompleted": false,
"wasSuccessful": false
}
}
Body
Required
-
agent_type
string List of agent types to retrieve. Defaults to
endpoint
.Values are
endpoint
,sentinel_one
,crowdstrike
, ormicrosoft_defender_endpoint
. -
alert_ids
array[string(nonempty)] A list of alerts
id
s.At least
1
element. Minimum length of each is1
. -
case_ids
array[string] Case IDs to be updated (cannot contain empty strings)
At least
1
element. Minimum length of each is1
. -
comment
string Optional comment
-
endpoint_ids
array[string] Required List of endpoint IDs (cannot contain empty strings)
At least
1
element. Minimum length of each is1
. -
parameters
object Required Optional parameters object
-
file
string(binary) Required The binary content of the file.
curl \
--request POST 'https://<KIBANA_URL>/api/endpoint/action/upload' \
--header "Authorization: $API_KEY" \
--header "Content-Type: multipart/form-data" \
--form "file=RWxhc3RpYw==" \
--form 'parameters={}' \
--form "endpoint_ids[]=ed518850-681a-4d60-bb98-e22640cae2a8"
{"file"=>"RWxhc3RpYw==", "parameters"=>{}, "endpoint_ids"=>["ed518850-681a-4d60-bb98-e22640cae2a8"]}
{
"data": {
"id": "9ff6aebc-2cb6-481e-8869-9b30036c9731",
"hosts": {
"ed518850-681a-4d60-bb98-e22640cae2a8": {
"name": "Host-5i6cuc8kdv"
}
},
"agents": [
"ed518850-681a-4d60-bb98-e22640cae2a8"
],
"status": "pending",
"command": "upload",
"outputs": {},
"agentType": "endpoint",
"createdBy": "elastic",
"isExpired": false,
"startedAt": "2023-07-03T15:07:22.837Z",
"agentState": {
"ed518850-681a-4d60-bb98-e22640cae2a8": {
"isCompleted": false,
"wasSuccessful": false
}
},
"parameters": {
"file_id": "10e4ce3d-4abb-4f93-a0cd-eaf63a489280",
"file_name": "fix-malware.sh",
"file_size": 69,
"file_sha256": "a0bed94220193ba4895c0aa5b4e7e293381d15765cb164ddf7be5cdd010ae42a"
},
"isCompleted": false,
"wasSuccessful": false
}
}
Update an exception list item
Update an exception list item using the id
or item_id
field.
Body
Required
Exception list item's properties
-
_version
string The version id, normally returned by the API when the item was retrieved. Use it ensure updates are done against the latest version.
-
comments
array[object] Default value is
[]
(empty). -
description
string Required Describes the exception list.
-
entries
array[object] Required Any of: Security_Exceptions_API_ExceptionListItemEntryMatchobject Security_Exceptions_API_ExceptionListItemEntryMatchAnyobject Security_Exceptions_API_ExceptionListItemEntryListobject Security_Exceptions_API_ExceptionListItemEntryExistsobject Security_Exceptions_API_ExceptionListItemEntryNestedobject Security_Exceptions_API_ExceptionListItemEntryMatchWildcardobject -
expire_time
string(date-time) The exception item’s expiration date, in ISO format. This field is only available for regular exception items, not endpoint exceptions.
-
id
string(nonempty) Exception's identifier.
Minimum length is
1
. -
item_id
string(nonempty) Human readable string identifier, e.g.
trusted-linux-processes
Minimum length is
1
. -
list_id
string(nonempty) Exception list's human readable string identifier, e.g.
trusted-linux-processes
.Minimum length is
1
. -
meta
object Additional properties are allowed.
-
name
string(nonempty) Required Exception list name.
Minimum length is
1
. -
namespace_type
string Determines whether the exception container is available in all Kibana spaces or just the space in which it is created, where:
single
: Only available in the Kibana space in which it is created.agnostic
: Available in all Kibana spaces.
Values are
agnostic
orsingle
. Default value issingle
. -
os_types
array[string] Use this field to specify the operating system.
Values are
linux
,macos
, orwindows
. Default value is[]
(empty). -
type
string Required Value is
simple
.
Responses
-
200 application/json
Successful response
-
400 application/json
Invalid input data response
-
401 application/json
Unsuccessful authentication response
-
403 application/json
Not enough privileges response
-
404 application/json
Exception list item not found response
-
500 application/json
Internal server error response
curl \
--request PUT 'https://<KIBANA_URL>/api/exception_lists/items' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"name":"Updated name","tags":[],"type":"simple","entries":[{"type":"match","field":"host.name","value":"rock01","operator":"included"}],"item_id":"simple_list_item","comments":[],"description":"Updated description","namespace_type":"single"}'
{
"name": "Updated name",
"tags": [],
"type": "simple",
"entries": [
{
"type": "match",
"field": "host.name",
"value": "rock01",
"operator": "included"
}
],
"item_id": "simple_list_item",
"comments": [],
"description": "Updated description",
"namespace_type": "single"
}
{
"id": "459c5e7e-f8b2-4f0b-b136-c1fc702f72da",
"name": "Updated name",
"tags": [],
"type": "simple",
"entries": [
{
"type": "match",
"field": "host.name",
"value": "rock01",
"operator": "included"
}
],
"item_id": "simple_list_item",
"list_id": "simple_list",
"_version": "WzEyLDFd",
"comments": [],
"os_types": [],
"created_at": "2025-01-07T21:12:25.512Z",
"created_by": "elastic",
"updated_at": "2025-01-07T21:34:50.233Z",
"updated_by": "elastic",
"description": "Updated description",
"namespace_type": "single",
"tie_breaker_id": "ad0754ff-7b19-49ca-b73e-e6aff6bfa2d0"
}
{
"error": "Bad Request",
"message": "[request body]: item_id: Expected string, received number",
"statusCode": 400
}
{
"error": "Unauthorized",
"message": "[security_exception\\n\\tRoot causes:\\n\\t\\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
"statusCode": 401
}
{
"error": "Forbidden",
"message": "API [PUT /api/exception_lists/items] is unauthorized for user, this action is granted by the Kibana privileges [lists-all]",
"statusCode": 403
}
{
"message": "exception list item item_id: \\\"foo\\\" does not exist",
"status_code": 404
}
{
"message": "Internal Server Error",
"status_code": 500
}
Create an exception list item
Create an exception item and associate it with the specified exception list.
Before creating exception items, you must create an exception list.
Body
Required
Exception list item's properties
-
comments
array[object] Default value is
[]
(empty). -
description
string Required Describes the exception list.
-
entries
array[object] Required Any of: Security_Exceptions_API_ExceptionListItemEntryMatchobject Security_Exceptions_API_ExceptionListItemEntryMatchAnyobject Security_Exceptions_API_ExceptionListItemEntryListobject Security_Exceptions_API_ExceptionListItemEntryExistsobject Security_Exceptions_API_ExceptionListItemEntryNestedobject Security_Exceptions_API_ExceptionListItemEntryMatchWildcardobject -
expire_time
string(date-time) The exception item’s expiration date, in ISO format. This field is only available for regular exception items, not endpoint exceptions.
-
item_id
string(nonempty) Human readable string identifier, e.g.
trusted-linux-processes
Minimum length is
1
. -
list_id
string(nonempty) Required Exception list's human readable string identifier, e.g.
trusted-linux-processes
.Minimum length is
1
. -
meta
object Additional properties are allowed.
-
name
string(nonempty) Required Exception list name.
Minimum length is
1
. -
namespace_type
string Determines whether the exception container is available in all Kibana spaces or just the space in which it is created, where:
single
: Only available in the Kibana space in which it is created.agnostic
: Available in all Kibana spaces.
Values are
agnostic
orsingle
. Default value issingle
. -
os_types
array[string] Use this field to specify the operating system.
Values are
linux
,macos
, orwindows
. Default value is[]
(empty). -
type
string Required Value is
simple
.
Responses
-
200 application/json
Successful response
-
400 application/json
Invalid input data response
-
401 application/json
Unsuccessful authentication response
-
403 application/json
Not enough privileges response
-
409 application/json
Exception list item already exists response
-
500 application/json
Internal server error response
curl \
--request POST 'https://<KIBANA_URL>/api/exception_lists/items' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"name":"Sample Exception List Item","tags":["malware"],"type":"simple","entries":[{"type":"exists","field":"actingProcess.file.signer","operator":"excluded"},{"type":"match_any","field":"host.name","value":["saturn","jupiter"],"operator":"included"}],"item_id":"simple_list_item","list_id":"simple_list","os_types":["linux"],"description":"This is a sample detection type exception item.","namespace_type":"single"}'
{
"name": "Sample Exception List Item",
"tags": [
"malware"
],
"type": "simple",
"entries": [
{
"type": "exists",
"field": "actingProcess.file.signer",
"operator": "excluded"
},
{
"type": "match_any",
"field": "host.name",
"value": [
"saturn",
"jupiter"
],
"operator": "included"
}
],
"item_id": "simple_list_item",
"list_id": "simple_list",
"os_types": [
"linux"
],
"description": "This is a sample detection type exception item.",
"namespace_type": "single"
}
{
"id": "323faa75-c657-4fa0-9084-8827612c207b",
"name": "Sample Autogenerated Exception List Item ID",
"tags": [
"malware"
],
"type": "simple",
"entries": [
{
"type": "exists",
"field": "actingProcess.file.signer",
"operator": "excluded"
}
],
"item_id": "80e6edf7-4b13-4414-858f-2fa74aa52b37",
"list_id": "8c1aae4c-1ef5-4bce-a2e3-16584b501783",
"_version": "WzYsMV0=",
"comments": [],
"os_types": [],
"created_at": "2025-01-09T01:16:23.322Z",
"created_by": "elastic",
"updated_at": "2025-01-09T01:16:23.322Z",
"updated_by": "elastic",
"description": "This is a sample exception that has no item_id so it is autogenerated.",
"namespace_type": "single",
"tie_breaker_id": "d6799986-3a23-4213-bc6d-ed9463a32f23"
}
{
"id": "71a9f4b2-c85c-49b4-866f-c71eb9e67da2",
"name": "Sample Exception List Item",
"tags": [
"malware"
],
"type": "simple",
"entries": [
{
"type": "exists",
"field": "actingProcess.file.signer",
"operator": "excluded"
}
],
"item_id": "simple_list_item",
"list_id": "simple_list",
"_version": "WzQsMV0=",
"comments": [],
"os_types": [
"linux"
],
"created_at": "2025-01-07T20:07:33.119Z",
"created_by": "elastic",
"updated_at": "2025-01-07T20:07:33.119Z",
"updated_by": "elastic",
"description": "This is a sample detection type exception item.",
"namespace_type": "single",
"tie_breaker_id": "09434836-9db9-4942-a234-5a9268e0b34c"
}
{
"id": "71a9f4b2-c85c-49b4-866f-c71eb9e67da2",
"name": "Sample Exception List Item",
"tags": [
"malware"
],
"type": "simple",
"entries": [
{
"type": "exists",
"field": "actingProcess.file.signer",
"operator": "excluded"
}
],
"item_id": "simple_list_item",
"list_id": "simple_list",
"_version": "WzQsMV0=",
"comments": [],
"os_types": [
"linux"
],
"created_at": "2025-01-07T20:07:33.119Z",
"created_by": "elastic",
"updated_at": "2025-01-07T20:07:33.119Z",
"updated_by": "elastic",
"description": "This is a sample detection type exception item.",
"namespace_type": "single",
"tie_breaker_id": "09434836-9db9-4942-a234-5a9268e0b34c"
}
{
"id": "71a9f4b2-c85c-49b4-866f-c71eb9e67da2",
"name": "Sample Exception List Item",
"tags": [
"malware"
],
"type": "simple",
"entries": [
{
"type": "match_any",
"field": "host.name",
"value": [
"saturn",
"jupiter"
],
"operator": "included"
}
],
"item_id": "simple_list_item",
"list_id": "simple_list",
"_version": "WzQsMV0=",
"comments": [],
"os_types": [
"linux"
],
"created_at": "2025-01-07T20:07:33.119Z",
"created_by": "elastic",
"updated_at": "2025-01-07T20:07:33.119Z",
"updated_by": "elastic",
"description": "This is a sample detection type exception item.",
"namespace_type": "single",
"tie_breaker_id": "09434836-9db9-4942-a234-5a9268e0b34c"
}
{
"id": "71a9f4b2-c85c-49b4-866f-c71eb9e67da2",
"name": "Sample Exception List Item",
"tags": [
"malware"
],
"type": "simple",
"entries": [
{
"type": "match",
"field": "actingProcess.file.signer",
"value": "Elastic N.V.",
"operator": "included"
}
],
"item_id": "simple_list_item",
"list_id": "simple_list",
"_version": "WzQsMV0=",
"comments": [],
"os_types": [
"linux"
],
"created_at": "2025-01-07T20:07:33.119Z",
"created_by": "elastic",
"updated_at": "2025-01-07T20:07:33.119Z",
"updated_by": "elastic",
"description": "This is a sample detection type exception item.",
"namespace_type": "single",
"tie_breaker_id": "09434836-9db9-4942-a234-5a9268e0b34c"
}
{
"id": "71a9f4b2-c85c-49b4-866f-c71eb9e67da2",
"name": "Sample Exception List Item",
"tags": [
"malware"
],
"type": "simple",
"entries": [
{
"type": "nested",
"field": "file.signature",
"entries": [
{
"type": "match",
"field": "signer",
"value": "Evil",
"operator": "included"
},
{
"type": "match",
"field": "trusted",
"value": true,
"operator": "included"
}
]
}
],
"item_id": "simple_list_item",
"list_id": "simple_list",
"_version": "WzQsMV0=",
"comments": [],
"os_types": [
"linux"
],
"created_at": "2025-01-07T20:07:33.119Z",
"created_by": "elastic",
"updated_at": "2025-01-07T20:07:33.119Z",
"updated_by": "elastic",
"description": "This is a sample detection type exception item.",
"namespace_type": "single",
"tie_breaker_id": "09434836-9db9-4942-a234-5a9268e0b34c"
}
{
"id": "deb26876-297d-4677-8a1f-35467d2f1c4f",
"name": "Filter out good guys ip and agent.name rock01",
"tags": [
"malware"
],
"type": "simple",
"entries": [
{
"list": {
"id": "goodguys.txt",
"type": "ip"
},
"type": "list",
"field": "source.ip",
"operator": "excluded"
}
],
"item_id": "686b129e-9b8d-4c59-8d8d-c93a9ea82c71",
"list_id": "8c1aae4c-1ef5-4bce-a2e3-16584b501783",
"_version": "WzcsMV0=",
"comments": [],
"os_types": [],
"created_at": "2025-01-09T01:31:12.614Z",
"created_by": "elastic",
"updated_at": "2025-01-09T01:31:12.614Z",
"updated_by": "elastic",
"description": "Don't signal when agent.name is rock01 and source.ip is in the goodguys.txt list",
"namespace_type": "single",
"tie_breaker_id": "5e0288ce-6657-4c18-9dcc-00ec9e8cc6c8"
}
{
"error": "Bad Request,",
"message": "[request body]: list_id: Expected string, received number",
"statusCode": "400,"
}
{
"error": "Unauthorized",
"message": "[security_exception\\n\\tRoot causes:\\n\\t\\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
"statusCode": 401
}
{
"error": "Forbidden",
"message": "API [POST /api/exception_lists/items] is unauthorized for user, this action is granted by the Kibana privileges [lists-all]",
"statusCode": 403
}
{
"message": "exception list item id: \\\"simple_list_item\\\" already exists",
"status_code": 409
}
{
"message": "Internal Server Error",
"status_code": 500
}
Body
Required
Value list's properties
-
_version
string The version id, normally returned by the API when the document is retrieved. Use it ensure updates are done against the latest version.
-
description
string(nonempty) Describes the value list.
Minimum length is
1
. -
id
string(nonempty) Required Value list's identifier.
Minimum length is
1
. -
meta
object Placeholder for metadata about the value list.
Additional properties are allowed.
-
name
string(nonempty) Value list's name.
Minimum length is
1
. -
version
integer The document version number.
Minimum value is
1
.
curl \
--request PATCH 'https://<KIBANA_URL>/api/lists' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"id":"ip_list","name":"Bad ips list - UPDATED"}'
{
"id": "ip_list",
"name": "Bad ips list - UPDATED"
}
{
"id": "ip_list",
"name": "Bad ips list - UPDATED",
"type": "ip",
"version": 2,
"_version": "WzEsMV0=",
"immutable": false,
"@timestamp": "2025-01-08T04:47:34.273Z",
"created_at": "2025-01-08T04:47:34.273Z",
"created_by": "elastic",
"updated_at": "2025-01-08T05:21:53.843Z",
"updated_by": "elastic",
"description": "This list describes bad internet ips",
"tie_breaker_id": "f5508188-b1e9-4e6e-9662-d039a7d89899"
}
{
"error": "Bad Request",
"message": "[request body]: name: Expected string, received number",
"statusCode": 400
}
{
"error": "Unauthorized",
"message": "[security_exception\\n\\tRoot causes:\\n\\t\\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
"statusCode": 401
}
{
"error": "Forbidden",
"message": "API [PATCH /api/lists] is unauthorized for user, this action is granted by the Kibana privileges [lists-all]",
"statusCode": 403
}
{
"message": "list id: \\\"foo\\\" not found",
"status_code": 404
}
{
"message": "Internal Server Error",
"status_code": 500
}
Get value lists
Get a paginated subset of value lists. By default, the first page is returned, with 20 results per page.
Query parameters
-
page
integer The page number to return.
-
per_page
integer The number of value lists to return per page.
-
sort_field
string(nonempty) Determines which field is used to sort the results.
Minimum length is
1
. -
sort_order
string Determines the sort order, which can be
desc
orasc
Values are
desc
orasc
. -
cursor
string(nonempty) Returns the lists that come after the last lists returned in the previous call (use the
cursor
value returned in the previous call). This parameter uses thetie_breaker_id
field to ensure all lists are sorted and returned correctly.Minimum length is
1
. -
filter
string Filters the returned results according to the value of the specified field, using the : syntax.
curl \
--request GET 'https://<KIBANA_URL>/api/lists/_find' \
--header "Authorization: $API_KEY"
{
"data": [
{
"id": "ip_list",
"name": "Simple list with an ip",
"type": "ip",
"version": 1,
"_version": "WzAsMV0=",
"immutable": false,
"@timestamp": "2025-01-08T04:47:34.273Z\n",
"created_at": "2025-01-08T04:47:34.273Z\n",
"created_by": "elastic",
"updated_at": "2025-01-08T04:47:34.273Z\n",
"updated_by": "elastic",
"description": "This list describes bad internet ip",
"tie_breaker_id": "f5508188-b1e9-4e6e-9662-d039a7d89899"
}
],
"page": 1,
"total": 1,
"cursor": "WzIwLFsiZjU1MDgxODgtYjFlOS00ZTZlLTk2NjItZDAzOWE3ZDg5ODk5Il1d",
"per_page": 20
}
{
"error": "Bad Request",
"message": "[request query]: page: Expected number, received nan",
"statusCode": 400
}
{
"error": "Unauthorized",
"message": "[security_exception\\n\\tRoot causes:\\n\\t\\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
"statusCode": 401
}
{
"error": "Forbidden",
"message": "API [GET /api/lists/_find?page=1&per_page=20] is unauthorized for user, this action is granted by the Kibana privileges [lists-read]",
"statusCode": 403
}
{
"message": "Internal Server Error",
"status_code": 500
}
Security Osquery
Run live queries, manage packs and saved queries.