REST API · v1.0
API DOCS
Integrate Synox CDN into your apps with a simple POST request.
BASE URL
https://cdn.synoxcloud.xyz
RATE LIMIT
3 uploads / 10 sec
MAX FILE SIZE
100 MB
AUTH
None (public)
UPLOAD ENDPOINT
Upload image or video files via multipart/form-data.
POST/api/upload
Upload an image or video — stored securely on Synox Database.
REQUEST
multipart/form-data
// JavaScript (Fetch API)
const form = new FormData();
form.append('file', fileInput.files[0]);
const res = await fetch(
'https://cdn.synoxcloud.xyz/api/upload',
{ method: 'POST', body: form }
);
const json = await res.json();SUCCESS RESPONSE 200
application/json
{
"success": true,
"url": "https://cdn.synoxcloud.xyz/storage/abc123def.png",
"filename": "abc123def.png",
"path": "/storage/abc123def.png",
"size": "248 KB",
"type": "image/png"
}ERROR RESPONSES
All error responses follow the same shape.
400Bad Request
{ "success": false, "message": "No file provided." }413File Too Large
{ "success": false, "message": "File too large. Maximum 100MB." }415Unsupported Type
{ "success": false, "message": "Unsupported file type." }429Rate Limited
{ "success": false, "message": "Too many uploads." }STATUS CODES
HTTP status codes returned by the API.
| Code | Meaning | When |
|---|---|---|
| 200 | OK | Upload succeeded. |
| 400 | Bad Request | Missing or malformed request body. |
| 401 | Unauthorized | Admin endpoint called without valid session. |
| 413 | Payload Too Large | File exceeds 100MB limit. |
| 415 | Unsupported Media Type | File type is not allowed. |
| 429 | Too Many Requests | Rate limit exceeded. IP banned for 2 hours. |
| 500 | Internal Server Error | Upstream storage error. |
| 502 | Bad Gateway | Synox Database unavailable (video uploads). |
RATE LIMIT
Limits are enforced per IP address using Upstash Redis.
Upload Limit
3 files per 10 seconds
Ban Duration
2 hours per violation
Persistence
Stored in Upstash Redis
Bypass
Admin uploads are not rate limited
CDN URLS
All uploaded files are served via CDN with proper headers.
URL patterns
// Public user upload (images) https://cdn.synoxcloud.xyz/storage/abc123.png // Admin custom folder (images) https://cdn.synoxcloud.xyz/anime/naruto.jpg https://cdn.synoxcloud.xyz/wallpaper/bg-dark.webp https://cdn.synoxcloud.xyz/jkt48/inanam.avif // Video files https://cdn.synoxcloud.xyz/jedagjedug/jj1.mp4 https://cdn.synoxcloud.xyz/storage/demo.mp4 // Response headers for all files Cache-Control: public, max-age=31536000, immutable Content-Type: image/png | video/mp4 | ... ETag: "..." Accept-Ranges: bytes // videos only
CODE EXAMPLES
Integration examples in multiple languages.
cURL
curl -X POST https://cdn.synoxcloud.xyz/api/upload \ -F "file=@/path/to/image.png"
Python
import requests
with open("image.png", "rb") as f:
response = requests.post(
"https://cdn.synoxcloud.xyz/api/upload",
files={"file": f}
)
print(response.json())Node.js
import FormData from 'form-data';
import fetch from 'node-fetch';
import fs from 'fs';
const form = new FormData();
form.append('file', fs.createReadStream('image.png'));
const res = await fetch('https://cdn.synoxcloud.xyz/api/upload', {
method: 'POST',
body: form,
headers: form.getHeaders(),
});
const result = await res.json();
console.log(result.url); // https://cdn.synoxcloud.xyz/storage/abc123.png