API Reference
CAR exposes a RESTful API built with Django REST Framework. All
endpoints return JSON and live under the /api/ prefix.
Base URL
http://127.0.0.1:8000/api/
The DRF browsable API is accessible from a web browser at the same URL.
Core Resources
These endpoints follow standard REST conventions (GET, POST,
PUT, PATCH, DELETE).
Endpoint |
ViewSet |
Description |
|---|---|---|
|
|
Synthesis projects |
|
|
Compound batches (filter: |
|
|
Target molecules (filter: |
|
|
Retrosynthetic methods (filter: |
|
|
Reaction steps (filter: |
|
|
Reaction products (filter: |
|
|
Reactants (filter: |
|
|
Vendor catalog entries |
|
|
PubChem compound data |
Action Resources
Endpoint |
ViewSet |
Description |
|---|---|---|
|
|
Action session groups (filter: |
|
|
Liquid-handling add steps |
|
|
Liquid-liquid extraction steps |
|
|
Pipette mixing steps |
|
|
Stir / incubation steps |
OT Resources
Endpoint |
ViewSet |
Description |
|---|---|---|
|
|
OT project containers |
|
|
Batch protocols (.zip) (filter: |
|
|
Individual sessions (filter: |
|
|
Deck models |
|
|
Pipette models |
|
|
Tip rack models |
|
|
Plate models (filter: |
|
|
Plate columns |
|
|
Individual wells |
|
|
Compound ordering CSVs |
|
|
Generated OT Python scripts |
Custom Actions
createproject
POST /api/projects/createproject/
Create a new project from a CSV upload.
Request (multipart/form-data):
project_name— project namecsv_file— CSV withtargets,amount-required-mg,batch-tagcolumns
Response: { "taskid": "<celery-task-id>" }
gettaskstatus (Project)
GET /api/projects/gettaskstatus/?taskid=<id>
Poll the Celery task status for project creation.
Response: { "state": "PENDING|STARTED|SUCCESS|FAILURE", ... }
createotproject
POST /api/otprojects/createotproject/
Create OT protocols for selected batches.
Request (multipart/form-data):
protocol_name— human-readable labelbatch_ids— JSON array of batch IDsuse_multichannel— boolean (defaultfalse)custom_sm_files(optional) — custom starting-material CSVs
Response: { "taskid": "<celery-task-id>" }
canonicalizesmiles
POST /api/batches/<id>/canonicalizesmiles/
Canonicalize a list of SMILES strings or a CSV.
updatereactionsuccess
POST /api/batches/<id>/updatereactionsuccess/
Mark reactions as failed/unsuccessful.
Nested Serialisation (fetchall)
Append ?fetchall=yes to any core resource endpoint to get a deeply
nested response with all child objects inlined:
GET /api/projects/<id>/?fetchall=yes
Returns the project with all batches, targets, methods, reactions, products, reactants, and catalog entries fully expanded.
Warning
fetchall responses can be very large for projects with many
targets. Use filtering when you only need a subset.
Filtering
All ViewSets that support filtering use django_filters. Pass
filter values as query parameters:
GET /api/targets/?batch_id=42
GET /api/methods/?target_id=7&nosteps=2
GET /api/reactions/?method_id=15