POST /api/data_views/data_view/{viewId}/fields

Spaces method and path for this operation:

post /s/{space_id}/api/data_views/data_view/{viewId}/fields

Refer to Spaces for more information.

Update field metadata for a data view. Use this endpoint to set custom labels, custom descriptions, and format overrides for individual fields.

Headers

  • kbn-xsrf string Required

    Cross-site request forgery protection

Path parameters

  • viewId string Required

    An identifier for the data view.

application/json

Body Required

  • fields object Required

    The field object.

Responses

  • 200 application/json

    Indicates a successful call.

    Hide response attribute Show response attribute object
    • acknowledged boolean
  • 400 application/json

    Bad request

    Hide response attributes Show response attributes object
    • error string Required
    • message string Required
    • statusCode number Required
POST /api/data_views/data_view/{viewId}/fields
curl \
  -X POST "${KIBANA_URL}/api/data_views/data_view/${DATA_VIEW_ID}/fields" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{"fields":{"field_name":{"customLabel":"My custom label"}}}'
POST kbn://api/data_views/data_view/{viewId}/fields
{"fields":{"field_name":{"customLabel":"My custom label"}}}
Request example
Update the popularity count, custom label, and custom description for specific fields in a data view.
{
  "fields": {
    "field1": {
      "count": 123,
      "customLabel": "Field 1 label"
    },
    "field2": {
      "customDescription": "Field 2 description",
      "customLabel": "Field 2 label"
    }
  }
}