Skip to main content
The jobs endpoints let you submit new workflows, track running jobs, retrieve detailed state and event history, and cancel jobs that are in progress. Every job is identified by a unique job_id returned at submission time.

Submit a job

The request body must be a fully resolved JSON manifest — the same structure you would put in a manifest.json file. MirrorNeuron validates the manifest before creating the job.
POST /api/v1/jobs
Provide a JSON manifest in the request body. On success, MirrorNeuron immediately returns a job_id and an initial status of pending.

Request body

manifest_version
string
required
Manifest schema version. Use "1.0".
graph_id
string
required
Unique identifier for the workflow graph. Used as a prefix in the generated job_id.
entrypoints
string[]
required
List of node_id values that receive the initial message when the job starts.
nodes
object[]
required
Array of agent node definitions that make up the workflow graph.

Example request

curl -X POST http://localhost:4000/api/v1/jobs \
  -H "Content-Type: application/json" \
  -d '{
    "manifest_version": "1.0",
    "graph_id": "simple",
    "entrypoints": ["router"],
    "nodes": [
      {
        "node_id": "router",
        "agent_type": "router",
        "role": "root_coordinator"
      }
    ]
  }'

Response

201 Created
id
string
required
The generated job ID. Formatted as {graph_id}-{unique_suffix}.
status
string
required
Initial job status. Always "pending" immediately after submission.
{
  "id": "simple-12345...",
  "status": "pending"
}
400 Bad Request — returned when the JSON body is missing, empty, or contains an invalid manifest.
{
  "error": "Invalid or missing JSON payload"
}

List jobs

GET /api/v1/jobs
Returns a paginated list of job summaries. By default, all jobs including terminal states are returned. Use query parameters to filter the results.

Query parameters

limit
number
Maximum number of jobs to return. Omit to return all jobs.
include_terminal
boolean
default:"true"
When set to false, completed, failed, and cancelled jobs are excluded from the response.

Example request

curl -s "http://localhost:4000/api/v1/jobs?limit=5"

Response

200 OK
data
object[]
required
Array of job summary objects.
{
  "data": [
    {
      "job_id": "prime_sweep_40_workers-...",
      "graph_id": "prime_sweep_40_workers",
      "status": "completed",
      "submitted_at": "2026-03-28T11:00:00.000Z",
      "updated_at": "2026-03-28T11:00:12.000Z"
    }
  ]
}

Get job details

GET /api/v1/jobs/:job_id
Returns the full monitor detail view for a single job, including the job record, a summary, all agent snapshots, recent events, and sandbox state.

Path parameters

job_id
string
required
The job ID returned when the job was submitted.

Example request

curl -s http://localhost:4000/api/v1/jobs/prime_sweep_40_workers-...

Response

200 OK
job
object
required
The persisted job record.
summary
object
Aggregated runtime summary for the job (executor counts, active nodes, sandbox names, last event).
agents
object[]
Array of agent snapshot objects for all agents in this job.
recent_events
object[]
The most recent events for this job (up to 25 by default).
sandboxes
object[]
Active sandbox container records associated with this job.
404 Not Found — returned when the job ID does not exist or is not visible in the connected cluster.
{
  "error": "Job prime_sweep_40_workers-... was not found"
}

Cancel a job

POST /api/v1/jobs/:job_id/cancel
Sends a cancellation signal to a running job. The job transitions to cancelled status.

Path parameters

job_id
string
required
The ID of the job to cancel.

Example request

curl -X POST http://localhost:4000/api/v1/jobs/prime_sweep_40_workers-.../cancel

Response

200 OK
status
string
required
Confirmation status. Always "cancelled" on success.
job_id
string
required
The ID of the cancelled job.
{
  "status": "cancelled",
  "job_id": "prime_sweep_40_workers-..."
}
404 Not Found — returned when the job ID does not exist.
{
  "error": "Job prime_sweep_40_workers-... was not found"
}

Get job events

GET /api/v1/jobs/:job_id/events
Returns the full Redis-backed event history for a job. Events are appended in order as the runtime processes messages, completes sandboxes, and transitions job state.

Path parameters

job_id
string
required
The ID of the job whose events you want to retrieve.

Example request

curl -s http://localhost:4000/api/v1/jobs/prime_sweep_40_workers-.../events

Response

200 OK
data
object[]
required
Array of event objects in chronological order.
{
  "data": [
    {
      "timestamp": "2026-03-28T11:00:04.000Z",
      "type": "sandbox_job_completed",
      "agent_id": "prime_worker_0001",
      "payload": {
        "sandbox_name": "mirror-neuron-job-...",
        "exit_code": 0,
        "pool": "default"
      }
    }
  ]
}
404 Not Found — returned when the job ID does not exist.
{
  "error": "Job prime_sweep_40_workers-... was not found"
}