# Cancel a repo's upload in progress

`POST /v1/datasets/uploads/{repo_id}/cancel`

Cancel, not delete. The platform cannot stop the uploading
process on someone's machine, so QDS ends the server's side of the upload:
the SDK's next transfer heartbeat is answered `cancelled` and it stops, a
fresh publication under that transfer is refused (from an SDK too old to
hear the answer too: it is stopped at its publication), and the
upload attempt
is ended as `user_cancelled` with no retry, so its server-side worker (a
Hugging Face import, or verification and preparation of any upload) stops
on its next heartbeat and nothing can publish it. A publication still
landing is stopped at its registry row; one that already landed is
refused with 409 ("already published"), as is a repo with nothing left to
cancel. Staged bytes
are reclaimed by the usual retention; the entry stays in the feed as a
cancelled upload until dismissed.

A sub-resource of the feed, like dismiss, and a POST: nothing is deleted.

- Base URL: `https://junction-api.qualiastudios.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `repo_id` (path, string (uuid), required)
- `account_id` (query, string | null (uuid)): Act on this account (active)

## Responses

- `200` Successful Response: `application/json` `any`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `422` Validation Error: `application/json` `HTTPValidationError`

## Schemas

```yaml
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
HTTPValidationError:
  properties:
    detail:
      items:
        $ref: "#/components/schemas/ValidationError"
      type: array
  type: object
  title: HTTPValidationError
ValidationError:
  properties:
    loc:
      items:
        type:
          - string
          - integer
      type: array
      title: Location
    msg:
      type: string
      title: Message
    type:
      type: string
      title: Error Type
    input: {}
    ctx:
      type: object
      title: Context
  type: object
  required:
    - loc
    - msg
    - type
  title: ValidationError
```
