# Delete a Saved Analytics Chart

`DELETE https://api.suger.cloud/ai/org/{orgId}/analytics/chart/{chartId}`

Deletes a saved chart. A dashboard that shows it keeps the chart's block: the block's data then answers NOT_FOUND, and GetAnalyticsDashboard gives the block as it was, saying nothing of it, with no chart for it in `charts`; to a caller who could not read the chart, the block stays withheld, as it was. AddAnalyticsDashboardChart still adds to that dashboard, and UpdateAnalyticsDashboard refuses a document that keeps the block, so remove it there, and take its id out of each filter's `scope`, as UpdateAnalyticsDashboardLayout does; a filter whose `scope` then names none reaches no chart, so remove it, and take its id out of each controls block's `filters`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | string | yes | Organization ID |
| `chartId` | path | string | yes |  |

## Responses

### 204 — Deleted

### 401 — No valid token

Content-Type: `application/json` · Schema: `AiErrorResponse`

**`AiErrorResponse`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string | yes | Error message |

### 403 — Not a member of the organization, or a role that cannot write

Content-Type: `application/json` · Schema: `AiErrorResponse`

**`AiErrorResponse`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string | yes | Error message |

### 404 — NOT_FOUND

Content-Type: `application/json` · Schema: `AnalyticsError`

**`AnalyticsError`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | yes |  |

### 422 — INVALID_REQUEST: the body is not valid

Content-Type: `application/json` · Schema: `AnalyticsError`

**`AnalyticsError`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | yes |  |

### 500 — ANALYTICS_UNAVAILABLE: an unexpected failure

Content-Type: `application/json` · Schema: `AnalyticsError`

**`AnalyticsError`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | yes |  |

### 503 — ANALYTICS_UNAVAILABLE: analytics is not configured or not ready

Content-Type: `application/json` · Schema: `AnalyticsError`

**`AnalyticsError`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | yes |  |

## Example

_Generated from this operation's schema. Values are placeholders — substitute your own ids, and set `SUGER_TOKEN` to a bearer token from the [OAuth client-credentials exchange](https://doc.fours.com/settings/oauth-app/)._

### Request

```bash
curl -X DELETE 'https://api.suger.cloud/ai/org/{orgId}/analytics/chart/{chartId}' \
  -H "Authorization: Bearer $SUGER_TOKEN"
```

### Response — 204

No response body.

### Error — 401

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

---

API reference: https://doc.fours.com/api/
