Upsert a Vega library item

Base URL
https://{kibana_url}
Auth

Replaces the full state of a Vega library item. If no item exists with the specified ID, a new one is created.

Path parameters

space_id string optional

An identifier for the space. If space_id is not provided in the URL, the default space is used. Refer to Spaces for more information.

id string required

The unique ID of the Vega library item to create or update. A new ID must contain only lowercase letters, numbers, hyphens, and underscores.

Header parameters

kbn-xsrf string required

A required header to protect against CSRF attacks

Request body

description string · min length: 0 · max length: 10000

A short description of the Vega library item.

filters union oneOf[] · max items: 100

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.

One of:

A filter that evaluates a single field condition such as equality, range, or existence.

type enum required
Values: condition
condition union oneOf required

A filter condition with strict operator/value type matching.

One of: (determined by operator)
operator: is

Matches documents where field equals a single specified value.

operator enum required
Values: is
field string required

Name of the document field the condition evaluates.

negate boolean

When true, the filter is negated and matches documents that do NOT satisfy the condition. Defaults to false.

value union string | number | boolean required

Single value to compare against the field.

controlled_by string

Identifier of the panel that manages this filter. When set, the filter is treated as owned by that panel.

data_view_id string

Identifier of the data view used as context for this filter.

disabled boolean

When true, the filter is inactive and does not affect query results. Defaults to false.

is_multi_index boolean

When true, the filter can be applied across multiple indices. Defaults to false.

label string

Human-readable label for the filter, used for display purposes.

negate boolean

When true, the filter is negated and matches documents that do NOT satisfy the condition. Defaults to false.

spec union oneOf required

The Vega or Vega-Lite specification. Use { "format": "hjson", "value": "<hjson-string>" } for HJSON (comments and unquoted keys are preserved) or { "format": "json", "value": { ... } } for a JSON object.

One of: (determined by format)
format: hjson
format enum required
Values: hjson
value string · min length: 1 · max length: 1000000 required

The Vega or Vega-Lite specification in HJSON format. Comments and unquoted keys are preserved.

tags string[] · max items: 1000 · default: []

Tag IDs associated with this library item.

title string · min length: 1 · max length: 1024 required

The Vega library item title.

Responses

updated

application/json
data object required
description string · min length: 0 · max length: 10000

A short description of the Vega library item.

filters union oneOf[] · max items: 100

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.

Same options as filters
spec union oneOf required

The Vega or Vega-Lite specification. Use { "format": "hjson", "value": "<hjson-string>" } for HJSON (comments and unquoted keys are preserved) or { "format": "json", "value": { ... } } for a JSON object.

One of: (determined by format)
format: hjson
format enum required
Values: hjson
value string · min length: 1 · max length: 1000000 required

The Vega or Vega-Lite specification in HJSON format. Comments and unquoted keys are preserved.

tags string[] · max items: 1000 · default: []

Tag IDs associated with this library item.

title string · min length: 1 · max length: 1024 required

The Vega library item title.

id string required

The unique ID of the Vega library item, as returned by the create or search endpoints.

meta object required
created_at string

Timestamp when the object was created (ISO 8601).

created_by string

User profile ID of the user who created the object.

managed boolean

When true, the object is managed by Kibana and cannot be edited by users.

owner string

Identifier of the plugin or team that owns this object.

updated_at string

Timestamp when the object was last updated (ISO 8601).

updated_by string

User profile ID of the user who last updated the object.

version string

Internal version identifier for optimistic concurrency control.

400

bad request

403

forbidden

Base URL
https://{kibana_url}