Upload files or create new folders in the specified path.
Use multipart/form-data to upload files:
curl -X POST "https://storage.cludz.net/storage/{uuid}/documents/" \
-H "Token: YOUR_STORAGE_TOKEN" \
-F "[email protected]"
| Limit | Value |
|---|---|
| Max file size | 100 MB |
| Max request body | 32 GB (for batch) |
{
"statusCode": 201,
"message": "Files uploaded"
}
Send a JSON body with type: "folder":
curl -X POST "https://storage.cludz.net/storage/{uuid}/" \
-H "Token: YOUR_STORAGE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type": "folder", "name": "new-folder"}'
| Field | Type | Description |
|---|---|---|
type | "folder" | Create a folder |
name | string | Folder name (max 50 chars) |
{
"statusCode": 201,
"message": "Folder created"
}
Send a JSON body with type: "file":
curl -X POST "https://storage.cludz.net/storage/{uuid}/documents/" \
-H "Token: YOUR_STORAGE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type": "file", "name": "notes.txt"}'
{
"statusCode": 201,
"message": "File created",
"location": "/documents/notes.txt",
"fileName": "notes.txt"
}
The API uses SHA-256 hashing to detect duplicate uploads. If you upload a file with the same content as an existing file:
{
"statusCode": 400,
"message": "File unchanged"
}
Files can only be uploaded when the storage subscription is active:
{
"statusCode": 403,
"message": "Subscription expired. Please renew to upload files."
}
| Status | Message |
|---|---|
400 | Invalid folder name |
400 | Can only upload to directories |
400 | File exceeds upload limit |
401 | Authentication required |
403 | No write permission |
403 | Subscription expired |
409 | Folder exists |
409 | File exists |
// Upload file
const formData = new FormData();
formData.append('file', fileBlob, 'document.pdf');
const response = await fetch('https://storage.cludz.net/storage/{uuid}/documents/', {
method: 'POST',
headers: {
'Token': 'YOUR_STORAGE_TOKEN'
},
body: formData
});
const response = await fetch('https://storage.cludz.net/storage/{uuid}/', {
method: 'POST',
headers: {
'Token': 'YOUR_STORAGE_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'folder',
name: 'my-folder'
})
});