Create an upload link
create_upload_linkGet a one-time address to send a local file to, for an agent that can run a shell. PUT the file's bytes to upload_url (the answer includes a curl command), then call compress_images with the upload_id. The link expires after a few minutes and works once; the uploaded file keeps for about a day. Ask for one link per file. Uploads not yet compressed never outnumber the images the plan can still compress today (a fixed number of them on a plan without a daily cap): past that, a new link is refused with uploads_waiting, naming the upload ids already sent: compress those, then ask again.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_name | Yes | The file's name, like "hero.png". It names the image; the extension is corrected to what the bytes turn out to be. |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| curl | No | A command that sends the file. | |
| next | No | ||
| method | No | ||
| upload_id | No | The id to pass to compress_images in upload_ids once the file is sent. | |
| expires_at | No | ||
| upload_url | No | ||
| max_file_size | No | Bytes. |