Developer Guide
API documentation for Client Gallery and Drive
Authentication
Use only the API key. The platform derives your account from the key — no need to pass studioId or driveId in requests. Use apiKey (Client Gallery) or driveApiKey (Drive). Your Studio ID and Drive ID are shown in the dashboard for reference.
Required header (key only)
Send your API key in the x-api-key header. No account ID in the request.
x-api-key: sk_your_api_key_here
POST /api/register
{
"email": "studio@example.com",
"password": "your-password",
"displayName": "My Studio",
"accountType": "studio" // or "drive"
}
// Response: { studioId, driveId, apiKey, driveApiKey, ... }
// - apiKey: use for Client Gallery API
// - driveApiKey: use for Drive APIClient Gallery API
Manage collections, upload files, and share client galleries. Send apiKey in the x-api-key header — no Studio ID in the request.
/api/collectionsList all collections
/api/collectionsCreate a collection
{
"name": "Wedding 2024",
"clientName": "John Doe",
"date": "2024-06-15",
"categoryId": "cat_xxx"
}/api/categoriesList categories
/api/categoriesCreate a category
{
"name": "General"
}/api/uploadUpload file to a collection
FormData: collectionId, clientName, file
/api/collections/[id]/filesGet collection files (with signed URLs)
/api/media?t=TOKENStream file (use token from files response)
/api/studio/storageGet storage usage (usedBytes, limitBytes)
Drive API
File storage with folders. Send driveApiKey in the x-api-key header — no Drive ID in the request.
/api/drive?parentId= (optional)List folders and files (omit parentId for root)
/api/driveCreate folder
{
"name": "My Folder",
"parentId": null
}/api/drive/uploadUpload file (to root or folder)
FormData: folderId (optional), file
/api/drive/items/[id]?type=file|folderRename or move file/folder
{
"name": "New name",
"targetFolderId": "folder_id"
}/api/drive/items/[id]?type=file|folderMove to Recycle Bin (soft delete)
/api/drive/trashList items in Recycle Bin
/api/drive/trashRestore items from Recycle Bin
{
"fileIds": [],
"folderIds": []
}/api/drive/trashPermanently delete from Recycle Bin
{
"fileIds": [],
"folderIds": []
}/api/drive/storageGet used bytes and limit (subscription plan)
/api/drive/media?t=TOKENStream Drive file (use token from files response)
Examples
cURL - List Drive files
curl -H "x-api-key: YOUR_DRIVE_API_KEY" \ "https://your-platform.com/api/drive"
cURL - Upload to Drive
curl -X POST "https://your-platform.com/api/drive/upload" \ -H "x-api-key: YOUR_DRIVE_API_KEY" \ -F "folderId=FOLDER_ID" \ -F "file=@/path/to/image.jpg"
JavaScript - Create collection (Client Gallery)
const res = await fetch('https://your-platform.com/api/collections', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_CLIENT_GALLERY_API_KEY'
},
body: JSON.stringify({
name: 'Wedding Album',
clientName: 'Jane Smith',
date: '2024-06-15',
categoryId: 'cat_xxx'
})
});
const collection = await res.json();JavaScript - Upload to collection
const formData = new FormData();
formData.append('collectionId', collection.id);
formData.append('clientName', 'Jane Smith');
formData.append('file', fileInput.files[0]);
await fetch('https://your-platform.com/api/upload', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_CLIENT_GALLERY_API_KEY' },
body: formData
});Ready to build?
Create an account and get your API credentials