Update index pattern fields APIedit

[experimental] This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. Update fields presentation metadata, such as count, customLabel, and format. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value.

Requestedit

POST <kibana host>:<port>/api/index_patterns/index_pattern/<id>/fields

POST <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern/<id>/fields

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 index pattern fields you want to update.

Request bodyedit

fields
(Required, object) the field object

Response codeedit

200
Indicates a successful call.

Examplesedit

Set popularity count for field foo:

$ curl -X POST api/saved_objects/index-pattern/my-pattern/fields
{
    "fields": {
        "foo": {
            "count": 123
        }
    }
}

Update multiple metadata fields in one request:

$ curl -X POST api/saved_objects/index-pattern/my-pattern/fields
{
    "fields": {
        "foo": {
            "count": 123,
            "customLabel": "Foo"
        },
        "bar": {
            "customLabel": "Bar"
        }
    }
}

Use null value to delete metadata:

$ curl -X POST api/saved_objects/index-pattern/my-pattern/fields
{
    "fields": {
        "foo": {
            "customLabel": null
        }
    }
}

The endpoint returns the updated index pattern object:

{
    "index_pattern": {

    }
}