Upload File
POST
/api/v1/media/files/uploadUpload files (images, documents, etc.) to your dedicated SpiderMedia bucket.
warning
The API playground above does not support file uploads. Use cURL, Postman, or code examples below instead. This endpoint requires multipart/form-data, not JSON.
Request
filefilerequiredThe file to upload (max 100MB)
folderstringOptional folder path within your bucket (e.g., "logos", "images/products")
Response
successbooleanWhether the upload succeeded
urlstringPublic URL to access the uploaded file
keystringFile key within the bucket
content_typestringMIME type of the uploaded file
sizeintegerFile size in bytes
Example
- cURL
- Python
- JavaScript
curl -X POST "https://spideriq.ai/api/v1/media/files/upload" \
-H "Authorization: Bearer cli_abc123:sk_xxx:secret_xxx" \
-F "file=@company-logo.png" \
-F "folder=logos"
import requests
url = "https://spideriq.ai/api/v1/media/files/upload"
headers = {"Authorization": "Bearer cli_abc123:sk_xxx:secret_xxx"}
files = {"file": open("company-logo.png", "rb")}
data = {"folder": "logos"}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('folder', 'logos');
fetch('https://spideriq.ai/api/v1/media/files/upload', {
method: 'POST',
headers: {
'Authorization': 'Bearer cli_abc123:sk_xxx:secret_xxx'
},
body: formData
})
.then(response => response.json())
.then(data => console.log(data));
Response Example
{
"success": true,
"url": "https://media.spideriq.ai/client-cli-abc123/logos/company-logo.png",
"key": "logos/company-logo.png",
"content_type": "image/png",
"size": 15234,
"bucket_name": "client-cli-abc123"
}