POST
/
uploads
/
{upload_id}
/
cancel
Cancel upload
curl --request POST \
  --url https://api.openai.com/v1/uploads/{upload_id}/cancel \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "created_at": 123,
  "filename": "<string>",
  "bytes": 123,
  "purpose": "<string>",
  "status": "pending",
  "expires_at": 123,
  "object": "upload",
  "file": {
    "id": "<string>",
    "bytes": 123,
    "created_at": 123,
    "expires_at": 123,
    "filename": "<string>",
    "object": "file",
    "purpose": "assistants",
    "status": "uploaded",
    "status_details": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

upload_id
string
required

The ID of the Upload.

Example:

"upload_abc123"

Response

200 - application/json

OK

The Upload object can accept byte chunks in the form of Parts.

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
enum<string>
required

The status of the Upload.

Available options:
pending,
completed,
cancelled,
expired
expires_at
integer
required

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

object
enum<string>

The object type, which is always "upload".

Available options:
upload
file
object | null

The File object represents a document that has been uploaded to OpenAI. The ready File object after the Upload is completed.