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

# Delete Video

> Permanently delete a video from your account.

Delete a video by ID. The video is removed from your library and can no longer be accessed. The response returns the metadata of the deleted video.

<Warning>
  This action is permanent and cannot be undone. The video file and all associated data are deleted.
</Warning>

## Endpoint

```
DELETE /v1/videos/:id
```

## Authentication

Pass an `all_access` API key as a Bearer token in the `Authorization` header.

<ParamField header="Authorization" type="string" required>
  Your API key. Format: `Bearer <api_key>`. Must have `all_access` permission.
</ParamField>

## Path parameters

<ParamField path="id" type="number" required>
  The ID of the video to delete.
</ParamField>

## Response

<ResponseField name="data" type="object" required>
  <Expandable title="properties" defaultOpen>
    <ResponseField name="id" type="number" required>
      ID of the deleted video.
    </ResponseField>

    <ResponseField name="domain_id" type="number" required>
      ID of the domain the video belonged to.
    </ResponseField>

    <ResponseField name="filename" type="string" required>
      Name of the deleted video.
    </ResponseField>

    <ResponseField name="created_at" type="string" required>
      ISO 8601 timestamp when the video was originally created.
    </ResponseField>

    <ResponseField name="updated_at" type="string" required>
      ISO 8601 timestamp of the video's last update before deletion.
    </ResponseField>
  </Expandable>
</ResponseField>

## Error responses

| Status | Description                                          |
| ------ | ---------------------------------------------------- |
| `400`  | The provided `id` is not a valid number.             |
| `403`  | The video exists but belongs to a different account. |
| `404`  | No video found with the given ID in your account.    |

## Examples

<CodeGroup>
  ```bash curl theme={null}
  curl --request DELETE \
    --url https://api.demomatic.tech/v1/videos/123 \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```javascript JavaScript theme={null}
  const videoId = 123;

  const response = await fetch(`https://api.demomatic.tech/v1/videos/${videoId}`, {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
    },
  });

  const { data } = await response.json();
  console.log(data); // metadata of the deleted video
  ```
</CodeGroup>

### Response

```json 200 theme={null}
{
  "data": {
    "id": 123,
    "domain_id": 45,
    "filename": "Product Tour Q1 2024",
    "created_at": "2024-01-15T10:00:00.000Z",
    "updated_at": "2024-01-15T10:05:00.000Z"
  }
}
```
