Skip to main content
POST
Import a file by URL

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.

Body

application/json
url
string<uri>
required
filename
string
media_type
string
origin
enum<string>

Explicit provenance (defaults to generated for varg URLs, upload for external)

Available options:
upload,
generated
hash
string

sha256 of the bytes for dedup (sha256:<hex> or bare hex)

size
integer
metadata
object

Client-measured metadata (width, height, duration_ms, ...)

Response

File imported (or deduplicated)

file_id
string
url
string

Stable varg-hosted URL

hash
string | null
size
integer
media_type
string
filename
string | null
title
string | null
subtitle
string | null
metadata
object | null
deduplicated
boolean

true when an existing file with the same content was returned