API Reference (Leader /api)
Conventions
- Only the leader Pioreactor has the
/apiendpoints exposed. - Async endpoints return
202 Acceptedwith atask_idandresult_url_path. - Poll
GET /unit_api/task_results/{task_id}untilstatusiscompleteorfailed. $broadcastmay be used in path parameters where documented to target all units/workers.- File download endpoints return binary bodies; use the response content-type to handle them.
- Path parameters are shown inline in the endpoint URL.
- Request/response examples are the canonical shapes; omit optional fields you do not need.
- Errors have the following schema:
{
"error": "Human-readable error message",
"error_info": {
"cause": "Human-readable cause (defaults to error if not set)",
"remediation": "Suggested fix or next step",
"status": integer,
}
}
Use /api/workers/... for worker-only targets (experiment-scoped jobs/logs) and /api/units/... when the leader is also a valid target; both accept $broadcast where supported.
Get Models
Returns the list of supported Pioreactor models.
Endpoint
GET /api/models
Response
Success
Status: 200 OK
{
"models": [
{
"model_name": "pioreactor_20ml",
"model_version": "1.5",
"display_name": "Pioreactor 20 mL"
}
]
}
Stop All Jobs On Worker For Experiment
Stops all jobs for a worker within an experiment.
Endpoint
POST /api/workers/{pioreactor_unit}/jobs/stop/experiments/{experiment}
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| pioreactor_unit | string | Yes | Worker unit name or $broadcast. |
| experiment | string | Yes | Experiment identifier. |
Response
Success
Status: 202 Accepted
{
"status": "success"
}
Stop Specific Job On Unit
Stops a specific job on a unit within an experiment.
Endpoint
POST /api/units/{pioreactor_unit}/jobs/stop/job_name/{job_name}/experiments/{experiment}
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| pioreactor_unit | string | Yes | Unit name. |
| job_name | string | Yes | Job name to stop. |
| experiment | string | Yes | Experiment identifier. |
Response
Success
Status: 202 Accepted
{
"status": "success"
}
Run Job On Unit In Experiment
Runs a job on one or more units assigned to an experiment.
Endpoint
POST /api/units/{pioreactor_unit}/jobs/run/job_name/{job_name}/experiments/{experiment}
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| pioreactor_unit | string | Yes | Unit name or $broadcast. |
| job_name | string | Yes | Job name to run. |
| experiment | string | Yes | Experiment identifier or universal. |
Request Body
{
"options": {
"target_rpm": "200"
},
"env": {
"JOB_SOURCE": "user"
},
"args": ["--some-flag"],
"config_overrides": [["stirring.config", "pwm_hz", "100"]]
}
Response
Success
Status: 202 Accepted
{
"unit": "leader",
"task_id": "task_abc123",
"result_url_path": "/unit_api/task_results/task_abc123"
}