Open an upload session

POST /Platform/uploads/init

Open an upload session.

Declares the file up front; the response says how to send it: the mode, the part_size and part_count, and in direct mode a presigned part_urls map to PUT each part to. Form sessions must pass field_id.

An agent with a shell and the file on disk: open the session in direct mode with the exact byte size, send each part's bytes as the body of an HTTP PUT to its URL with no credentials (the whole file when there is one part; otherwise consecutive part_size byte ranges), then call complete_upload. It returns a file-... handle you can pass to any operation that takes a recording, document or image; create with source=<handle> stores it as a pdf, image or audio value when you want one. Proxied mode needs your API credential on every part, which a sandbox does not have. Without a shell, or for a person's own file, use an upload link instead.

Body parameters

Returns

UploadInitResponse

Example request

curl -X POST "https://api.hilus.ai/Platform/uploads/init" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'