Skip to content

API Endpoint Reference

Interactive Documentation

For detailed request/response schemas, use the interactive API docs:


Admin Service

Base URL: https://admin.flow.labpgx.com/api/v1

Organizations

Method Endpoint Description
GET /orgs List organizations

Projects

Method Endpoint Description
GET /projects List all projects
GET /projects/{id} Get project details
GET /projects/{id}/credentials Get project credentials (for file service)

Users

Method Endpoint Description
GET /users/me/default-context Get user's default project
PUT /users/me/default-context Set user's default project

Compute Service

Base URL: https://compute.flow.labpgx.com/api/v1

Pipelines

Method Endpoint Description
GET /pipelines List all pipelines
POST /pipelines Create new pipeline
GET /pipelines/{id} Get pipeline by ID
GET /pipelines/slug/{slug} Get pipeline by slug (latest version)
GET /pipelines/slug/{slug}?version=1.0.0 Get specific version
GET /pipelines/slug/{slug}/versions List all versions

Runs

Method Endpoint Description
GET /runs List runs for project
POST /runs Submit new run
GET /runs/{id} Get run details
GET /runs/{id}/outputs Get run output files
DELETE /runs/{id} Cancel run
GET /runs/by-order/{order_id} List runs for an order

Miner Service

Base URL: https://miner.flow.labpgx.com/api/v1

Subjects

Method Endpoint Description
GET /subjects List subjects
POST /subjects Create subject
GET /subjects/{id} Get subject details
PATCH /subjects/{id} Update subject
DELETE /subjects/{id} Delete subject (cascades to samples)

Samples

Method Endpoint Description
GET /samples List samples
POST /samples Create sample
GET /samples/{id} Get sample details
PATCH /samples/{id} Update sample
DELETE /samples/{id} Delete sample
GET /samples/{id}/sampleinfo Generate pipeline-ready JSON

Orders

Method Endpoint Description
GET /orders List orders
POST /orders Create order
GET /orders/{id} Get order details
PUT /orders/{id} Update order
DELETE /orders/{id} Delete order
POST /orders/{id}/transition Transition order status
GET /orders/{id}/samplesheet Generate nf-core samplesheet CSV
GET /orders/{id}/samples List samples in order
POST /orders/{id}/samples Add sample to order
DELETE /orders/{id}/samples/{sample_id} Remove sample from order

Files Service

Base URL: https://files.flow.labpgx.com/api/v1

Files

Method Endpoint Description
GET /files?project_id=ID&path=/ List files in path
GET /files/download-url?project_id=ID&path=file.txt Get signed download URL
POST /files/upload-url?project_id=ID Get signed upload URL
POST /files/copy?project_id=ID Copy file within bucket
POST /files/move?project_id=ID Move/rename file within bucket
DELETE /files?project_id=ID&path=file.txt Delete file

File Download (Two-Step)

Downloading a file is a two-step process: first get a signed URL, then download from it.

# Step 1: Get signed download URL (valid 15 minutes)
curl -s "https://files.iflow.intelliseq.com/api/v1/files/download-url?project_id=$PROJECT_ID&path=client-resources/report_template.docx" \
  -H "Authorization: Bearer $TOKEN" | jq .

# Response:
# {"url": "https://storage.googleapis.com/bucket/...", "expires_in_seconds": 900}

# Step 2: Download file from signed URL (no auth needed)
SIGNED_URL=$(curl -s "https://files.iflow.intelliseq.com/api/v1/files/download-url?project_id=$PROJECT_ID&path=client-resources/report_template.docx" \
  -H "Authorization: Bearer $TOKEN" | jq -r .url)
curl -o report_template.docx "$SIGNED_URL"

File Upload (Two-Step)

Uploading is also two-step: get a signed URL, then PUT the file.

# Step 1: Get signed upload URL
curl -s -X POST "https://files.iflow.intelliseq.com/api/v1/files/upload-url?project_id=$PROJECT_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"path": "samples/S1/uploads/sample.vcf.gz", "content_type": "application/gzip"}' | jq .

# Response:
# {"url": "https://storage.googleapis.com/bucket/...", "expires_in_seconds": 900}

# Step 2: Upload file to signed URL (no auth needed)
curl -X PUT "$SIGNED_URL" \
  -H "Content-Type: application/gzip" \
  --data-binary @sample.vcf.gz

List Files

curl -s "https://files.iflow.intelliseq.com/api/v1/files?project_id=$PROJECT_ID&path=client-resources/" \
  -H "Authorization: Bearer $TOKEN" | jq .

Common Headers

All API requests require:

Authorization: Bearer <access_token>
Content-Type: application/json

Project-scoped endpoints (miner, compute, files) also require:

X-Project-ID: <project_uuid>

X-Project-ID is the UUID of your project, obtained from GET /api/v1/projects on admin-service. Admin-service endpoints do not require this header. See Authentication for details.

Error Responses

Status Description
400 Bad request - invalid parameters
401 Unauthorized - missing or invalid token
403 Forbidden - insufficient permissions
404 Not found - resource doesn't exist
409 Conflict - resource already exists
500 Server error

Example error response:

{
  "detail": "Pipeline 'hereditary-mock' version '1.0.0' already exists. Use force=True to overwrite."
}