Introduction
The Drive in Copera is a file storage system organized as a tree of files and folders. This guide explains the drive model, how access control works, and how to upload, download, and search files through the Public API.Drive Structure
The drive organizes items into two types:- Files — uploaded documents, images, videos, and other binary content.
- Folders — containers that group files and other folders into a hierarchy.
Hierarchy
Items can be nested inside folders using theparentId property. This creates a familiar file-system-like tree:
- Project Assets (folder)
- Designs (folder)
- logo.png (file)
- banner.jpg (file)
- report.pdf (file)
- Designs (folder)
Access Model
Drive access is determined by ownership and sharing:- Owner — the user who created the file or folder. Owners have full control.
- Shared participants — other users who have been granted access with a specific role:
admin— full access including managing participants.member— can upload, download, create folders, and modify content.viewer— read-only access (view metadata and download files).
PAT Permissions
Your Personal Access Token must include the ACCESS_DRIVE scope to use the Drive API endpoints. Tokens without this scope will receive a 403 Forbidden response.Navigating the Tree
Use the Drive Tree endpoint to navigate the folder hierarchy:- Fetch root-level items by calling the endpoint without a
parentId. - Fetch a subtree by passing a folder ID as
parentId. - Control depth with the
depthparameter (1-10, default 3).
hasChildren flag, which is useful for building lazy-loading file explorers — only fetch deeper levels when a user expands a folder.
Searching Files
The Search Files endpoint provides full-text search across all drive items accessible to the authenticated user. Pass a query string with theq parameter, and optionally control sorting and result limits with sortBy, sortOrder, and limit.
Downloading Files
To download a file:- Call the Download File endpoint with the file ID.
- The API returns a CloudFront signed URL valid for 3 hours.
- Use the signed URL to download the file via a standard HTTP GET request.
Download is only available for files, not folders.
Uploading Files
File uploads use a multipart upload flow via S3. This approach supports large files reliably by splitting them into parts. See the Multipart Upload endpoint for the full step-by-step process:- Start the upload with file metadata to get an
uploadIdandfileKey. - Request presigned URLs for each part of the file.
- Upload each part directly to S3 using the presigned URLs.
- Finalize the upload by submitting the part ETags to create the drive item.
Creating Folders
Use the Create Folder endpoint to create new folders. Provide aname and optionally a parentId to nest the folder inside an existing one.
Example Workflow
A typical workflow for managing drive files through the API:- Navigate the tree —
GET /public/v1/drive/treeto explore the folder hierarchy. - Create a folder —
POST /public/v1/drive/folderswith a name and optional parent. - Upload a file — Use the multipart upload flow to upload a file into the folder.
- Search files —
GET /public/v1/drive/search?q=keywordto find files by name. - Download a file —
GET /public/v1/drive/files/{fileId}/downloadto get a signed download URL. - Get file details —
GET /public/v1/drive/files/{fileId}to retrieve metadata.
Summary
- The drive organizes files and folders in a tree hierarchy.
- Access is based on ownership and shared participant roles (admin, member, viewer).
- Navigate the hierarchy using the tree endpoint with
parentIdanddepthfor lazy loading. - Search across all accessible files with full-text search.
- Download files via CloudFront signed URLs (valid for 3 hours).
- Upload files using the three-step multipart upload flow via S3.
- Your PAT must include the ACCESS_DRIVE scope.