# Cancel Upload

Give up on an upload by its upload URL or with your API key by its id, discarding the pieces it stored.

> Kind: REST endpoint · Updated: Sep 25, 2026 · DELETE {uploadUrl}  or  /v1/uploads/{id}

Gives up on an upload that has not finished. The pieces stored so far are discarded, and the upload stops counting toward your 50 open uploads and frees its file name. Folders that folderPath created stay. Cancelling is safe to repeat.

You do not have to cancel an upload you stop using: it expires on its own after an hour without a new piece.

### Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| uploadUrl | string | optional | For DELETE {uploadUrl}: the uploadUrl from Create Upload, used exactly as returned. |
| id | string | optional | For DELETE /v1/uploads/{id}: the upload's id, which starts with upl_. |

### Header parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | optional | Only for DELETE /v1/uploads/{id}: Bearer API_Key. Never send it to the upload URL. |

## Example request

**cURL**
```bash
# With the upload URL: no API key
curl --request DELETE "$UPLOAD_URL"

# With the upload's id and your API key
curl --request DELETE 'https://api.cloudfiles.io/v1/uploads/upl_66f3c1a2b4d5e6f708192a3b' \
  --header 'Authorization: Bearer API_Key'
```

## Response body

204 No Content, with no body, also when the upload was already cancelled or expired.

## Errors

| Status | errorCode | What it means |
|---|---|---|
| 404 | UPLOAD/NOT_FOUND | No upload with this URL or id in your account. |
| 409 | UPLOAD/ALREADY_COMPLETING | The upload is finishing or finished. To remove the file, use Delete File. |
| 403 | COMMON/FORBIDDEN | DELETE /v1/uploads/{id}: the API key is missing or unknown. |
