Get a Vega library item Generally available

GET /api/vega/{id}

Spaces method and path for this operation:

get /s/{space_id}/api/vega/{id}

Refer to Spaces for more information.

Returns the complete state of a Vega library item, including its spec, query, and filters.

Path parameters

  • id string Required

    The Vega library item ID, as returned by the create or search endpoints, or the ID you chose when you created the item with the upsert endpoint.

Responses

  • 200 application/json

    ok

    Hide response attributes Show response attributes object
    • data object Required

      Additional properties are NOT allowed.

      Hide data attributes Show data attributes object
      • description string

        A short description of the Vega library item.

        Minimum length is 0, maximum length is 10000.

      • filters array[object]

        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 100 elements.

        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).

        One of:
      • query object

        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.

        Hide query attributes Show query attributes object
        • expression string Required

          A query expression in KQL or Lucene syntax.

          Minimum length is 0, maximum length is 1000000.

        • language string Required

          Query language. Use kql for Kibana Query Language (KQL) or lucene for Lucene query syntax.

          Values are kql or lucene.

      • spec object 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:
      • tags array[string]

        Tag IDs associated with this library item.

        Not more than 1000 elements. Maximum length of each is 250. Default value is [] (empty).

      • title string Required

        The Vega library item title.

        Minimum length is 1, maximum length is 1024.

    • id string Required

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

    • meta object Required

      Additional properties are NOT allowed.

      Hide meta attributes Show meta attributes object
      • 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.

  • 403

    forbidden

  • 404

    not found

GET /api/vega/{id}
curl -X GET "${KIBANA_URL}/api/vega/7c1d8e40-9b2f-11f0-a5c3-2f6e4b8d9a10" \
  -H "Authorization: ApiKey ${API_KEY}"
GET kbn:/api/vega/7c1d8e40-9b2f-11f0-a5c3-2f6e4b8d9a10
Response examples (200)
The full Vega library item state including the spec, query, filters, and metadata.
{
  "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 : \"osx\"",
      "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, macOS)"
  },
  "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"
  }
}