REST API
Every orca CLI verb calls one REST route. A program can call the same routes.
Where it is
The daemon listens on http://127.0.0.1:<port>. orca start prints the port, and orca start --port 8765 fixes it. The daemon answers only connections from the same computer.
The full list of routes, with every request and response model, is at http://127.0.0.1:<port>/docs.
Route rules
- Every route is under
/api, exceptGET /healthandPOST /shutdown. - Paths are plural and kebab-case:
/api/labware-instances/{labware_id}/journey. - A read is a
GET. A path names a device{device_id}, which is the device's name. - One route answers one question. There are no aliases.
- In the OpenAPI document,
x-drives-devicemarks a route that can move an instrument, andx-long-pollmarks a route that waits for an answer. Do not put a short timeout on either.
Errors
Every error has one shape:
{"detail": {"code": "device_offline", "message": "...", "extras": {"device_id": "shaker"}}}
code is lower-case, and each code is always sent with the same HTTP status. extras carries the fields that code documents, or is null. The CLI prints an error as code: message.
| Status | Codes you will meet most |
|---|---|
| 400 | confirmation_required, rebuild_failed, package_load_failed |
| 401 | auth_error |
| 404 | <thing>_not_found, such as device_not_found, execution_not_found or teachpoint_not_found; route_not_found for an unknown path |
| 409 | device_locked, devices_not_ready, other_run_mode_active, active_executions_exist, slot_occupied, device_interface_mismatch, device_under_external_control |
| 422 | validation_error for any body or value the route refuses, sim_speedup_not_applicable, device_has_no_real_driver |
| 502 | command_error, with extras.driver_error_type |
| 503 | device_offline, runtime_not_ready |
A device error raised inside any route is sent with its own code, never as a 500.
Routes by job
| Job | Routes |
|---|---|
| Run a workflow | POST /api/executions, GET /api/executions/{execution_id}, POST /api/executions/{execution_id}/stop, POST /api/executions/{execution_id}/close, POST /api/executions/{execution_id}/threads/{thread_id}/recover |
| Why it stopped | GET /api/runtime/status (the blockers list), GET /api/incidents, GET /api/unsettled |
| Rebuild from the package | POST /api/runtime/reload |
| Devices | GET /api/devices, GET /api/devices/{device_id}, GET /api/devices/{device_id}/introspection, GET and PUT /api/devices/{device_id}/setup, PUT /api/devices/{device_id}/mode |
| Send a device command | POST /api/devices/{device_id}/commands for any command by name; one typed route per command, such as /api/transporters/{device_id}/pick-plate or /api/liquid-handlers/{device_id}/aspirate |
| Deck | GET /api/liquid-handlers/{device_id}/deck-comparison, PUT /api/deck-layouts/{device_id}/{name} |
| Labware | /api/labware-instances/..., /api/labware-catalog/..., GET /api/labware-barcodes/{barcode}, POST /api/workflows/{workflow_name}/load-run-labware |
| Check runs | GET /api/executions/{execution_id}/check-run-labware |
| Teachpoints | /api/teachpoints/{device_id}, POST /api/teachpoints/{device_id}/capture |
| Profiles | /api/profiles |
| Records | GET /api/ops-history, GET /api/events, GET /api/interventions/next |
| Live events | WS /ws/events |
connect, initialize and disconnect cannot be sent through /commands. The refusal names the route and CLI verb to use in extras.send_with.