Skip to main content
POST
Start a large file upload

Authorizations

Authorization
string
header
required

varg API key (varg_...). Get one at app.varg.ai or run bunx vargai login. App sessions may alternatively send a Supabase JWT.

Headers

X-Workspace-Id
string

Folder (id or slug) to file the upload into. Wins over workspace_id in the body.

Body

application/json
media_type
string

MIME type of the file. Defaults to application/octet-stream (the real type is then detected from the bytes on upload).

Example:

"video/mp4"

filename
string
size
integer

File size in bytes (max 200 MB)

Required range: 1 <= x <= 209715200
hash
string

sha256 of the file, with or without the sha256: prefix. Lets the API skip the upload when you already have the file.

workspace_id
string

Folder (id or slug) to file the upload into. X-Workspace-Id takes precedence.

Response

A new upload session, or the existing file when the hash matches

deduplicated
enum<boolean>
required
Available options:
false
session_id
string
required

Id for PUT /files/upload/{session_id}. Also becomes the file id.

upload_url
string
required

Presigned URL. PUT the bytes here directly, with the headers below.

public_url
string
required

URL the file will have once uploaded

proxy_url
string
required

Path of the proxy endpoint on this API, for clients that cannot reach upload_url

Example:

"/v2/files/upload/file_abc123"

headers
object
required

Headers to send with the PUT

expires_in
integer
required

Seconds until the session expires

Example:

3600

hash
string | null