---
title: "Cancels the Upload. No Parts may be added after an Upload is cancelled."
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/operations/cancelUpload"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

# Cancels the Upload. No Parts may be added after an Upload is cancelled.

`POST` `/uploads/{upload_id}/cancel`

Operation ID: `cancelUpload`

## Path parameters

- `upload_id` (string, required) - The ID of the Upload.

## Responses

- `200` - OK

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
paths:
  /uploads/{upload_id}/cancel:
    post:
      operationId: cancelUpload
      tags:
        - Uploads
      summary: |
        Cancels the Upload. No Parts may be added after an Upload is cancelled.
      parameters:
        - in: path
          name: upload_id
          required: true
          schema:
            type: string
            example: upload_abc123
          description: |
            The ID of the Upload.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Upload"
      x-oaiMeta:
        name: Cancel upload
        group: uploads
        returns: The [Upload](/docs/api-reference/uploads/object) object with status
          `cancelled`.
        examples:
          request:
            curl: |
              curl https://api.openai.com/v1/uploads/upload_abc123/cancel
          response: |
            {
              "id": "upload_abc123",
              "object": "upload",
              "bytes": 2147483648,
              "created_at": 1719184911,
              "filename": "training_examples.jsonl",
              "purpose": "fine-tune",
              "status": "cancelled",
              "expires_at": 1719127296
            }
security:
  - ApiKeyAuth: []
components:
  schemas:
    Upload:
      type: object
      title: Upload
      description: |
        The Upload object can accept byte chunks in the form of Parts.
      properties:
        id:
          type: string
          description: The Upload unique identifier, which can be referenced in API
            endpoints.
        created_at:
          type: integer
          description: The Unix timestamp (in seconds) for when the Upload was created.
        filename:
          type: string
          description: The name of the file to be uploaded.
        bytes:
          type: integer
          description: The intended number of bytes to be uploaded.
        purpose:
          type: string
          description: The intended purpose of the file. [Please refer
            here](/docs/api-reference/files/object#files/object-purpose) for
            acceptable values.
        status:
          type: string
          description: The status of the Upload.
          enum:
            - pending
            - completed
            - cancelled
            - expired
        expires_at:
          type: integer
          description: The Unix timestamp (in seconds) for when the Upload was created.
        object:
          type: string
          description: The object type, which is always "upload".
          enum:
            - upload
          x-stainless-const: true
        file:
          allOf:
            - $ref: "#/components/schemas/OpenAIFile"
            - nullable: true
              description: The ready File object after the Upload is completed.
      required:
        - bytes
        - created_at
        - expires_at
        - filename
        - id
        - purpose
        - status
      x-oaiMeta:
        name: The upload object
        example: |
          {
            "id": "upload_abc123",
            "object": "upload",
            "bytes": 2147483648,
            "created_at": 1719184911,
            "filename": "training_examples.jsonl",
            "purpose": "fine-tune",
            "status": "completed",
            "expires_at": 1719127296,
            "file": {
              "id": "file-xyz321",
              "object": "file",
              "bytes": 2147483648,
              "created_at": 1719186911,
              "filename": "training_examples.jsonl",
              "purpose": "fine-tune",
            }
          }
    OpenAIFile:
      title: OpenAIFile
      description: The `File` object represents a document that has been uploaded to OpenAI.
      properties:
        id:
          type: string
          description: The file identifier, which can be referenced in the API endpoints.
        bytes:
          type: integer
          description: The size of the file, in bytes.
        created_at:
          type: integer
          description: The Unix timestamp (in seconds) for when the file was created.
        filename:
          type: string
          description: The name of the file.
        object:
          type: string
          description: The object type, which is always `file`.
          enum:
            - file
          x-stainless-const: true
        purpose:
          type: string
          description: The intended purpose of the file. Supported values are
            `assistants`, `assistants_output`, `batch`, `batch_output`,
            `fine-tune`, `fine-tune-results` and `vision`.
          enum:
            - assistants
            - assistants_output
            - batch
            - batch_output
            - fine-tune
            - fine-tune-results
            - vision
        status:
          type: string
          deprecated: true
          description: Deprecated. The current status of the file, which can be either
            `uploaded`, `processed`, or `error`.
          enum:
            - uploaded
            - processed
            - error
        status_details:
          type: string
          deprecated: true
          description: Deprecated. For details on why a fine-tuning training file failed
            validation, see the `error` field on `fine_tuning.job`.
      required:
        - id
        - object
        - bytes
        - created_at
        - filename
        - purpose
        - status
      x-oaiMeta:
        name: The file object
        example: |
          {
            "id": "file-abc123",
            "object": "file",
            "bytes": 120000,
            "created_at": 1677610602,
            "filename": "salesOverview.pdf",
            "purpose": "assistants",
          }
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
```
