Create an upload
create_uploadCreate an upload
Stages one file for 24 hours, so it can be used anywhere a media link is taken. Two ways:
Send the bytes yourself. Give
file_nameand the exactsize_bytes. The upload comes backpending, withupload: the URL, method (PUT) and headers to send the file with, valid for 15 minutes. Send the whole file as the request body with those headers (putUploadContent), for examplecurl -X PUT -H "X-Upload-Token: …" -H "Content-Type: application/octet-stream" --data-binary @photo.png "$UPLOAD_URL", withupload.urlasUPLOAD_URL.Hand over a file as a link. Give
file, as ChatGPT passes a file the user attached (download_url,file_id, and maybemime_typeandfile_name). Mojeeb downloads it in this call, within 20 seconds, from a public https address (following up to 3 redirects, each to a public https address too), and the upload comes backready.
An upload holds a JPEG, PNG or WebP image, an MP4 or MOV video, or a PDF or DOCX
document, up to 20 MB, its type read from its bytes. Each feature that then reads it checks
it against its own types and sizes. Use its url in the media field you need, within 24
hours. A member of the agent can create one; using it needs that feature's own scope. It
spends a budget of 10 requests a minute per key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | A file handed over as a temporary https link, the shape in which ChatGPT passes a file the user attached. | |
| agent_id | Yes | The agent the resource belongs to. Another company's agent, or the nil UUID, is `404 agent_not_found`; an agent outside the key's agent list is `403 agent_not_authorized`. | |
| file_name | No | The file's name, with its extension. | |
| size_bytes | No | The file's exact size in bytes: `putUploadContent` must send exactly that many. |