Skip to content

API Overview

The Medtwin API allows you to integrate our research platform into your workflows.

Base URL

https://api.medtwin.ai/v1

Authentication

All API requests require authentication. See Authentication for details.

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.medtwin.ai/v1/projects

Rate Limits

Plan Requests/min Requests/day
Starter 60 1,000
Professional 300 10,000
Enterprise Custom Custom

See Rate Limits for details.

Endpoints

Projects

Method Endpoint Description
GET /projects List all projects
POST /projects Create a project
GET /projects/{id} Get project details
PATCH /projects/{id} Update project
DELETE /projects/{id} Delete project

Patients

Method Endpoint Description
GET /projects/{id}/patients List patients
POST /projects/{id}/patients Add patients
GET /patients/{id} Get patient details

Analysis

Method Endpoint Description
GET /projects/{id}/analyses List analyses
POST /projects/{id}/analyses Create analysis
GET /analyses/{id} Get analysis results
POST /analyses/{id}/run Execute analysis

Literature

Method Endpoint Description
GET /literature/search Search papers
GET /literature/{id} Get paper details

Export

Method Endpoint Description
POST /projects/{id}/export Export project
POST /analyses/{id}/export Export analysis

Response Format

All responses are JSON:

{
  "success": true,
  "data": { ... },
  "meta": {
    "timestamp": "2026-01-29T12:00:00Z",
    "request_id": "req_abc123"
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Project ID is required",
    "details": { ... }
  }
}

SDKs

Official SDKs available:

  • Python: pip install medtwin
  • JavaScript: npm install @medtwin/sdk

Python Example

from medtwin import Client

client = Client(api_key="your-api-key")

# List projects
projects = client.projects.list()

# Get analysis results
results = client.analyses.get("analysis-id")

JavaScript Example

import { Medtwin } from '@medtwin/sdk';

const client = new Medtwin({ apiKey: 'your-api-key' });

// List projects
const projects = await client.projects.list();

// Get analysis results
const results = await client.analyses.get('analysis-id');

Webhooks

Receive notifications for events:

  • analysis.completed
  • export.ready
  • data.uploaded

See webhook documentation for setup.

OpenAPI Specification

Download our OpenAPI spec:

Interactive Docs

Try the API in your browser:

Getting Started

  1. Get an API key
  2. Make your first request
  3. Explore endpoints

Example Request

# Create a project
curl -X POST https://api.medtwin.ai/v1/projects \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Research Project",
    "description": "Cardiac surgery outcomes study"
  }'

Support