Files
LabTrace supports two types of files: public files (stored in AWS S3) and private files (stored only on IPFS). Both types have their metadata stored on IPFS and operations recorded on the blockchain.File Storage Overview
Public Files
- File Storage: AWS S3 (publicly accessible)
- Metadata: JSON stored on IPFS
- Access: Can be accessed via web interface or SDK
- JSON Contains:
FileHashandFileLinkS3
Private Files
- File Storage: IPFS only (private access)
- Metadata: JSON stored on IPFS
- Access: Restricted to authorized users
- JSON Contains:
FileHashonly (noFileLinkS3)
File Status
Files can have the following statuses:- Available: File is successfully uploaded and available
- Pending: File is being processed
- PendingDeletion: File deletion is being processed
- NotarizationError: Error occurred during blockchain recording
- Deleted: File has been marked as deleted
Public Files
Upload Public File
POST /projects/{projectId}/files
Upload a new public file to a project
Parameters
projectId(path): Project ID to upload the file to
Request Body (multipart/form-data)
Response
Example
Get Project Files
GET /projects/{projectId}/files
Get all public files in a project
Parameters
projectId(path): Project ID
Response
Get Single File
GET /projects/{projectId}/files/{fileId}
Get information about a specific file
Parameters
projectId(path): Project IDfileId(path): File ID
Response
Download File
GET /projects/{projectId}/files/{fileId}/download
Get a pre-signed URL to download a file
Parameters
projectId(path): Project IDfileId(path): File ID
Response
Delete File
PATCH /projects/{projectId}/file/{fileId}/delete
Mark a file as deleted
Parameters
projectId(path): Project IDfileId(path): File ID
Request Body
Response
Get File Certificate
GET /projects/{projectId}/files/{fileId}/download/certificate
Download a blockchain certificate for a file
Parameters
projectId(path): Project IDfileId(path): File IDraw(query): Set totrueto get raw JSON data instead of PDF
Response
Returns a PDF certificate or JSON data ifraw=true
Get File IPFS Content
GET /projects/{projectId}/files/{fileId}/ipfs
Get the IPFS content metadata for a file
Parameters
projectId(path): Project IDfileId(path): File ID
Response
Private Files
Upload Private File
POST /private-files/project/{projectId}
Upload a new private file to a project
Parameters
projectId(path): Project ID to upload the file to
Request Body (multipart/form-data)
Response
Get Private Project Files
GET /private-files/project/{projectId}
Get all private files in a project
Parameters
projectId(path): Project ID
Response
Delete Private File
PATCH /private-files/project/{projectId}/file/{fileId}/delete
Mark a private file as deleted
Parameters
projectId(path): Project IDfileId(path): File ID
Request Body
Response
Get Private File Certificate
GET /private-files/project/{projectId}/files/{fileId}/download/certificate
Download a blockchain certificate for a private file
Parameters
projectId(path): Project IDfileId(path): File IDraw(query): Set totrueto get raw JSON data instead of PDF
Response
Returns a PDF certificate or JSON data ifraw=true
Get Private File IPFS Content
GET /private-files/project/{projectId}/files/{fileId}/ipfs
Get the IPFS content metadata for a private file
Parameters
projectId(path): Project IDfileId(path): File ID
Response
File Verification
Verify File Existence
POST /projects/files/verify
Check if a file with the same content already exists in the platform
Request Body (multipart/form-data)
Response
File Types
Primary Files
Primary files are original research data or documents:- Independent files that don’t reference other files
- Can be referenced by secondary files
- Required fields:
file,type,label,uploaded
Secondary Files
Secondary files are derived from or reference primary files:- Must reference one or more primary files
- Required additional fields:
linkToProcedure,procedureDescription,primaryData - Used for analysis results, reports, or derived data
Blockchain Integration
All file operations are recorded on the Algorand blockchain:- Upload: Records file hash and metadata on blockchain
- Download: Verifiable through blockchain transaction
- Delete: Marks file as deleted while preserving history
- Certificate: Provides cryptographic proof of file authenticity
Error Responses
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
413 Payload Too Large
File Size Limits
- Maximum file size: 2.5 GB
- Recommended size: Under 100 MB for optimal performance
- Supported formats: All file types supported
- Concurrent uploads: Multiple files can be uploaded simultaneously
