POST /api/data_views/default

Spaces method and path for this operation:

post /s/{space_id}/api/data_views/default

Refer to Spaces for more information.

Set the default data view for the current Kibana space. The default data view is used as a fallback when no specific data view is selected.

Headers

  • kbn-xsrf string Required

    Cross-site request forgery protection

application/json

Body Required

  • data_view_id string | null Required

    The data view identifier. NOTE: The API does not validate whether it is a valid identifier. Use null to unset the default data view.

  • force boolean

    Update an existing default data view identifier.

    Default value is false.

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/default
curl \
  -X POST "${KIBANA_URL}/api/data_views/default" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{"data_view_id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","force":true}'
POST kbn://api/data_views/default
{"data_view_id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","force":true}
Request example
Set the default data view, using the force flag to overwrite an existing default.
{
  "data_view_id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f",
  "force": true
}
Response examples (200)
The acknowledged flag confirms that the default data view for the current Kibana space was updated.
{
  "acknowledged": true
}
Response examples (400)
The request was rejected because the payload or query parameters are missing required fields or contain invalid values.
{
  "error": "Bad Request",
  "message": "[request body.data_view.title]: expected value of type [string] but got [undefined]",
  "statusCode": 400
}