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

POST /uploads/{upload_id}/cancel

Path parameters

  • upload_id string Required

    The ID of the Upload.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • id string Required

      The Upload unique identifier, which can be referenced in API endpoints.

    • created_at integer Required

      The Unix timestamp (in seconds) for when the Upload was created.

    • filename string Required

      The name of the file to be uploaded.

    • bytes integer Required

      The intended number of bytes to be uploaded.

    • purpose string Required

      The intended purpose of the file. Please refer here for acceptable values.

    • status string Required

      The status of the Upload.

      Values are pending, completed, cancelled, or expired.

    • expires_at integer Required

      The Unix timestamp (in seconds) for when the Upload will expire.

    • object string

      The object type, which is always "upload".

      Value is upload.

    • file object

      The File object represents a document that has been uploaded to OpenAI.

      Hide file attributes Show file attributes object
      • id string Required

        The file identifier, which can be referenced in the API endpoints.

      • bytes integer Required

        The size of the file, in bytes.

      • created_at integer Required

        The Unix timestamp (in seconds) for when the file was created.

      • expires_at integer

        The Unix timestamp (in seconds) for when the file will expire.

      • filename string Required

        The name of the file.

      • object string Required

        The object type, which is always file.

        Value is file.

      • purpose string Required

        The intended purpose of the file. Supported values are assistants, assistants_output, batch, batch_output, fine-tune, fine-tune-results and vision.

        Values are assistants, assistants_output, batch, batch_output, fine-tune, fine-tune-results, or vision.

      • status string Required Deprecated

        Deprecated. The current status of the file, which can be either uploaded, processed, or error.

        Values are uploaded, processed, or error.

      • status_details string Deprecated

        Deprecated. For details on why a fine-tuning training file failed validation, see the error field on fine_tuning.job.

POST /uploads/{upload_id}/cancel
curl \
 --request POST 'https://api.openai.com/v1/uploads/upload_abc123/cancel' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "id": "string",
  "created_at": 42,
  "filename": "string",
  "bytes": 42,
  "purpose": "string",
  "status": "pending",
  "expires_at": 42,
  "object": "upload",
  "file": {
    "id": "string",
    "bytes": 42,
    "created_at": 42,
    "expires_at": 42,
    "filename": "string",
    "object": "file",
    "purpose": "assistants",
    "status": "uploaded",
    "status_details": "string"
  }
}