POST
/uploads/{upload_id}/cancelCancel an upload
Cancels a pending upload so that no more parts can be added. Use this operation when you no longer intend to complete the upload; the returned upload object has status cancelled.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
upload_idstringrequired
The ID of the upload to cancel.
200Returns the upload object with status `cancelled`.
idstringrequired
The Upload unique identifier, which can be referenced in API endpoints.
created_atintegerrequired
The Unix timestamp (in seconds) for when the Upload was created.
filenamestringrequired
The name of the file to be uploaded.
bytesintegerrequired
The intended number of bytes to be uploaded.
purposestringrequired
The intended purpose of the file. [Please refer here](https://developers.openai.com/api/reference/resources/files#%28resource%29%20files%20%3E%20%28model%29%20file_object%20%3E%20%28schema%29%20%3E%20%28property%29%20purpose) for acceptable values.
statusstringrequired
The status of the Upload.
expires_atintegerrequired
The Unix timestamp (in seconds) for when the Upload will expire.
objectstringoptional
The object type, which is always "upload".
fileobjectoptional
The ready File object after the Upload is completed.
400Returned when the upload is no longer pending or is already being completed and cannot be cancelled.
errorobjectrequired
404Returned when the upload is not found.
errorobjectrequired
410Returned when the upload has expired.
errorobjectrequired
429Returned when upload requests are sent too frequently.
errorobjectrequired
Error handling
A 400 is returned when the upload is no longer pending or is already being completed. A 404 is returned when the upload is not found. A 410 is returned when the upload has expired, and a 429 is returned when upload requests are sent too frequently. The upload_id path parameter must identify the upload to cancel.