cli/resources/uploads/methods/cancel/index.md +0 −157 deleted
File Deleted View Diff
1## Cancel upload
2
3`$ openai uploads cancel`
4
5**post** `/uploads/{upload_id}/cancel`
6
7Cancels the Upload. No Parts may be added after an Upload is cancelled.
8
9Returns the Upload object with status `cancelled`.
10
11### Parameters
12
13- `--upload-id: string`
14
15 The ID of the Upload.
16
17### Returns
18
19- `upload: object { id, bytes, created_at, 6 more }`
20
21 The Upload object can accept byte chunks in the form of Parts.
22
23 - `id: string`
24
25 The Upload unique identifier, which can be referenced in API endpoints.
26
27 - `bytes: number`
28
29 The intended number of bytes to be uploaded.
30
31 - `created_at: number`
32
33 The Unix timestamp (in seconds) for when the Upload was created.
34
35 - `expires_at: number`
36
37 The Unix timestamp (in seconds) for when the Upload will expire.
38
39 - `filename: string`
40
41 The name of the file to be uploaded.
42
43 - `object: "upload"`
44
45 The object type, which is always "upload".
46
47 - `purpose: string`
48
49 The intended purpose of the file. [Please refer here](https://platform.openai.com/docs/api-reference/files/object#files/object-purpose) for acceptable values.
50
51 - `status: "pending" or "completed" or "cancelled" or "expired"`
52
53 The status of the Upload.
54
55 - `"pending"`
56
57 - `"completed"`
58
59 - `"cancelled"`
60
61 - `"expired"`
62
63 - `file: optional object { id, bytes, created_at, 6 more }`
64
65 The `File` object represents a document that has been uploaded to OpenAI.
66
67 - `id: string`
68
69 The file identifier, which can be referenced in the API endpoints.
70
71 - `bytes: number`
72
73 The size of the file, in bytes.
74
75 - `created_at: number`
76
77 The Unix timestamp (in seconds) for when the file was created.
78
79 - `filename: string`
80
81 The name of the file.
82
83 - `object: "file"`
84
85 The object type, which is always `file`.
86
87 - `purpose: "assistants" or "assistants_output" or "batch" or 5 more`
88
89 The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
90
91 - `"assistants"`
92
93 - `"assistants_output"`
94
95 - `"batch"`
96
97 - `"batch_output"`
98
99 - `"fine-tune"`
100
101 - `"fine-tune-results"`
102
103 - `"vision"`
104
105 - `"user_data"`
106
107 - `status: "uploaded" or "processed" or "error"`
108
109 Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
110
111 - `"uploaded"`
112
113 - `"processed"`
114
115 - `"error"`
116
117 - `expires_at: optional number`
118
119 The Unix timestamp (in seconds) for when the file will expire.
120
121 - `status_details: optional string`
122
123 Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.
124
125### Example
126
127```cli
128openai uploads cancel \
129 --api-key 'My API Key' \
130 --upload-id upload_abc123
131```
132
133#### Response
134
135```json
136{
137 "id": "id",
138 "bytes": 0,
139 "created_at": 0,
140 "expires_at": 0,
141 "filename": "filename",
142 "object": "upload",
143 "purpose": "purpose",
144 "status": "pending",
145 "file": {
146 "id": "id",
147 "bytes": 0,
148 "created_at": 0,
149 "filename": "filename",
150 "object": "file",
151 "purpose": "assistants",
152 "status": "uploaded",
153 "expires_at": 0,
154 "status_details": "status_details"
155 }
156}
157```