---
title: "Cancel an upload | GPT-Video API reference"
description: "Cancels an open upload and deletes the parts sent so far. Call it with DELETE /v1/uploads/{uploadId}."
url: "https://www.gpt-video.com/developers/api/cancel-upload"
operation: "cancel_upload"
method: "DELETE"
path: "/v1/uploads/{uploadId}"
scope: "clips:write"
---

Do not assume endpoints have parameters other than the ones explicitly specified.

# Cancel an upload

Operation id `cancel_upload`. Request `DELETE /v1/uploads/{uploadId}`.

Cancels an open upload and deletes the parts sent so far.

Beta. This endpoint is supported and can gain new fields. If a change would break your code, we tell you before it takes effect and list it in the changelog.

## About

Use it when you will not finish an upload: its parts are deleted and it no longer counts among your uploads in progress, so a new one can start. An upload that is being completed cannot be cancelled. Cancelling an upload that was already completed, cancelled or removed answers not found.

## Example use

A script that finds out the wrong file is being sent cancels the open upload. This removes the parts already sent, so the script can open a new upload with the right file.

## Endpoint

```text
DELETE https://api.gpt-video.com/v1/uploads/{uploadId}
```

- Scope `clips:write`.
- Rate limit 60 requests a minute for each key and 120 for each account, shared by every `write` call. See [rate limits](/developers/rate-limits.md).
- No `Idempotency-Key`.

## Parameters

### Path

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `uploadId` | string | Required | The id of the upload, as create_upload (`POST /v1/uploads`) returned it. Matches `^upl_[0-9a-f]{20}$`. |

## Request

Cancel an upload.

```bash title="curl"
curl -X DELETE "https://api.gpt-video.com/v1/uploads/upl_5d2a8f1e6c3b4079e0a1" \
  -H "Authorization: Bearer $GPT_VIDEO_API_KEY"
```

```ts title="TypeScript"
const res = await fetch("https://api.gpt-video.com/v1/uploads/upl_5d2a8f1e6c3b4079e0a1", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GPT_VIDEO_API_KEY}`,
  },
});
const data = await res.json();
console.log(data);
```

```python title="Python"
import os

import requests

r = requests.delete(
    "https://api.gpt-video.com/v1/uploads/upl_5d2a8f1e6c3b4079e0a1",
    headers={
        "Authorization": f"Bearer {os.environ['GPT_VIDEO_API_KEY']}",
    },
)
data = r.json()
print(data)
```

```json title="MCP (Full)"
{
  "method": "tools/call",
  "params": {
    "name": "cancel_upload",
    "arguments": {
      "uploadId": "upl_5d2a8f1e6c3b4079e0a1"
    }
  }
}
```

## Response

A successful call answers HTTP 200.

### Response example

```json title="HTTP 200"
{
  "uploadId": "upl_5d2a8f1e6c3b4079e0a1",
  "cancelled": true
}
```

**All response fields**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `uploadId` | string | Required | The id of the upload that was cancelled. |
| `cancelled` | boolean | Required | Always true: a cancel that could not happen is an error. Always `true`. |

**More examples**

#### Cancel an upload that does not exist

`DELETE /v1/uploads/upl_3b6f9e2d7c0a4e51a8d9`

```json title="HTTP 404"
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Upload upl_3b6f9e2d7c0a4e51a8d9 not found",
    "hint": "Check the id. An id that belongs to another account is not found either.",
    "requestId": "req_2e8b4d0f6a3c9e1b5d7f0a4c"
  }
}
```

## Errors

| Code | Status | When | What to do |
| --- | --- | --- | --- |
| [`NOT_FOUND`](/developers/errors.md#NOT_FOUND) | 404 | Cancel an upload that does not exist | Change the request, then send it again. |
| [`CONFLICT`](/developers/errors.md#CONFLICT) | 409 | The upload is being completed at that moment. Wait for complete_upload (`POST /v1/uploads/{uploadId}/complete`) to answer, then cancel the upload if it is still open. | Read the resource again, then decide. Do not send the same request again. |

Every call can also answer these errors. [`VALIDATION_FAILED`](/developers/errors.md#VALIDATION_FAILED), [`UNKNOWN_PARAMETER`](/developers/errors.md#UNKNOWN_PARAMETER), [`UNAUTHORIZED`](/developers/errors.md#UNAUTHORIZED), [`SCOPE_MISSING`](/developers/errors.md#SCOPE_MISSING), [`RATE_LIMITED`](/developers/errors.md#RATE_LIMITED), [`INTERNAL`](/developers/errors.md#INTERNAL), [`UNAVAILABLE`](/developers/errors.md#UNAVAILABLE).

## Cost

No credits are used.

## Related operations

- [`create_upload`](/developers/api/create-upload.md) (`POST /v1/uploads`) Start an upload
- [`get_upload`](/developers/api/get-upload.md) (`GET /v1/uploads/{uploadId}`) Get an upload
- [`complete_upload`](/developers/api/complete-upload.md) (`POST /v1/uploads/{uploadId}/complete`) Complete an upload

## Questions

### Is a cancelled upload kept anywhere?

No. Its parts are deleted at once and it cannot be resumed; start a new upload to send the file again.

### Why was my cancel refused with a conflict?

The upload was being completed at that moment. Wait for complete_upload (`POST /v1/uploads/{uploadId}/complete`) to answer: the upload then either became an asset or is still open and can be cancelled.
