# Delete Analytics Data Source

Delete one of the creator's data sources and its stored data. It cannot be restored. Every panel that reads it is changed to stop reading it, so a panel that needed it shows that it failed. List Analytics Data Sources marks the sources no panel reads with isUnused. When a published embed reads it, the first request is refused with the embeds it affects: send it again with confirmationReceipt to confirm.

`DELETE https://connect.mindcloud.co/v2/analytics/data-sources/:dataSourceId`

Permissions: `analytics:page:create`.

## Parameters

### Path

- `dataSourceId` (string, required): The data source id, from List Analytics Data Sources.

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Query

- `confirmationReceipt` (string): The receipt a 409 ANALYTICS_EMBED_CONFIRMATION_REQUIRED answered, to confirm the change to published embeds.
  Only after a 409 ANALYTICS_EMBED_CONFIRMATION_REQUIRED for the same request: the confirmationReceipt from its error.details, confirming the change to the published embeds it lists.

## Example request

```bash
curl --request DELETE \
  --url 'https://connect.mindcloud.co/v2/analytics/data-sources/Ds3Hq9Lp2WxM?confirmationReceipt=eyJmaW5nZXJwcmludCI6IjhkNGMifQ' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN'
```

## Response fields

- `id` (string): The id of the resource that was deleted.
