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.
Body
Required
-
Deletes referenced saved object if all references are removed.
-
Limit the affected saved objects by type.
-
The saved object reference to change.
-
Specify the type of the saved object reference to alter. The default value is
index-patternfor data views. -
New saved object reference value to replace the old value.
POST
/api/data_views/swap_references
curl
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"
}