Api key auth (http_api_key)
You must create an API key and use the encoded value in the request header. To learn about creating keys, go to API keys.
https://<KIBANA_URL>
The Kibana REST APIs for Elastic serverless enable you to manage resources such as connectors, data views, and saved objects. The API calls are stateless. Each request that you make happens in isolation from other calls and must include all of the necessary information for Kibana to fulfill the request. API requests return JSON output, which is a format that is machine-readable and works well for automation.
To interact with Kibana APIs, use the following operations:
You can prepend any Kibana API endpoint with kbn:
and run the request in
Dev Tools → Console. For example:
GET kbn:/api/data_views
This documentation is derived from the main
branch of the kibana repository.
It is provided under license Attribution-NonCommercial-NoDerivatives 4.0 International.
This is version 1.0.2
of this API documentation.
Last update on May 6, 2025.
You must create an API key and use the encoded value in the request header. To learn about creating keys, go to API keys.
The identifier for the rule.
curl \
--request DELETE 'https://<KIBANA_URL>/api/alerting/rule/{id}' \
--header "Authorization: $API_KEY" \
--header "kbn-xsrf: true"
The identifier for the rule.
curl \
--request POST 'https://<KIBANA_URL>/api/alerting/rule/{id}/_disable' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"untrack":true}'
The version of the API to use
Value is 2023-10-31
. Default value is 2023-10-31
.
A required header to protect against CSRF attacks
If the config exists ?overwrite=true is required
The agent name is used by the UI to determine which settings to display.
Service
Agent configuration settings
curl \
--request PUT 'https://<KIBANA_URL>/api/apm/settings/agent-configuration' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "elastic-api-version: 2023-10-31" \
--header "kbn-xsrf: true" \
--data '"{\n \"service\": {\n \"name\": \"frontend\",\n \"environment\": \"production\"\n },\n \"settings\": {\n \"transaction_sample_rate\": \"0.4\",\n \"capture_body\": \"off\",\n \"transaction_max_spans\": \"500\"\n },\n \"agent_name\": \"nodejs\"\n}\n"'
{
"service": {
"name": "frontend",
"environment": "production"
},
"settings": {
"transaction_sample_rate": "0.4",
"capture_body": "off",
"transaction_max_spans": "500"
},
"agent_name": "nodejs"
}
Retrieve agentName
for a service.
The version of the API to use
Value is 2023-10-31
. Default value is 2023-10-31
.
The name of the service
curl \
--request GET 'https://<KIBANA_URL>/api/apm/settings/agent-configuration/agent_name?serviceName=node' \
--header "Authorization: $API_KEY" \
--header "elastic-api-version: 2023-10-31"
Search for annotations related to a specific service.
The version of the API to use
Value is 2023-10-31
. Default value is 2023-10-31
.
The name of the service
The environment to filter annotations by
The start date for the search
The end date for the search
curl \
--request GET 'https://<KIBANA_URL>/api/apm/services/{serviceName}/annotation/search' \
--header "Authorization: $API_KEY" \
--header "elastic-api-version: 2023-10-31"
The version of the API to use
Value is 2023-10-31
. Default value is 2023-10-31
.
A required header to protect against CSRF attacks
curl \
--request POST 'https://<KIBANA_URL>/api/apm/fleet/apm_server_schema' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "elastic-api-version: 2023-10-31" \
--header "kbn-xsrf: true" \
--data '{"schema":{"foo":"bar"}}'
Delete a previously uploaded source map. You must have all
Kibana privileges for the APM and User Experience feature.
The version of the API to use
Value is 2023-10-31
. Default value is 2023-10-31
.
A required header to protect against CSRF attacks
Source map identifier
Successful response
Additional properties are NOT allowed.
Bad Request response
Unauthorized response
Forbidden response
Internal Server Error response
Not Implemented response
curl -X DELETE "http://localhost:5601/api/apm/sourcemaps/apm:foo-1.0.0-644fd5a9" \
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: true' \
-H 'Authorization: ApiKey ${YOUR_API_KEY}'
curl \
--request GET 'https://<KIBANA_URL>/api/actions/connectors' \
--header "Authorization: $API_KEY"
[
{
"id": "preconfigured-email-connector",
"name": "my-preconfigured-email-notification",
"is_deprecated": false,
"is_preconfigured": true,
"is_system_action": false,
"connector_type_id": ".email",
"referenced_by_count": 0
},
{
"id": "e07d0c80-8b8b-11ed-a780-3b746c987a81",
"name": "my-index-connector",
"config": {
"index": "test-index",
"refresh": false,
"executionTimeField": null
},
"is_deprecated": false,
"is_preconfigured": false,
"is_system_action": false,
"connector_type_id": ".index",
"is_missing_secrets": false,
"referenced_by_count": 2
}
]
[Required authorization] Route required privileges: integrations-read OR fleet-setup OR fleet-all.
Values are logs
, metrics
, traces
, synthetics
, or profiling
.
Values are asc
or desc
. Default value is asc
.
Default value is false
.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/epm/data_streams' \
--header "Authorization: $API_KEY"
Data view APIs enable you to manage data views, formerly known as Kibana index patterns.
An identifier for the data view.
The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted.
Reloads the data view fields after the data view is updated.
Default value is false
.
curl \
--request POST 'https://<KIBANA_URL>/api/data_views/data_view/ff959d40-b880-11e8-a6d9-e546fe2bba5f' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '{"data_view":{"name":"Kibana Sample Data eCommerce","title":"kibana_sample_data_ecommerce","allowNoIndex":false,"timeFieldName":"order_date"},"refresh_fields":true}'
{
"data_view": {
"name": "Kibana Sample Data eCommerce",
"title": "kibana_sample_data_ecommerce",
"allowNoIndex": false,
"timeFieldName": "order_date"
},
"refresh_fields": true
}
WARNING: When you delete a data view, it cannot be recovered.
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"
Update fields presentation metadata such as count, customLabel, customDescription, and format.
An identifier for the data view.
curl \
--request POST 'https://<KIBANA_URL>/api/data_views/data_view/ff959d40-b880-11e8-a6d9-e546fe2bba5f/fields' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '{"fields":{"field1":{"count":123,"customLabel":"Field 1 label"},"field2":{"customLabel":"Field 2 label","customDescription":"Field 2 description"}}}'
{
"fields": {
"field1": {
"count": 123,
"customLabel": "Field 1 label"
},
"field2": {
"customLabel": "Field 2 label",
"customDescription": "Field 2 description"
}
}
}
The ID of the data view fields you want to update.
The name for a runtime field.
The runtime field definition object.
curl \
--request PUT 'https://<KIBANA_URL>/api/data_views/data_view/{viewId}/runtime_field' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '{"name":"runtimeFoo","runtimeField":{"type":"long","script":{"source":"emit(doc[\"foo\"].value)"}}}'
{
"name": "runtimeFoo",
"runtimeField": {
"type": "long",
"script": {
"source": "emit(doc[\"foo\"].value)"
}
}
}
An identifier for the data view.
The name for a runtime field.
The runtime field definition object.
curl \
--request POST 'https://<KIBANA_URL>/api/data_views/data_view/ff959d40-b880-11e8-a6d9-e546fe2bba5f/runtime_field' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '{"name":"runtimeFoo","runtimeField":{"type":"long","script":{"source":"emit(doc[\"foo\"].value)"}}}'
{
"name": "runtimeFoo",
"runtimeField": {
"type": "long",
"script": {
"source": "emit(doc[\"foo\"].value)"
}
}
}
The runtime field definition object.
You can update following fields:
type
script
curl \
--request POST 'https://<KIBANA_URL>/api/data_views/data_view/ff959d40-b880-11e8-a6d9-e546fe2bba5f/runtime_field/hour_of_day' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"runtimeField":{"script":{"source":"emit(doc[\"bar\"].value)"}}}'
{
"runtimeField": {
"script": {
"source": "emit(doc[\"bar\"].value)"
}
}
}
curl \
--request DELETE 'https://<KIBANA_URL>/api/data_views/data_view/ff959d40-b880-11e8-a6d9-e546fe2bba5f/runtime_field/hour_of_day' \
--header "Authorization: $API_KEY"
curl \
--request GET 'https://<KIBANA_URL>/api/data_views/default' \
--header "Authorization: $API_KEY"
{
"data_view_id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f"
}
[Required authorization] Route required privileges: fleet-agents-all.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agents/{agentId}/unenroll' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"force":true,"revoke":true}'
[Required authorization] Route required privileges: fleet-agents-all.
Default value is false
.
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"}'
[Required authorization] Route required privileges: fleet-agents-all.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agents/bulk_unenroll' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"agents":["string"],"batchSize":42.0,"force":true,"includeInactive":true,"revoke":true}'
[Required authorization] Route required privileges: fleet-agents-all.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agents/bulk_update_agent_tags' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"agents":["string"],"batchSize":42.0,"includeInactive":false,"tagsToAdd":["string"],"tagsToRemove":["string"]}'
Update an agent binary download source by ID.
[Required authorization] Route required privileges: fleet-settings-all.
Default value is false
.
The ID of the proxy to use for this download source. See the proxies API for more information.
Additional properties are NOT allowed.
Additional properties are NOT allowed.
curl \
--request PUT 'https://<KIBANA_URL>/api/fleet/agent_download_sources/{sourceId}' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"host":"https://example.com","id":"string","is_default":false,"name":"string","proxy_id":"string","secrets":{"ssl":{"key":{"id":"string"}}},"ssl":{"certificate":"string","certificate_authorities":["string"],"key":"string"}}'
Delete an agent binary download source by ID.
[Required authorization] Route required privileges: fleet-settings-all.
curl \
--request DELETE 'https://<KIBANA_URL>/api/fleet/agent_download_sources/{sourceId}' \
--header "Authorization: $API_KEY" \
--header "kbn-xsrf: true"
Get a list of outputs associated with agent policies.
[Required authorization] Route required privileges: fleet-agent-policies-read AND fleet-settings-read.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agent_policies/outputs' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"ids":["string"]}'
[Required authorization] Route required privileges: fleet-agent-policies-read AND fleet-setup.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/kubernetes/download' \
--header "Authorization: $API_KEY"
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/agent_status' \
--header "Authorization: $API_KEY"
Delete an agent by ID.
[Required authorization] Route required privileges: fleet-agents-all.
curl \
--request DELETE 'https://<KIBANA_URL>/api/fleet/agents/{agentId}' \
--header "Authorization: $API_KEY" \
--header "kbn-xsrf: true"
[Required authorization] Route required privileges: fleet-agents-read.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/agents/{agentId}/uploads' \
--header "Authorization: $API_KEY"
[Required authorization] Route required privileges: fleet-agents-read.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/agents/available_versions' \
--header "Authorization: $API_KEY"
Get a file uploaded by an agent.
[Required authorization] Route required privileges: fleet-agents-read.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/agents/files/{fileId}/{fileName}' \
--header "Authorization: $API_KEY"
[Required authorization] Route required privileges: fleet-agents-read OR fleet-agent-policies-read OR fleet-settings-read OR fleet-setup.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agents/setup' \
--header "Authorization: $API_KEY" \
--header "kbn-xsrf: true"
[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.
Default value is false
.
Default value is false
.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/epm/packages' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/gzip; application/zip" \
--header "kbn-xsrf: true" \
--data-binary '@file'
[Required authorization] Route required privileges: integrations-read OR fleet-setup OR fleet-all.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath}' \
--header "Authorization: $API_KEY"
[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/epm/packages/{pkgName}/{pkgVersion}/kibana_assets' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"force":true,"space_ids":["string"]}'
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/epm/packages/{pkgName}/{pkgVersion}/transforms/authorize' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"transforms":[{"transformId":"string"}]}'
[Required authorization] Route required privileges: integrations-read OR fleet-setup OR fleet-all.
curl \
--request GET 'https://<KIBANA_URL>/api/fleet/epm/verification_key_id' \
--header "Authorization: $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"
Update an existing conversation using the conversation ID.
The conversation's id
value.
Minimum length is 1
.
LLM API configuration.
The conversation category.
Values are assistant
or insights
.
excludeFromLastConversationStorage.
A string that does not contain only whitespace characters
Minimum length is 1
.
The conversation messages.
AI assistant conversation message.
Replacements object used to anonymize/deanomymize messsages
The conversation title.
curl \
--request PUT 'https://<KIBANA_URL>/api/security_ai_assistant/current_user/conversations/{id}' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"apiConfig":{"actionTypeId":"string","connectorId":"string","defaultSystemPromptId":"string","model":"string","provider":"OpenAI"},"category":"assistant","excludeFromLastConversationStorage":true,"id":"string","messages":[{"content":"string","isError":true,"metadata":{"contentReferences":{}},"reader":{},"role":"system","timestamp":"string","traceData":{"traceId":"string","transactionId":"string"}}],"replacements":{"additionalProperty1":"string","additionalProperty2":"string"},"summary":{"confidence":"low","content":"string","public":true,"timestamp":"string"},"title":"string"}'