Skip to main content
POST
Upload a file

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

Content-Type
string
X-Content-Hash
string

sha256 hash of the bytes (with or without the sha256: prefix) for dedup

X-Filename
string

Original filename

X-Workspace-Id
string

Folder (id or slug) to file the upload into. Wins over a multipart workspace_id field. An unknown folder returns 404 workspace_not_found.

Body

The body is of type file.

Response

File stored (or deduplicated)

file_id
string
required
url
string
required

Stable varg-hosted URL

size
integer
required
media_type
string
required
deduplicated
boolean
required

true when an existing file with the same content was returned

hash
string | null
filename
string | null
title
string | null
subtitle
string | null
metadata
object | null
origin
enum<string>

Present on /files/import responses

Available options:
upload,
generated