Skip to main content
POST
/
v2
/
uploads
Create Upload
curl --request POST \
  --url https://api.tusky.io/v2/uploads
{
  "Location": {},
  "Upload-Offset": {}
}
Create a new upload. Supports two modes:
  • Resumable (tus): Send only metadata headers to create the upload session, then upload data in chunks via Upload Chunk.
  • Single request: Include the full file body in this request for a one-shot upload. Works with both application/offset+octet-stream and multipart/form-data.
The upload ID returned is also the file ID in the file system.

Query Parameters

vaultId
string
required
Target environment ID. Can also be provided in Upload-Metadata. Query params take precedence.
parentId
string
Parent folder ID. Defaults to environment root. Can also be in Upload-Metadata.
filename
string
File name. Can also be provided in Upload-Metadata, or Content-Disposition header. Defaults to unnamed.
filetype
string
MIME type. Can also be provided in Upload-Metadata, or Content-Type header. Auto-detected from filename if omitted.

Headers

Upload-Length
number
Total file size in bytes. Required for multi-chunk resumable uploads. For single-request uploads, Content-Length is used if this is omitted. Max: 2,621,440,000 (2.5 GB).
Upload-Metadata
string
Base64-encoded key-value pairs. Supported keys: filename, filetype, vaultId, parentId, chunkSize, numberOfChunks.Format: key1 {base64_value},key2 {base64_value}
Tus-Resumable
string
tus protocol version. Defaults to 1.0.0 if omitted.
Content-Type
string
application/offset+octet-stream for tus uploads, or multipart/form-data for single-request multipart uploads.

Response

Returns 201 Created.
Location
string (header)
Upload URL for subsequent PATCH and HEAD requests.
Upload-Offset
number (header)
Current byte offset. 0 for a new upload, or equal to Upload-Length if the full file was included in this request.
When the upload completes (single request or final chunk), the response body contains:
{
  "uploadId": "upload_xyz789"
}

Examples

curl -X POST "https://api.tusky.io/v2/uploads?vaultId=env_abc123&filename=photo.jpg" \
  -H "Api-Key: YOUR_API_KEY" \
  -F "file=@./photo.jpg"
vaultId is required. Provide it via query parameter or Upload-Metadata. Query parameters take precedence over metadata headers.
Maximum file size is 2.5 GB. Maximum individual chunk size is 50 MB. Maximum number of chunks per upload is 10,000.