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 '"{\n \"objects\": [\n {\n \"type\": \"index-pattern\",\n \"id\": \"90943e30-9a47-11e8-b64d-95841ca0b247\"\n }\n ],\n \"spacesToAdd\": [\n \"test\"\n ],\n \"spacesToRemove\": []\n}"'
Request example
Update the spaces of each saved object and all its references.
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247"
}
],
"spacesToAdd": [
"test"
],
"spacesToRemove": []
}
Response examples (200)
The response from updating the spaces of saved objects.
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"spaces": [
"default",
"test"
]
}
]
}