Update data view APIedit

[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort 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.

For the most up-to-date API details, refer to the open API specification.

Requestedit

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

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

Path parametersedit

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 bodyedit

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
  • name
  • timeFieldName
  • fields
  • sourceFilters
  • fieldFormatMap
  • type
  • typeMeta

Response codeedit

200
Indicates a successful call.

Examplesedit

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": "...",
    "name": "...",
    "timeFieldName": "...",
    "sourceFilters": [],
    "fieldFormats": {},
    "type": "...",
    "typeMeta": {},
    "fields": {},
    "runtimeFieldMap": {}
  }
}

The API returns the updated data view object:

{
    "data_view": {

    }
}