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.
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.
NO API KEY REQUIRED
Request Parameters
| 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 |
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)
Bash / Terminal
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
Bash / Terminal
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
PowerShell
PowerShell 5+
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
PowerShell 7+
$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
GET
List Files
Auth Required
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
Delete File
Auth Required
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
GET
List Folders
Auth Required
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
Delete Folder
Auth Required
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"
}