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

# client.datasets.cancelUpload()

> Cancel a dataset upload.

Cancel an upload before finalization to allow another upload to the dataset. Returns 204, or 409 if the upload has already been finalized.

## Signature

Method signature on `client.datasets`:

```ts theme={null}
cancelUpload(args: {
  uploadId: string;
}): Promise<void>;
```

## Parameters

**uploadId** `string` *required*

Dataset upload ID with prefix `dfu.`.

## Returns

`Promise<void>`

Resolves without a return value.

## Errors

HTTP errors throw [`PotatoApiError`](https://docs.platform.toloka.ai/docs/sdk/errors). The endpoint documents these error responses:

| Status | Description |
| - | - |
| 404 | Upload not found |
| 409 | Upload has already been finalized |
| 429 | Rate limit exceeded |

HTTP endpoint: [`POST /uploads/{uploadId}/cancel`](https://docs.platform.toloka.ai/docs/api-reference/dataset-uploads/cancel-dataset-upload).

```ts cancelUpload() theme={null}
import { createClient } from "@toloka-platform/sdk";

const client = createClient({
  baseUrl: "https://platform.toloka.ai",
  apiKey: process.env.TOLOKA_API_KEY!,
});

await client.datasets.cancelUpload({
  uploadId: "dfu.019a0000-0000-7000-8000-000000000001"
});
```

This method resolves without a return value.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.