Ahead of upgrading Kibana from 7 (yes I know) to 8, I'm looking at ~1500 short URLs which it has been decided are no longer needed. (N.B. Some short URLs are still wanted.) Deleting them using the Kibana GUI would be exceeding tedious, especially when it's apparently impossible to search for the objects Search url Saved Objects by Title - #4 by Tortoise . Having worked out how to extract the relevant from exported JSON, I've been looking at the Kibana API as described at
There is no mention of saved object of type url there. But the wording of
(Required, string) Valid options include visualization, dashboard, search, index-pattern, config.
is such as to imply that the types given are just same of the ones which are valid (“includes”, not “are”, though why not state all valid values for clarity) and exported JSON of the URLs says type is url. E.g.
"id": "f3546b40-480f-11ef-9f7b-67a2b5099a35",
"references": [],
"sort": [
1721641881588,
0
],
"type": "url",
So based on that I think the way to delete one should be
[kibana:production:~]$ curl -u foo -H "kbn-xsrf: true" -X DELETE "https://$(hostname):5601/api/saved_objects/url/f3546b40-480f-11ef-9f7b-67a2b5099a35";echo
Enter host password for user 'foo':
{"statusCode":404,"error":"Not Found","message":"Saved object [url/f3546b40-480f-11ef-9f7b-67a2b5099a35] not found"}
[kibana:production:~]$
except as you can see that doesn't work.
So how does one delete a saved object of type url via the Kibana API?