Prepare an upload
xora_upload_prepareReserves a one-time upload for an action that takes a file, after checking the declared type, size and SHA-256 against that action's limits. Returns upload_url, which accepts one HTTPS PUT of exactly the declared bytes with required_headers and expires after ten minutes; the URL carries its own single-use credential, so no Authorization header is needed. owner_upload_url is a portal page where the owner can choose the file instead. The server never reads a local path. An image for a social post can instead be given to the action itself, by address or as base64.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| sha256 | Yes | ||
| filename | Yes | ||
| byte_size | Yes | ||
| mime_type | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | ||
| method | Yes | ||
| max_bytes | Yes | ||
| upload_id | Yes | ||
| expires_at | Yes | When upload_url and the reservation stop working (10 minutes). | |
| upload_url | Yes | Accepts one HTTPS PUT of exactly the declared bytes. It carries its own single-use credential valid until expires_at, so no Authorization header is needed. | |
| reason_code | Yes | ||
| owner_upload_url | Yes | A portal page where the owner can choose the file themselves instead of an HTTPS PUT. | |
| required_headers | Yes | Headers the PUT must carry: Content-Type when upload_url carries its own credential (its ?token=); Content-Type and this connection's bearer otherwise. |