> For the complete documentation index, see [llms.txt](https://diffio.ai/llms.txt). This page is also available as HTML at https://diffio.ai/docs/api-reference/delete-project/.

# Delete a project

Deletes a project and everything stored for it: the original upload, every generation, separated tracks, rendered exports, transcript drafts, assistant turns, and any published share.

DELETE `https://api.diffio.ai/v2/projects/{project_id}`

- Key scope: `projects:write`
- Auth header: `Authorization: Bearer <apiKey>`
- Body: None

## Request

Pass `project_id` in the path; takes no request body.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | string | Yes | Unique identifier of the project. |

### Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Diffio-End-User` | string | No | Optional end-user identifier (up to 128 characters). Scopes the request to that end user's projects; omit to act across the whole account. |

## Example request

**Python**

```python
import os
from diffio import DiffioClient

key = os.environ["DIFFIO_API_KEY"]
client = DiffioClient(api_key=key)

deleted = client.projects.delete(
    "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
)
```

**Node.js**

```javascript
import { DiffioClient } from "diffio"

const client = new DiffioClient({
  apiKey: process.env.DIFFIO_API_KEY,
})

const deleted =
  await client.projects.delete(
    "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
  )
```

**cURL**

```bash
curl -X DELETE "https://api.diffio.ai/v2/projects/62f62565-049f-5e7e-bbd2-9de0cf7ddbfe" \
  -H "Authorization: Bearer $DIFFIO_API_KEY"
```

## Response

Returns deletion counts once the project and its stored media objects are removed.

Success: `200`

### Response fields

| Field | Type | Present | Description |
| --- | --- | --- | --- |
| `id` | string | Always | Identifier of the deleted project. |
| `object` | string | Always | Resource type, always `"project"`. |
| `deleted` | boolean | Always | Always `true` when deletion completes. |
| `deleted_generations` | integer | Always | Number of generations removed with the project. |
| `deleted_media_objects` | integer | Always | Number of stored media files deleted. |

## Example response (200)

**Successful response**

```json
{
  "id": "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
  "object": "project",
  "deleted": true,
  "deleted_generations": 1,
  "deleted_media_objects": 48
}
```

## Return codes

- `200` Project and all stored records and media files were deleted.
- `400` `Diffio-End-User` exceeds 128 characters. [`invalid_header`](https://diffio.ai/docs/api-reference/errors/#invalid_header)
- `403` Key is inactive or lacks `projects:write`. [`permission_denied`](https://diffio.ai/docs/api-reference/errors/#permission_denied)
- `404` No project with that `project_id` exists for this account and end user. [`project_not_found`](https://diffio.ai/docs/api-reference/errors/#project_not_found)
- `409` A generation on the project is still queued or processing, with `details.generation_ids` listing it. [`generation_in_progress`](https://diffio.ai/docs/api-reference/errors/#generation_in_progress)
- **`401` `405` Same on every endpoint**

  - `401` Missing API key (code missing_api_key), or invalid API key (code invalid_api_key).
  - `405` HTTP method not supported on this path; check the Allow header (code method_not_allowed).

### Example error response

Errors are JSON: an `error` object with `code`, `message` and `request_id`. An unrecognized key returns `401`:

**Error response**

```json
{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid API key.",
    "request_id": "dead773b60e148fd9e22d680a22fa701"
  }
}
```

## Notes

- Refused with `409` (`generation_in_progress`) while a generation is running, except a queued generation waiting for an upload that never arrived (deleted uncharged with the project).
- Any published share is revoked first (existing share URLs stop working within about 60 seconds), and signed media URLs stop resolving once objects are deleted.
- Usage already charged stays on your account's billing records, but the deleted generations no longer count in [Get usage](https://diffio.ai/docs/api-reference/usage-summary/). If a delete is interrupted midway, calling `DELETE` again finishes the cleanup.

## Related pages

- Previous: [Get a project](https://diffio.ai/docs/api-reference/get-project/): Retrieve one project's upload status, media metadata, and latest generation.
- Next: [Get new upload instructions](https://diffio.ai/docs/api-reference/reopen-project-upload/): Mint fresh 24-hour multipart upload instructions for a project awaiting its file.

- [Full API guide](https://diffio.ai/docs/developers/full-api-guide/): Every topic, limit and concept in one index.
- [Diffio API overview](https://diffio.ai/api-overview/): The cloud batch workflow and SDKs on one page.
