Skip to main content
Version: 3.0.0

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, except GET /health and POST /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-device marks a route that can move an instrument, and x-long-poll marks 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.

StatusCodes you will meet most
400confirmation_required, rebuild_failed, package_load_failed
401auth_error
404<thing>_not_found, such as device_not_found, execution_not_found or teachpoint_not_found; route_not_found for an unknown path
409device_locked, devices_not_ready, other_run_mode_active, active_executions_exist, slot_occupied, device_interface_mismatch, device_under_external_control
422validation_error for any body or value the route refuses, sim_speedup_not_applicable, device_has_no_real_driver
502command_error, with extras.driver_error_type
503device_offline, runtime_not_ready

A device error raised inside any route is sent with its own code, never as a 500.

Routes by job​

JobRoutes
Run a workflowPOST /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 stoppedGET /api/runtime/status (the blockers list), GET /api/incidents, GET /api/unsettled
Rebuild from the packagePOST /api/runtime/reload
DevicesGET /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 commandPOST /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
DeckGET /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 runsGET /api/executions/{execution_id}/check-run-labware
Teachpoints/api/teachpoints/{device_id}, POST /api/teachpoints/{device_id}/capture
Profiles/api/profiles
RecordsGET /api/ops-history, GET /api/events, GET /api/interventions/next
Live eventsWS /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.

See also​