Delete saved query APIedit

[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Delete saved queries.

Once you delete a saved query, it cannot be recovered.

Requestedit

DELETE <kibana host>:<port>/api/osquery/saved_queries/<id>

DELETE <kibana host>:<port>/s/<space_id>/api/osquery/saved_queries/<id>

Path parametersedit

space_id
(Optional, string) The space identifier. When space_id is not provided in the URL, the default space is used.
id
(Required, string) The ID of the saved query you want to delete.

Response codeedit

200
Indicates the saved query is deleted. Returns an empty response body.

Exampleedit

Delete a saved query object with the 42ba9c50-0cc5-11ed-aa1d-2b27890bc90d ID:

$ curl -X DELETE api/osquery/saved_queries/42ba9c50-0cc5-11ed-aa1d-2b27890bc90d