// documentation
API Documentation
Integrate Styloshare Storage into any app. Upload files with chunked multipart via pre-signed URLs. Zero egress fees. Works with any framework.
Quick Start
1
Sign Up
Create a free account
2
Create Project
Set up your first project
3
Get API Key
Generate a project API key
4
Integrate
Add storage to your app
Authentication
Include your API key in the x-api-key header with every request.
http
GET /api/v1/storage/files HTTP/1.1
Host: api.styloshare.dev
x-api-key: ss_your_api_key_hereIntegration Examples
Chunked File Upload
Upload files of any size via pre-signed URLs. The API handles S3 multipart automatically.
javascript
const API = "https://api.styloshare.com/api/v1";
const API_KEY = "ss_your_api_key";
// 1. Initialize upload
const init = await fetch(`${API}/upload/init`, {
method: "POST",
headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
fileName: file.name,
fileSize: file.size,
mimeType: file.type,
projectId: "YOUR_PROJECT_ID"
})
}).then(r => r.json());
// 2. Upload chunks via pre-signed URLs
for (const { index, url } of init.data.signedUrls) {
const chunk = file.slice(index * init.data.chunkSize, (index + 1) * init.data.chunkSize);
const res = await fetch(url, { method: "PUT", body: chunk });
await fetch(`${API}/upload/${init.data.uploadId}/confirm/${index}`, {
method: "POST",
headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ etag: res.headers.get("ETag") })
});
}
// 3. Complete
await fetch(`${API}/upload/${init.data.uploadId}/complete`, {
method: "POST", headers: { "x-api-key": API_KEY }
});List Files
javascript
const files = await fetch(`${API}/storage/files?projectId=YOUR_PROJECT_ID`, {
headers: { "x-api-key": "ss_your_api_key" }
}).then(r => r.json());
console.log(files.data.files);