POST /api/data_views/swap_references

Spaces method and path for this operation:

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

Refer to Spaces for more information.

Swap saved object references from one data view to another. Use this endpoint to update dashboards, visualizations, and other saved objects that reference a data view. WARNING: Misuse can break large numbers of saved objects! Use the _preview endpoint to see which saved objects would be affected before making changes.

Headers

  • kbn-xsrf string Required

    Cross-site request forgery protection

application/json

Body Required

  • delete boolean

    Deletes referenced saved object if all references are removed.

  • forId string | array[string]

    Limit the affected saved objects to one or more by identifier.

  • forType string

    Limit the affected saved objects by type.

  • fromId string Required

    The saved object reference to change.

  • fromType string

    Specify the type of the saved object reference to alter. The default value is index-pattern for data views.

  • toId string Required

    New saved object reference value to replace the old value.

Responses

  • 200 application/json

    Indicates a successful call.

    Hide response attributes Show response attributes object
    • deleteStatus object
      Hide deleteStatus attributes Show deleteStatus attributes object
      • deletePerformed boolean
      • remainingRefs integer
    • result array[object]
      Hide result attributes Show result attributes object
      • id string

        A saved object identifier.

      • type string

        The saved object type.

POST /api/data_views/swap_references
curl \
  -X POST "${KIBANA_URL}/api/data_views/swap_references" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{"fromId":"abcd-efg","toId":"xyz-123","delete":true}'
POST kbn://api/data_views/swap_references
{"fromId":"abcd-efg","toId":"xyz-123","delete":true}
Request example
Swap all saved object references from one data view to another and delete the source data view afterward.
{
  "delete": true,
  "fromId": "abcd-efg",
  "toId": "xyz-123"
}