Upload Endpoint Documentation
Integrate our file storage platform into your own applications using our universal upload API.
Endpoint
POST https://upload.zerostorage.net/api/upload/universalThis endpoint allows you to upload video files to the platform. It supports both direct file uploads and chunked uploads for large files.
It accepts either multipart/form-data (direct file upload) or JSON with a url field (server-side download).
Authentication
API Key (Optional)
Include your API key in the request headers to associate uploads with your account.
x-api-key: your_api_key_hereAnonymous Upload
Omit the API key header to perform an anonymous upload.
Upload a File (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | Binary/File | YES | The video file to upload |
| title | String | No | Title for the video. If not provided, filename will be used |
| description | String | No | Optional description for the video |
| folderId | String (ID) | No | Optional folder ID to organize the file. Use the Folders API to get available folder IDs |
Upload from URL (JSON)
Send a JSON body to have the server download the file for you (same backend as the "Download from URL" feature). Supports direct links, known video hosts, and folder extractors (OneDrive, Gofile). Unlike direct file uploads, anonymous URL downloads are not allowed — an API key or logged-in session is required.
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | String (URL) | YES | Direct URL of the file to download |
| title | String | No | Custom file title (filename is accepted as an alias) |
| description | String | No | Optional file description |
| folderId | String (ID) | No | Folder to import into |
curl -X POST "https://upload.zerostorage.net/api/upload/universal" \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key_here" \
-d '{"url": "https://example.com/video.mp4", "title": "video.mp4"}'Success response: {"success": true, "fileId": "...", "message": "..."} — the download runs server-side in the background.
Response
HTTP 200 OKSuccess Response (200)
{
"fileId": "gen_8x2a1",
"filename": "my_file.mp4",
"size": 1048576,
"viewUrl": "/watch/gen_8x2a1",
"success": true
}HTTP 401 UnauthorizedError Responses
{
"error": "Invalid or inactive API key"
}Example Usage
cURL (Command Line)
curl -X POST "https://upload.zerostorage.net/api/upload/universal" \ -H "x-api-key: your_api_key_here" \ -F "file=@/path/to/your/file.mp4" \ -F "title=My File Title" \ -k \ -s
curl -X POST "https://upload.zerostorage.net/api/upload/universal" -H "x-api-key: your_api_key_here" -F "file=@/path/to/your/file.mp4" -F "title=My File Title" -k -s
cURL — Download from URL (JSON mode)
curl -X POST "https://upload.zerostorage.net/api/upload/universal" \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key_here" \
-d '{"url": "https://example.com/video.mp4", "title": "video.mp4"}'PowerShell
curl.exe -X POST "https://upload.zerostorage.net/api/upload/universal" ` -H "x-api-key: your_api_key_here" ` -F "file=@C:\videos\clip.mp4" ` -F "title=My File Title" ` -k
$form = @{
file = Get-Item -Path "C:\videos\clip.mp4"
title = "API Upload"
}
$response = Invoke-RestMethod -Uri 'https://upload.zerostorage.net/api/upload/universal' \
-Method Post \
-Headers @{ 'x-api-key' = 'your_api_key_here' } \
-Form $formFile Management
List Files
https://upload.zerostorage.net/api/files?folderId=id&page=1&limit=12&search=query&fileType=videoExample Request
curl -X GET "https://upload.zerostorage.net/api/files?limit=2" \ -H "x-api-key: your_api_key_here"
Response Body
{
"files": [
{
"id": "f1",
"name": "vacation.mp4",
"size": 1048576,
"createdAt": "2024-03-29T12:00:00Z"
},
{
"id": "f2",
"name": "logo.png",
"size": 51200,
"createdAt": "2024-03-29T12:30:00Z"
}
],
"total": 45,
"page": 1,
"limit": 2
}Delete File
https://upload.zerostorage.net/api/files/{fileId}Example Request
curl -X DELETE "https://upload.zerostorage.net/api/files/file_id_here" \ -H "x-api-key: your_api_key_here"
Response Body
{
"success": true,
"message": "File deleted successfully"
}Folder Management
List Folders
https://upload.zerostorage.net/api/folders?parentId=id&page=1&limit=20Example Request
curl -X GET "https://upload.zerostorage.net/api/folders?parentId=root" \ -H "x-api-key: your_api_key_here"
Response Body
{
"folders": [
{
"id": "folder_1",
"name": "Documents",
"fileCount": 12
},
{
"id": "folder_2",
"name": "Work",
"fileCount": 5
}
],
"total": 2
}Delete Folder
https://upload.zerostorage.net/api/folders/{folderId}Example Request
curl -X DELETE "https://upload.zerostorage.net/api/folders/folder_id_here" \ -H "x-api-key: your_api_key_here"
Response Body
{
"success": true,
"message": "Folder and all its contents deleted successfully"
}