Update saved objects in spaces
Update one or more saved objects to add or remove them from some spaces.
POST /api/spaces/_update_objects_spaces
curl \ --request POST 'https://localhost:5601/api/spaces/_update_objects_spaces' \ --header "Authorization: $API_KEY" \ --header "Content-Type: application/json" \ --header "kbn-xsrf: true" \ --data '{"objects":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","type":"index-pattern"}],"spacesToAdd":["test"],"spacesToRemove":[]}'
Request example
Update the spaces of each saved object and all its references.
{ "objects": [ { "id": "90943e30-9a47-11e8-b64d-95841ca0b247", "type": "index-pattern" } ], "spacesToAdd": [ "test" ], "spacesToRemove": [] }
Response examples (200)
The response from updating the spaces of saved objects.
{ "objects": [ { "id": "90943e30-9a47-11e8-b64d-95841ca0b247", "type": "index-pattern", "spaces": [ "default", "test" ] } ] }