POST
/v1/tools/create_uploadfreeUpload a file
Gets a place for one file, or several with filenames on one page, and returns each file_id. upload_page is a link where the file is picked in a browser; upload_status says when it has arrived. A caller that can send bytes passes bytes and content_type to get upload_url as well. Files up to 4096 MB, larger than chat attachments. An upload no tool uses goes after a day; with keep it stays in Files, where files are kept until you delete them. Links last a day, and the result says until when. Free.
Fields
| Field | Type | Default | What it is |
|---|---|---|---|
filename | string | None | The name of the file, e.g. interview.mp4, if you know it |
filenames | array | None | Several files at once, by name: one upload_page takes them all, and each gets its own file_id, in this order. In place of filename. |
content_type | string | None | Its media type, e.g. video/mp4. Only needed with bytes. |
bytes | number | None | Its size in bytes. Only if you will send the bytes yourself. |
keep | boolean | None | Keep it in Files even if no tool uses it, for a person putting a file in Files, where files are kept until you delete them. Off by default. |
Call it
Request
curl -X POST https://app.scrub.app/v1/tools/create_upload \
-H "Authorization: Bearer $SCRUB_KEY" \
-H "Content-Type: application/json" \
-d '{}'Answer
{
"ok": true,
"result": {
"…": "…"
}
}What result holds is said above.
Every call can also answer an error: what comes back. Try it with your key from Account.