Skip to main content

API Reference

The LabTrace API provides programmatic access to all platform functionality, enabling developers to integrate blockchain-powered file management into their applications.

Base URL

All API requests are made to:
https://api.labtrace.io

Authentication

Login

Login to the LabTrace API /login to get a JWT token

JWT Tokens

All API requests require a valid JWT token in the Authorization header

Authentication Example

curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  https://api.labtrace.io/projects

API Endpoints

Core Resources

The complete API reference is available at:
https://api.labtrace.io/docs
The core resources are:

Authentication

User login, registration, and token management

Files

Upload, download, and manage files with blockchain verification

Projects

Create and manage projects, handle user invitations

Users

User management, profiles, and blockchain addresses

Request Format

All requests use JSON format with appropriate HTTP methods:
  • GET: Retrieve data
  • POST: Create new resources
  • PUT: Update existing resources
  • DELETE: Remove resources

Example Request

POST /api/v1/files
Content-Type: application/json
Authorization: Bearer YOUR_JWT_TOKEN

{
  "project_id": "proj_123456",
  "file_name": "research-data.pdf",
  "file_data": "base64_encoded_file_content",
  "tags": ["research", "data"]
}

Response Format

All responses are JSON objects with consistent structure:
{
  "success": true,
  "data": {
    "file_id": "file_789012",
    "cid": "bafybeihdwdcefgh4dqkjv67uzcmw7o...",
    "blockchain_tx": "ABC123...",
    "status": "uploaded"
  },
  "message": "File uploaded successfully"
}

Error Handling

  • 200: Success
  • 201: Created
  • 400: Bad Request
  • 401: Unauthorized
  • 403: Forbidden
  • 404: Not Found
  • 500: Internal Server Error
{
  "success": false,
  "error": {
    "code": "INVALID_FILE_TYPE",
    "message": "File type not supported",
    "details": "Only PDF, DOCX, and image files are allowed"
  }
}

SDKs and Libraries

Python SDK

Official Python SDK for data science and backend integration

Blockchain Integration

All API operations that modify data are automatically recorded on the blockchain:
  • File operations: Upload, download, delete
  • Project operations: Create, invite users, remove access
  • User operations: Registration, profile updates

Getting Started

1

Get API Access

Register for a LabTrace account and generate an API key********
2

Install SDK

Install the official SDK for your preferred language
3

Authenticate

Use your API key to authenticate requests
4

Make Your First Request

Try creating a project or uploading a file

Support

  • Documentation: Comprehensive API documentation with examples
  • SDKs: Official SDKs for popular programming languages
  • Community: Join our developer community for support and discussions
  • Enterprise: Priority support available for enterprise customers