Storage
Rename
Rename files and folders in Cludz Storage.
Storage Token is different from API Key. Get your Storage Token from Dashboard > Drive > Settings > Storage Token.
PUT /storage/:uuid/:path
Rename a file or folder at the specified path.
Rename File
curl -X PUT "https://storage.cludz.net/storage/{uuid}/documents/old-name.pdf" \
-H "Token: YOUR_STORAGE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"new_name": "new-name.pdf"}'
Request Body
| Field | Type | Description |
|---|---|---|
new_name | string | New file/folder name (max 50 chars) |
Response
{
"statusCode": 200,
"message": "Renamed successfully"
}
Rename Folder
When renaming a folder, all nested files and subfolders are automatically updated:
curl -X PUT "https://storage.cludz.net/storage/{uuid}/old-folder/" \
-H "Token: YOUR_STORAGE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"new_name": "new-folder"}'
Renaming preserves folder permissions and access settings.
Name Validation
- Maximum 50 characters
- Special characters like
/ * ? < > | : " \ 'are removed - Reserved Windows names (CON, PRN, AUX, etc.) are prefixed with
_
Subscription Check
Rename operations require an active subscription:
{
"statusCode": 403,
"message": "Subscription expired. Please renew to modify files."
}
Error Responses
| Status | Message |
|---|---|
400 | Invalid name |
400 | Invalid JSON body |
401 | Authentication required |
403 | No write permission |
403 | Subscription expired |
409 | Destination already exists |
500 | Failed to rename file system object |
Code Examples
const response = await fetch('https://storage.cludz.net/storage/{uuid}/docs/old-file.pdf', {
method: 'PUT',
headers: {
'Token': 'YOUR_STORAGE_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
new_name: 'renamed-file.pdf'
})
});
import requests
response = requests.put(
'https://storage.cludz.net/storage/{uuid}/docs/old-file.pdf',
headers={
'Token': 'YOUR_STORAGE_TOKEN',
'Content-Type': 'application/json'
},
json={'new_name': 'renamed-file.pdf'}
)
