Skip to main content
POST
/
files
Upload file
curl --request POST \
  --url https://api.varg.ai/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/octet-stream' \
  --data '"<string>"'
{
  "file_id": "file_abc123",
  "url": "https://s3.varg.ai/u/user_xxx/abc123.jpg",
  "hash": "sha256:abc123def456...",
  "size": 102400,
  "media_type": "image/jpeg",
  "deduplicated": false
}

Authorizations

Authorization
string
header
required

API key from varg.ai/dashboard.

Pass as Authorization: Bearer varg_xxx.

Headers

X-Content-Hash
string

SHA-256 hash of the file content, used for deduplication

Body

application/octet-stream

The body is of type file.

Response

File uploaded

file_id
string
required

Unique file identifier

Example:

"file_abc123"

url
string<uri>
required

Stable URL for the uploaded file

Example:

"https://s3.varg.ai/u/user_xxx/abc123.jpg"

hash
string
required

SHA-256 hash of the file content

Example:

"sha256:abc123def456..."

size
number
required

File size in bytes

Example:

102400

media_type
string
required

Detected MIME type

Example:

"image/jpeg"

deduplicated
boolean
required

True if an existing file with the same hash was returned

Example:

false