## Files ### List files `GET /files` Query: `limit?` (default 50), `cursor?`, `assetId?`, `includeWebsiteFiles?` (default false) Returns: `{ items: File[], nextCursor?: string }` Website/document/presentation files (`sites//…`) are excluded unless `includeWebsiteFiles=true`; list them with `GET /websites/:websiteId/files`. SDK: `eb.listFiles({ limit?, cursor?, assetId? })` ### Upload file `POST /files` Body: `{ fileName, contentType, size, access?: "public"|"private", region?: "LATAM"|"US"|"EU", assetId? }` Returns: `{ file: File, putUrl: string }` Then `PUT putUrl` with raw bytes to upload. SDK: `eb.uploadFile({ fileName, contentType, size, access?, region? })` ### Get file `GET /files/:fileId` Returns: File object with `readUrl` (presigned, expires 1h). SDK: `eb.getFile(fileId)` ### Update file `PATCH /files/:fileId` Body: `{ name?, access?: "public"|"private", metadata?, status?: "DONE" }` Changing access copies the object between public/private buckets. SDK: `eb.updateFile(fileId, { name?, access?, metadata? })` ### Delete file `DELETE /files/:fileId` Soft-deletes (status → DELETED). Recoverable for 7 days. A public file stops being served at its public URL immediately. `DELETE /files/:fileId?permanent=true` erases the stored object and the record right away: no trash, not recoverable. Returns 409 `WEBSITE_FILE` if the file backs a published website (same for `POST /files/bulk-delete`, all-or-nothing): manage those through the website endpoints. SDK: `eb.deleteFile(fileId, { permanent? })` ### Restore file `POST /files/:fileId/restore` Restores a soft-deleted file back to DONE. SDK: `eb.restoreFile(fileId)` ### List deleted files `GET /files?status=DELETED` Returns deleted files with `daysUntilPurge`. SDK: `eb.listDeletedFiles({ limit?, cursor? })` ### Duplicate file `POST /files/:fileId/duplicate` Body: `{ name? }` Creates a new storage copy + DB record. SDK: `eb.duplicateFile(fileId, name?)` ### Search files (AI-powered) `GET /files/search?q=query` Requires an AI key configured. Returns up to 20 matches. SDK: `eb.searchFiles(query)` ### File object ```json { "id": "abc123", "name": "photo.jpg", "contentType": "image/jpeg", "size": 204800, "status": "DONE", "access": "public", "url": "https://...", "readUrl": "https://... (presigned)", "metadata": {}, "createdAt": "2026-01-15T...", "updatedAt": "2026-01-15T..." } ```