Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /v1/gallery/files | List gallery files with filtering, pagination, and localization |
| PUT | /v1/gallery/files/:id | Update file metadata (tags, folder, status) |
| PUT | /v1/gallery/files/:id/translations | Upsert localized alt text and descriptions |
| DELETE | /v1/gallery/files/:id | Schedule file deletion and enqueue removal |
| POST | /v1/gallery/upload | Upload a file (multipart or JSON payload) |
| GET | /v1/gallery/download/:id | Download or redirect to provider playback URL |
| GET | /v1/gallery/folders | List folders in the workspace |
| POST | /v1/gallery/folders | Create a folder |
| GET | /v1/gallery/stats | Retrieve storage and file counts |
Scopes:
gallery:read grants listing, downloads, stats. gallery:write allows uploads, metadata updates, folder creation, and translations. gallery:delete is required to schedule deletions. All routes resolve workspace context from the API key/session; do not send manual workspace headers.Key concepts
- Files are stored per workspace with metadata derived from the upload provider (Cloudflare R2, Images, or Stream). Status reflects the processing state (
completed,processing,deleting, etc.). - Listing resolves localized alt/description metadata using
localeandfallbackLocale. PassincludeMeta=1to embed translation maps and supported languages. - Uploads accept raw multipart files or base64 JSON payloads. The API picks the storage provider automatically based on MIME type and returns a 202 response while background processing finishes.
- Deleting a file is asynchronous: the API marks the record as
deleting, enqueues work ongallery-operations-queue, and emitsgallery.file.deletedwebhooks once storage cleanup is complete. - Folder operations are flat: responses return
parentIdandpathso clients can construct trees client-side. - Stats aggregate file counts and storage usage to help monitor quotas.