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 API

Drive API

File storage with folders. Send driveApiKey in the x-api-key header — no Drive ID in the request.

Header: x-api-key: YOUR_API_KEY
GET/api/drive?parentId= (optional)

List folders and files (omit parentId for root)

Header: x-api-key: YOUR_API_KEY
POST/api/drive

Create folder

{
  "name": "My Folder",
  "parentId": null
}
Header: x-api-key: YOUR_API_KEY
POST/api/drive/upload

Upload file (to root or folder)

FormData: folderId (optional), file
Header: x-api-key: YOUR_API_KEY
PATCH/api/drive/items/[id]?type=file|folder

Rename or move file/folder

{
  "name": "New name",
  "targetFolderId": "folder_id"
}
Header: x-api-key: YOUR_API_KEY
DELETE/api/drive/items/[id]?type=file|folder

Move to Recycle Bin (soft delete)

Header: x-api-key: YOUR_API_KEY
GET/api/drive/trash

List items in Recycle Bin

Header: x-api-key: YOUR_API_KEY
POST/api/drive/trash

Restore items from Recycle Bin

{
  "fileIds": [],
  "folderIds": []
}
Header: x-api-key: YOUR_API_KEY
DELETE/api/drive/trash

Permanently delete from Recycle Bin

{
  "fileIds": [],
  "folderIds": []
}
Header: x-api-key: YOUR_API_KEY
GET/api/drive/storage

Get used bytes and limit (subscription plan)

Header: x-api-key: YOUR_API_KEY
GET/api/drive/media?t=TOKEN

Stream 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

Get Started