light-run

HTTP API

Routes for runs, artifacts and networks.

When a token is configured, every route except /health requires Authorization: Bearer <token>. The full request/response types are in the API reference.

Health

MethodPathDescription
GET/healthLiveness + a real Docker daemon check. 503 when the daemon is down.

Runs

MethodPathDescription
POST/runRun a container. Returns a RunState; with detached: true, returns 202 { id }.
GET/runsList tracked runs.
GET/runs/:idGet a run's state (status, exit code, logs, artifacts).
POST/runs/:id/cancelCancel a run.
POST/runs/:id/stopGraceful stop (SIGTERM then SIGKILL after a grace period).
POST/runs/:id/pausePause a running container.
POST/runs/:id/resumeResume a paused container.
DELETE/runs/:idRemove a finished run and its artifacts.

POST /run body

FieldTypeNotes
imagestringDocker image (required).
entrypointstringCommand, run via sh -c.
filesobject{ relativePath: contents }; at least one, no absolute paths, no ...
extractstring[]Container paths to capture as artifacts.
runstring[]Build-time setup steps (cached image layer). Operator-trusted.
timeoutnumberMilliseconds before the container is killed.
networksstring[]Docker networks; first is primary, rest connected after create. Must pre-exist.
envobject{ NAME: value } injected into the container.
workdirstringContainer working directory.
detachedbooleanReturn 202 { id } and run in the background.
callbackUrl / callbackSecretstringPOST the final state to a URL, optionally HMAC-signed.

Artifacts

MethodPathDescription
GET/runs/:id/artifactsList a run's artifacts.
GET/runs/:id/artifacts/*Download a file, or list a subdirectory. Literal .. is rejected; the resolved path must stay inside the run's artifact dir.

Networks

For a remote orchestrator (e.g. light-process) that has no shell access to the host.

MethodPathDescription
POST/networksCreate a Docker network.
GET/networks/:nameWhether a network exists.
DELETE/networks/:nameDelete a network (409 if it still has active endpoints).
POST/networks/cleanupSweep orphan networks by prefix and age.

On this page