Update saved objects in spaces
Update one or more saved objects to add or remove them from some spaces.
Headers
-
elastic-api-version string
The version of the API to use
Value is
2023-10-31
. Default value is2023-10-31
. -
A required header to protect against CSRF attacks
Body
-
The identifiers of the spaces the saved objects should be added to or removed from.
-
The identifiers of the spaces the saved objects should be added to or removed from.
POST
/api/spaces/_update_objects_spaces
curl \
-X POST https://localhost:5601/api/spaces/_update_objects_spaces \
-H "Content-Type: application/json; Elastic-Api-Version=2023-10-31" \
-H "elastic-api-version: 2023-10-31" \
-H "kbn-xsrf: true"
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"
]
}
]
}