> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Delete saved query

> Deletes one saved query and returns `null`.

`axiom.deleteSavedQuery` deletes one saved query and returns `null`. It does not delete data or dashboard query copies.

```ts automations/axiom-delete-saved-query.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { axiom } from "automate.ax/axiom"

export default automation("Delete saved query", () => {
  onHttpRequest({ scope: "automation" })
  axiom.deleteSavedQuery({ savedQueryId: "saved-query-id" })
})
```

<Warning>
  This operation changes or deletes provider data. Confirm the target before
  deployment.
</Warning>

## Input

`savedQueryId` is required and selects the saved query to delete.

## Output

Returns `null` after Axiom confirms deletion.

## Permission and failures

The API token needs the dataset-level `starredQueries|delete` capability. Axiom returns an error when the saved query does not exist or the token cannot delete it. This mutation is not retried automatically after an ambiguous provider response.
