Skip to main content

Overview

The Drive API lets you manage files and folders in Copera. The drive is organized as a tree hierarchy, supports multipart uploads for large files, and provides signed download URLs. Requires a Personal Access Token (cp_pat_) with the ACCESS_DRIVE scope.
The Copera Node.js SDK and CLI fully support all Drive operations. Choose your preferred tool below.

Quick Start

# Browse drive tree
curl -X GET https://api.copera.ai/public/v1/drive/tree \
  -H "Authorization: Bearer cp_pat_YOUR_TOKEN"

# Get file metadata
curl -X GET https://api.copera.ai/public/v1/drive/files/{fileId} \
  -H "Authorization: Bearer cp_pat_YOUR_TOKEN"

# Download a file (returns signed URL)
curl -X GET https://api.copera.ai/public/v1/drive/files/{fileId}/download \
  -H "Authorization: Bearer cp_pat_YOUR_TOKEN"

# Search files
curl -X GET "https://api.copera.ai/public/v1/drive/search?q=report" \
  -H "Authorization: Bearer cp_pat_YOUR_TOKEN"

# Create a folder
curl -X POST https://api.copera.ai/public/v1/drive/folders \
  -H "Authorization: Bearer cp_pat_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Project Files" }'

Available Operations

OperationDescription
Drive TreeBrowse the file/folder hierarchy with configurable depth
Get FileRetrieve metadata for a file or folder
Download FileGet a CloudFront signed URL (valid 3 hours)
Search FilesFull-text search across accessible drive items
Create FolderCreate a new folder at root or nested inside another
Multipart UploadUpload files via S3 presigned URLs (start, get URLs, finalize)

Next Steps