Files
Start a large file upload
Changed onUpload flow for files too large or awkward for POST /files (up to 200 MB):
- Call this endpoint with the file's media_type and, ideally, its size and sha256 hash.
- If the response has deduplicated: true, the file already exists in your account: use the returned file_id and url and skip the upload.
- Otherwise send the raw bytes with PUT {upload_url} (direct to storage), or PUT /files/upload/{session_id} (proxy_url) when your environment can only reach api.varg.ai. Use the Content-Type in headers. The session is valid for 1 hour and accepts one upload.
- The proxy PUT registers the file and returns file_id. If you uploaded to upload_url directly, register it afterwards with POST /files/import using public_url.
Send X-Workspace-Id (or workspace_id in the body) to file the upload into a folder.
post/files/upload-session
Request
- Base URL: https://api.varg.ai/v2
- URL: https://api.varg.ai/v2/files/upload-session
- Auth: HTTP bearer
Headers
X-Workspace-Idstring
Folder (id or slug) to file the upload into. Wins over workspace_id in the body.
Request body
Example request
{
"media_type": "video/mp4"
}Response
A new upload session, or the existing file when the hash matches
Example response
{
"proxy_url": "/v2/files/upload/file_abc123",
"expires_in": 3600
}Changes
- info
endpoint added
- info