# Delete an upload

> Delete one of your uploads. Generations made from it are unaffected.

Canonical page: https://www.rundiffusion.com/docs/api/uploads/delete
Endpoint: DELETE /api/v2/uploads/{upload_id}
Authorization: OAuth device flow or Personal API Access Token or Company API Access Token

---

Deletes one upload. It stops appearing in
[List uploads](/docs/api/uploads/list) and answers `404` on
[Get an upload](/docs/api/uploads/get) immediately.

Only your own: uploads belong to the user who made them, and no team permission
widens that, exactly as in the app.

`DELETE /api/v2/uploads/{upload_id}`

Authorization: OAuth device flow or Personal API Access Token or Company API Access Token

## Request

**Headers**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Authorization` | string | Yes | Bearer token. This endpoint accepts an OAuth device flow token, a Personal API Access Token, or a Company API Access Token. See [Authentication](/docs/api/authentication). |

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `upload_id` | string | Yes | The upload id, as returned by the [list](/docs/api/uploads/list) or the [create](/docs/api/uploads/create) response. |

cURL:

```bash
curl -X DELETE https://api2.rundiffusion.com/api/v2/uploads/$UPLOAD_ID \
  -H "Authorization: Bearer $RUNDIFFUSION_TOKEN"
```

JavaScript:

```javascript
await fetch(
  `https://api2.rundiffusion.com/api/v2/uploads/${uploadId}`,
  {
    method: 'DELETE',
    headers: { Authorization: `Bearer ${process.env.RUNDIFFUSION_TOKEN}` },
  },
);
```

Python:

```python
requests.delete(
    f"{BASE}/uploads/{upload_id}",
    headers=HEADERS,
)
```

## Response

`204 No Content`.

Generations already made from the upload are untouched: a run holds the bytes
it was given, not a reference to the upload record. Deleting also takes the
file out of upload dedupe, so re-uploading the same bytes later creates a fresh
record with a new `id` rather than resurrecting the deleted one.

> **Deleting is not undoable through the API**
>
> There is no restore endpoint. If the file matters, download it from `url`
> before deleting.

## Errors

**Status codes**

| Name | Type | Description |
| --- | --- | --- |
| `401` | TOKEN_INVALID | Missing or invalid credential. |
| `404` | UPLOAD_NOT_FOUND | No such upload, not yours, or already deleted. All three read the same on purpose. |
| `429` | RATE_LIMITED | Too many requests. Deletes have a tighter budget than reads. See [Rate limits](/docs/api/rate-limits#uploads). |
