Update data view API

edit

[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Update part of an data view. Only the specified fields are updated in the data view. Unspecified fields stay as they are persisted.

Request

edit

POST <kibana host>:<port>/api/data_views/data_view/<id>

POST <kibana host>:<port>/s/<space_id>/api/data_views/data_view/<id>

Path parameters

edit
space_id
(Optional, string) An identifier for the space. If space_id is not provided in the URL, the default space is used.
id
(Required, string) The ID of the data view you want to update.

Request body

edit
refresh_fields
(Optional, boolean) Reloads the data view fields after the data view is updated. The default is false.
data_view

(Required, object) The data view fields you want to update.

You can partially update the following fields:

  • title
  • timeFieldName
  • fields
  • sourceFilters
  • fieldFormatMap
  • type
  • typeMeta

Response code

edit
200
Indicates a successful call.

Examples

edit

Update a title of the <my-view> data view:

$ curl -X POST api/data_views/data_view/my-view
{
  "data_view": {
    "title": "some-other-view-*"
  }
}

Customize the update behavior:

$ curl -X POST api/data_views/data_view/my-view
{
  "refresh_fields": true,
  "data_view": {
    "fields": {}
  }
}

All update fields are optional, but you can specify the following fields:

$ curl -X POST api/data_views/data_view/my-view
{
  "data_view": {
    "title": "...",
    "timeFieldName": "...",
    "sourceFilters": [],
    "fieldFormats": {},
    "type": "...",
    "typeMeta": {},
    "fields": {},
    "runtimeFieldMap": {}
  }
}

The API returns the updated data view object:

{
    "data_view": {

    }
}