- Kibana Guide: other versions:
- What is Kibana?
- What’s new in 8.3
- Kibana concepts
- Quick start
- Set up
- Install Kibana
- Configure Kibana
- Alerting and action settings
- APM settings
- Banners settings
- Enterprise Search settings
- Fleet settings
- i18n settings
- Logging settings
- Logs settings
- Metrics settings
- Monitoring settings
- Reporting settings
- Search sessions settings
- Secure settings
- Security settings
- Spaces settings
- Task Manager settings
- Telemetry settings
- URL drilldown settings
- Start and stop Kibana
- Access Kibana
- Securing access to Kibana
- Add data
- Upgrade Kibana
- Configure security
- Configure reporting
- Configure logging
- Configure monitoring
- Command line tools
- Production considerations
- Discover
- Dashboard and visualizations
- Canvas
- Maps
- Build a map to compare metrics by country or region
- Track, visualize, and alert on assets in real time
- Map custom regions with reverse geocoding
- Heat map layer
- Tile layer
- Vector layer
- Plot big data
- Search geographic data
- Configure map settings
- Connect to Elastic Maps Service
- Import geospatial data
- Troubleshoot
- Reporting and sharing
- Machine learning
- Graph
- Alerting
- Observability
- APM
- Security
- Dev Tools
- Fleet
- Osquery
- Stack Monitoring
- Stack Management
- REST API
- Get features API
- Kibana spaces APIs
- Kibana role management APIs
- User session management APIs
- Saved objects APIs
- Data views API
- Index patterns APIs
- Alerting APIs
- Action and connector APIs
- Cases APIs
- Import and export dashboard APIs
- Logstash configuration management APIs
- Machine learning APIs
- Short URLs APIs
- Get Task Manager health
- Upgrade assistant APIs
- Kibana plugins
- Troubleshooting
- Accessibility
- Release notes
- Developer guide
Update saved objects spaces API
editUpdate saved objects spaces API
edit[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Update saved objects spaces.
Updates one or more saved objects to add and/or remove them from specified spaces.
Request
editPOST <kibana host>:<port>/api/spaces/_update_objects_spaces
Request body
edit-
objects
-
(Required, object array) The saved objects to update.
Properties of
objects
-
type
- (Required, string) The saved object type.
-
id
- (Required, string) The saved object ID.
-
-
spacesToAdd
- (Required, string array) The IDs of the spaces the specified objects should be added to.
-
spacesToRemove
- (Required, string array) The IDs of the spaces the specified objects should be removed from.
Response body
edit-
objects
-
(object array) The saved objects that have been updated.
Properties of
objects
-
type
- (string) The saved object type.
-
id
- (string) The saved object ID.
-
spaces
- (string array) The space(s) that the referenced saved object exists in.
-
errors
- (string) Included if there was an error updating this object’s spaces.
-
Examples
editSharing saved objects
editTo share a saved object to a space programmatically follow these steps:
-
Collect reference graph and spaces context for each saved object that you want to share using Get shareable references API:
$ curl -X POST /api/spaces/_get_shareable_references { "objects": [ { "type": "index-pattern", "id": "90943e30-9a47-11e8-b64d-95841ca0b247" } ] }
The API returns the following:
{ "objects": [ { "type": "index-pattern", "id": "90943e30-9a47-11e8-b64d-95841ca0b247", "spaces": ["default"], "inboundReferences": [], "spacesWithMatchingOrigins": ["default"] } ] }
-
Check each saved object for
spacesWithMatchingOrigins
conflicts.Objects should not be shared to spaces with matching origins or you will create URL conflicts (causing the same URL to point to different saved objects).
-
Check each saved object for
spacesWithMatchingAliases
conflicts.If these match the space(s) that these saved objects will be shared to you should disable legacy URL aliases for them using Disable legacy URL aliases API.
When sharing to all spaces (
*
) all entries inspacesWithMatchingAliases
should be checked. -
Update spaces of each saved object and all its references:
$ curl -X POST /api/spaces/_update_objects_spaces { "objects": [ { "type": "index-pattern", "id": "90943e30-9a47-11e8-b64d-95841ca0b247" } ], "spacesToAdd": ["test"], "spacesToRemove": [] }
The API returns the following:
{ "objects": [ { "type": "index-pattern", "id": "90943e30-9a47-11e8-b64d-95841ca0b247", "spaces": ["default", "test"] } ] }