Spaces method and path for this operation:
Refer to Spaces for more information.
Replaces the full state of a Vega library item. If no item exists with the specified ID, a new one is created.
Path parameters
-
The unique ID of the Vega library item to create or update. A new ID must contain only lowercase letters, numbers, hyphens, and underscores.
Body
-
A short description of the Vega library item.
Minimum length is
0, maximum length is10000. -
Filters. Applied together with the dashboard filters to Elasticsearch and ES|QL data sources that use
%context%: true, and to Elasticsearch data sources that use%dashboard_context-*%placeholders.Not more than
100elements.A filter applied to query results. Can be a field condition (
condition), a logical group of conditions (group), a raw Elasticsearch DSL query (dsl), or a geo spatial query (spatial). -
KQL or Lucene query. Applied together with the dashboard query to Elasticsearch and ES|QL data sources that use
%context%: true, and to Elasticsearch data sources that use%dashboard_context-*%placeholders.Additional properties are NOT allowed.
-
The Vega library item title.
Minimum length is
1, maximum length is1024.
curl -X PUT "${KIBANA_URL}/api/vega/7c1d8e40-9b2f-11f0-a5c3-2f6e4b8d9a10" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"title": "Top extensions (US, Windows)",
"spec": {
"format": "json",
"value": {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": {
"%context%": true,
"%timefield%": "timestamp",
"index": "kibana_sample_data_logs",
"body": {
"size": 0,
"aggs": {
"extensions": {
"terms": {
"field": "extension.keyword"
}
}
}
}
},
"format": {
"property": "aggregations.extensions.buckets"
}
},
"mark": "bar",
"encoding": {
"x": {
"field": "key",
"type": "nominal"
},
"y": {
"field": "doc_count",
"type": "quantitative"
}
}
}
},
"query": {
"expression": "machine.os.keyword : win*",
"language": "kql"
},
"filters": [
{
"type": "condition",
"data_view_id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"condition": {
"field": "geo.dest",
"operator": "is",
"value": "US"
}
},
{
"type": "dsl",
"dsl": {
"range": {
"bytes": {
"gte": 1000
}
}
}
}
]
}'
PUT kbn:/api/vega/7c1d8e40-9b2f-11f0-a5c3-2f6e4b8d9a10
{
"title": "Top extensions (US, Windows)",
"spec": {
"format": "json",
"value": {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": {
"%context%": true,
"%timefield%": "timestamp",
"index": "kibana_sample_data_logs",
"body": {
"size": 0,
"aggs": {
"extensions": {
"terms": {
"field": "extension.keyword"
}
}
}
}
},
"format": {
"property": "aggregations.extensions.buckets"
}
},
"mark": "bar",
"encoding": {
"x": {
"field": "key",
"type": "nominal"
},
"y": {
"field": "doc_count",
"type": "quantitative"
}
}
}
},
"query": {
"expression": "machine.os.keyword : win*",
"language": "kql"
},
"filters": [
{
"type": "condition",
"data_view_id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"condition": {
"field": "geo.dest",
"operator": "is",
"value": "US"
}
},
{
"type": "dsl",
"dsl": {
"range": {
"bytes": {
"gte": 1000
}
}
}
}
]
}
{
"filters": [
{
"condition": {
"field": "geo.dest",
"operator": "is",
"value": "US"
},
"data_view_id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"type": "condition"
},
{
"dsl": {
"range": {
"bytes": {
"gte": 1000
}
}
},
"type": "dsl"
}
],
"query": {
"expression": "machine.os.keyword : win*",
"language": "kql"
},
"spec": {
"format": "json",
"value": {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"format": {
"property": "aggregations.extensions.buckets"
},
"url": {
"%context%": true,
"%timefield%": "timestamp",
"body": {
"aggs": {
"extensions": {
"terms": {
"field": "extension.keyword"
}
}
},
"size": 0
},
"index": "kibana_sample_data_logs"
}
},
"encoding": {
"x": {
"field": "key",
"type": "nominal"
},
"y": {
"field": "doc_count",
"type": "quantitative"
}
},
"mark": "bar"
}
},
"title": "Top extensions (US, Windows)"
}
{
"data": {
"filters": [
{
"condition": {
"field": "geo.dest",
"operator": "is",
"value": "US"
},
"data_view_id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"type": "condition"
},
{
"dsl": {
"range": {
"bytes": {
"gte": 1000
}
}
},
"type": "dsl"
}
],
"query": {
"expression": "machine.os.keyword : win*",
"language": "kql"
},
"spec": {
"format": "json",
"value": {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"format": {
"property": "aggregations.extensions.buckets"
},
"url": {
"%context%": true,
"%timefield%": "timestamp",
"body": {
"aggs": {
"extensions": {
"terms": {
"field": "extension.keyword"
}
}
},
"size": 0
},
"index": "kibana_sample_data_logs"
}
},
"encoding": {
"x": {
"field": "key",
"type": "nominal"
},
"y": {
"field": "doc_count",
"type": "quantitative"
}
},
"mark": "bar"
}
},
"title": "Top extensions (US, Windows)"
},
"id": "7c1d8e40-9b2f-11f0-a5c3-2f6e4b8d9a10",
"meta": {
"created_at": "2026-09-30T10:00:00.000Z",
"managed": false,
"updated_at": "2026-09-30T11:00:00.000Z",
"version": "WzYwLDFd"
}
}
{
"data": {
"filters": [
{
"condition": {
"field": "geo.dest",
"operator": "is",
"value": "US"
},
"data_view_id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"type": "condition"
},
{
"dsl": {
"range": {
"bytes": {
"gte": 1000
}
}
},
"type": "dsl"
}
],
"query": {
"expression": "machine.os.keyword : win*",
"language": "kql"
},
"spec": {
"format": "json",
"value": {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"format": {
"property": "aggregations.extensions.buckets"
},
"url": {
"%context%": true,
"%timefield%": "timestamp",
"body": {
"aggs": {
"extensions": {
"terms": {
"field": "extension.keyword"
}
}
},
"size": 0
},
"index": "kibana_sample_data_logs"
}
},
"encoding": {
"x": {
"field": "key",
"type": "nominal"
},
"y": {
"field": "doc_count",
"type": "quantitative"
}
},
"mark": "bar"
}
},
"title": "Top extensions (US, Windows)"
},
"id": "7c1d8e40-9b2f-11f0-a5c3-2f6e4b8d9a10",
"meta": {
"created_at": "2026-09-30T10:00:00.000Z",
"managed": false,
"updated_at": "2026-09-30T10:00:00.000Z",
"version": "WzU5LDFd"
}
}