---
title: "Delete a saved query"
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Analytics

`DELETE /api/analytics/saved-queries/{id}`

## Authentication

Requires one of the following:

- `bearerAuth`
- `apiKey`

## Path parameters

- `id` (`delete/api/analytics/saved-queries/id.path.id`; string, required) — Saved query ID
  - format `uuid`

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.channelautomation.com/api/analytics/saved-queries/<id>'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/analytics/saved-queries/<id>';
const options = {method: 'DELETE'};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/analytics/saved-queries/<id>"

response = requests.delete(url)

print(response.text)
```

## Responses

### 204

Query deleted successfully

### 400

Workspace ID required

#### Example

```json
{
  "error": "string",
  "details": "string"
}
```

- `error` (`delete/api/analytics/saved-queries/id.response.400.error`; string, optional)
- `details` (`delete/api/analytics/saved-queries/id.response.400.details`; string, optional)

### 403

Not authorized to delete this query

#### Example

```json
{
  "error": "string",
  "details": "string"
}
```

- `error` (`delete/api/analytics/saved-queries/id.response.403.error`; string, optional)
- `details` (`delete/api/analytics/saved-queries/id.response.403.details`; string, optional)

### 404

Query not found

#### Example

```json
{
  "error": "string",
  "details": "string"
}
```

- `error` (`delete/api/analytics/saved-queries/id.response.404.error`; string, optional)
- `details` (`delete/api/analytics/saved-queries/id.response.404.details`; string, optional)

### 500

Server error

#### Example

```json
{
  "error": "string",
  "details": "string"
}
```

- `error` (`delete/api/analytics/saved-queries/id.response.500.error`; string, optional)
- `details` (`delete/api/analytics/saved-queries/id.response.500.details`; string, optional)


Source: https://developer.channelautomations.com/api/delete-api-analytics-saved-queries-id/index.md
