Storage Endpoints
Direct HTTP endpoint specifications for direct presigned uploads, full File CRUD, Virtual Folder CRUD, and directory browsing.
/api/storage/presign
Generates a time-limited presigned PUT URL and human-readable r2Key allowing clients to stream directly to Cloudizero storage.
curl -X POST https://api.cloudizero.com/api/storage/presign \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"projectId": "prj_LXAlEW70v24YSc0y",
"fileName": "avatar.png",
"mimeType": "image/png",
"fileSize": 1048576,
"folderId": null,
"optimize": "webp"
}'{
"uploadUrl": "https://api.cloudizero.com/api/storage/upload?token=...",
"storageKey": "username/project-slug/avatar.webp",
"r2Key": "username/project-slug/avatar.webp",
"fileId": "fil_tsvSl4yYKEOlO4KN",
"finalFileName": "avatar.webp"
}/api/storage/complete
Registers the uploaded asset into the relational Cloudizero database after the client finishes streaming to storage.
curl -X POST https://api.cloudizero.com/api/storage/complete \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"fileId": "fil_tsvSl4yYKEOlO4KN",
"projectId": "prj_LXAlEW70v24YSc0y",
"folderId": null,
"name": "avatar.png",
"mimeType": "image/png",
"size": 1048576,
"storageKey": "username/project-slug/avatar.webp",
"optimize": "webp"
}'/api/storage/multipart/*
Parallel chunked multipart upload lifecycle for large media assets up to 50 GB: initiate upload sessions, presign chunk part URLs, assemble/complete uploads, or abort stale sessions.
1. Initiate: POST /api/storage/multipart/initiate
curl -X POST https://api.cloudizero.com/api/storage/multipart/initiate \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"projectId": "prj_LXAlEW70v24YSc0y",
"fileName": "large-video.mp4",
"mimeType": "video/mp4",
"fileSize": 1073741824,
"folderId": null
}'{
"uploadId": "mp_9f8ab2e4b830d9...",
"fileId": "fil_tsvSl4yYKEOlO4KN",
"r2Key": "usr_IIZHBI7BIsUY7IOL/prj_LXAlEW70v24YSc0y/large-video.mp4",
"finalFileName": "large-video.mp4",
"partSize": 10485760,
"totalParts": 103,
"cacheControl": "public, max-age=31536000, immutable"
}2. Presign Parts: POST /api/storage/multipart/presign-parts
curl -X POST https://api.cloudizero.com/api/storage/multipart/presign-parts \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"fileId": "fil_tsvSl4yYKEOlO4KN",
"uploadId": "mp_9f8ab2e4b830d9...",
"partNumbers": [1, 2, 3]
}'{
"presignedUrls": {
"1": "https://api.cloudizero.com/api/storage/upload?part=1&token=...",
"2": "https://api.cloudizero.com/api/storage/upload?part=2&token=...",
"3": "https://api.cloudizero.com/api/storage/upload?part=3&token=..."
}
}3. Complete: POST /api/storage/multipart/complete
curl -X POST https://api.cloudizero.com/api/storage/multipart/complete \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"fileId": "fil_tsvSl4yYKEOlO4KN",
"uploadId": "mp_9f8ab2e4b830d9...",
"parts": [
{ "PartNumber": 1, "ETag": "9b2cf52...01" },
{ "PartNumber": 2, "ETag": "7a3be41...02" }
],
"projectId": "prj_LXAlEW70v24YSc0y",
"name": "large-video.mp4",
"mimeType": "video/mp4",
"size": 1073741824
}'{
"file": {
"id": "fil_tsvSl4yYKEOlO4KN",
"name": "large-video.mp4",
"size": 1073741824,
"mimeType": "video/mp4",
"processingStatus": "ready",
"r2Key": "usr_IIZHBI7BIsUY7IOL/prj_LXAlEW70v24YSc0y/large-video.mp4"
}
}4. Abort: POST /api/storage/multipart/abort
curl -X POST https://api.cloudizero.com/api/storage/multipart/abort \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"fileId": "fil_tsvSl4yYKEOlO4KN",
"uploadId": "mp_9f8ab2e4b830d9..."
}'/api/storage/contents
Fetches all files, virtual folders, and navigation breadcrumbs for a given projectId and folderId.
curl -X GET "https://api.cloudizero.com/api/storage/contents?projectId=prj_LXAlEW70v24YSc0y&folderId=root" \
-H "Authorization: Bearer cz_live_..."/api/storage/files
Read file metadata & presigned download URL, update file metadata (rename/move in storage or request a presigned replacement PUT URL), or permanently delete an asset.
# 1. Ambil Metadata File & URL Unduhan Presigned
curl -X GET "https://api.cloudizero.com/api/storage/files?fileId=fil_tsvSl4yY..." \
-H "Authorization: Bearer cz_live_..."
# 2. Update Metadata File (Ubah Nama / Pindah Folder / Minta URL Timpa Biner)
curl -X PATCH https://api.cloudizero.com/api/storage/files \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"fileId": "fil_tsvSl4yY...",
"name": "avatar-v2.png",
"folderId": "fld_ARaZjwdP...",
"requestReplaceUploadUrl": false
}'
# 3. Hapus File Permanen (Storage + Database)
curl -X DELETE "https://api.cloudizero.com/api/storage/files?fileId=fil_tsvSl4yY..." \
-H "Authorization: Bearer cz_live_..."/api/storage/folders
Full CRUD for virtual folders, including recursive path & storage key synchronization on rename/move and recursive storage object cleanup on deletion.
# 1. Buat Folder Virtual
curl -X POST https://api.cloudizero.com/api/storage/folders \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"projectId": "prj_LXAlEW70v24YSc0y",
"name": "Banner Pemasaran",
"parentId": null
}'
# 2. Ambil Folder Tunggal atau Daftar Folder Proyek
curl -X GET "https://api.cloudizero.com/api/storage/folders?projectId=prj_LXAlEW70v24YSc0y&parentId=root" \
-H "Authorization: Bearer cz_live_..."
# 3. Ubah Nama atau Pindahkan Folder (Otomatis Sinkronisasi Path Subfolder & Storage Key)
curl -X PATCH https://api.cloudizero.com/api/storage/folders \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"folderId": "fld_ARaZjwdP...",
"name": "Aset Brand",
"parentId": null
}'
# 4. Hapus Folder Rekursif (Menghapus Subfolder & Objek Penyimpanan di dalamnya)
curl -X DELETE "https://api.cloudizero.com/api/storage/folders?folderId=fld_ARaZjwdP..." \
-H "Authorization: Bearer cz_live_..."/api/storage/files/[fileId]/pages
Asynchronous page extraction for PDF documents into high-resolution WebP images, cover thumbnail generation, and retrieving navigation chapters via zero-egress CDN.
# 1. Ekstraksi Halaman PDF (Asinkron)
curl -X POST "https://api.cloudizero.com/api/storage/files/fil_tsvSl4yYKEOlO4KN/extract" \
-H "Authorization: Bearer cz_live_..."
# 2. Ambil Halaman Dokumen, Thumbnail & Daftar Bab
curl -X GET "https://api.cloudizero.com/api/storage/files/fil_tsvSl4yYKEOlO4KN/pages" \
-H "Authorization: Bearer cz_live_..."{
"fileId": "fil_tsvSl4yYKEOlO4KN",
"fileName": "handbook.pdf",
"mimeType": "application/pdf",
"processingStatus": "ready",
"pageCount": 12,
"thumbnailUrl": "https://cdn.cloudizero.com/user/project/handbook-thumb.webp",
"chapters": [
{ "title": "Introduction", "page": 1, "level": 1 }
],
"pages": [
{
"pageNumber": 1,
"url": "https://cdn.cloudizero.com/user/project/pages/handbook-p1.webp",
"width": 1200,
"height": 1600,
"size": 184320
}
]
}/api/storage/search
Hybrid multimodal search combining 768-dimensional vector semantic similarity with precise keyword matching across Cloudizero project assets.
curl -X GET "https://api.cloudizero.com/api/storage/search?projectId=prj_LXAlEW70v24YSc0y&q=sunset+over+the+beach" \
-H "Authorization: Bearer cz_live_..."{
"results": [
{
"id": "fil_tsvSl4yYKEOlO4KN",
"projectId": "prj_LXAlEW70v24YSc0y",
"name": "beach-sunset.webp",
"mimeType": "image/webp",
"size": 458290,
"similarityScore": 0.892,
"matchType": "hybrid",
"altText": "Golden sunset glowing over tropical palm trees on a tranquil sandy beach",
"aiMetadata": {
"tags": ["beach", "sunset", "tropical", "nature"],
"description": "Vibrant dusk colors reflecting on calm ocean waters with silhouette palms."
}
}
],
"query": "sunset over the beach",
"mode": "hybrid",
"totalCount": 1
}/api/storage/files/[fileId]/ai-describe
Multimodal AI visual inspection generating accessible WCAG alt-text, SEO categorical tags, descriptive summaries, and dominant color palettes.
curl -X POST "https://api.cloudizero.com/api/storage/files/fil_tsvSl4yYKEOlO4KN/ai-describe" \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"locale": "en",
"force": false
}'{
"success": true,
"altText": "A sleek modern laptop workstation on a wooden minimalist desk with soft morning daylight.",
"aiMetadata": {
"altText": "A sleek modern laptop workstation on a wooden minimalist desk with soft morning daylight.",
"tags": ["laptop", "workspace", "minimalist", "tech", "productivity"],
"description": "Clean desktop setup featuring an open notebook computer and ambient lighting.",
"dominantColors": ["#1E293B", "#F8FAFC", "#94A3B8"],
"generatedAt": "2026-10-21T12:00:00.000Z",
"locale": "en"
}
}/api/storage/batch-delete
Permanently deletes multiple files and folders in a single batch operation. Subtrees for selected folders are automatically expanded to clean up all nested binary objects from storage and associated metadata records from the database.
curl -X POST https://api.cloudizero.com/api/storage/batch-delete \
-H "Authorization: Bearer cz_live_..." \
-H "Content-Type: application/json" \
-d '{
"projectId": "prj_LXAlEW70v24YSc0y",
"fileIds": ["fil_tsvSl4yYKEOlO4KN", "fil_ARaZjwdPpUqXhDHf"],
"folderIds": ["fld_subfolder_id"]
}'{
"success": true,
"deleted": {
"explicitFilesCount": 2,
"explicitFoldersCount": 1,
"totalPurgedFilesCount": 8
}
}