Delete saved object of type url via Kibana 7 API

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?

Not sure if it is possible, in the linked documentation you have this:

type
(Required, string) Valid options include visualization, dashboard, search, index-pattern, config.

url is not listed as a valid option for the type parameter.

But, as I said, the wording of the documentation is such that it does not say that the list is complete.

This:

(Required, string) Valid options are visualization, dashboard, search, index-pattern, config.

would imply the list is complete. Maybe that’s what the documentation is intended to mean, but it is not what the documentation says.

Yeah, but the fact that it is not working suggests that the list are complete with the allowed types, have you made a test to create and delete one of the listed types to see if it works:

Only someone from Elastic would be able to confirm that, but considering that this is on a unsupported version and on an deprecated API endpoint in newer versions, not sure anyone will be able to provide this information.

As far as I remeber this endpoint never want GA, it was a preview and then it was decided to deprecated it, so maybe the documentation has the wrong wording, but there is nothing to do here to change it.