Reserve an upload
First of the three calls that upload a video. Returns an upload_path
to send the bytes to, and the video_id you will reference from an
evaluation.
The whole sequence:
POST /v1/videoswith the file’s content type and size. You get back avideo_idand a short-livedupload_path.PUTthe raw bytes toupload_path. Send noAuthorizationheader on this request —upload_pathis on separate storage infrastructure, not this API, and a key sent there is a key disclosed to a third party. DeclareContent-Length; a request that does not is refused. The grant expires after 15 minutes, and a replacement means starting again at step 1.POST /v1/videos/{video_id}/complete, which hands the file to validation. PollGET /v1/videos/{video_id}untilstatusisready; only then may an evaluation reference it.
Pass content_hash (SHA-256 of the bytes, hex) to skip the transfer
when we already hold that exact content: the response then carries
skip_upload: true and no upload_path, and the video is immediately
usable. Nothing is charged for the bytes you did not send.
This consumes an upload quota slot. A rejected content type or an
oversized size_bytes is refused before the slot is taken.
Authorizations
Use a key created in the Playground. Keys begin with gk_.
Body
Only MP4 is accepted.
video/mp4 Exact size of the file you are about to send. It is signed into the grant, so the storage endpoint refuses a body that exceeds it -- an understated size fails the PUT rather than the reservation.
1 <= x <= 52428800SHA-256 of the bytes, hex. Optional, and worth sending: when we already hold this exact content the response says skip_upload and there is nothing to transfer.
^[0-9a-f]{64}$Optional metadata recorded on the video.
Optional metadata recorded on the video.
x >= 1Optional metadata recorded on the video.
x >= 1Response
Upload reserved, or an existing copy matched.
Reference this as the evaluation's video.upload_id, once the video reaches ready.
Where the bytes will be readable once the upload completes.
Where to PUT the bytes. A path or absolute URL on separate storage infrastructure, valid for 15 minutes, carrying its own signed grant -- send no Authorization header with it. Absent when skip_upload is true.
Present and true when content_hash matched content we already hold. Skip straight to referencing video_id: there is nothing to upload and no completion call to make.