REST API Reference

Complete API documentation for programmatic control of SeqMaster

Overview

SeqMaster provides a comprehensive REST API for automation and integration. The API runs on port 8000 by default and supports JSON request/response bodies.

Base URL

http://localhost:8000/api/v1

Request Format

  • • Content-Type: application/json
  • • UTF-8 encoding
  • • Camelcase keys

Response Format

  • • JSON response body
  • • Standard HTTP status codes
  • • Error details in response

Authentication

API authentication uses API keys passed in the header. Generate keys from the Settings page.

Request Header
Authorization: Bearer your-api-key-here
Example with curl
curl -X GET http://localhost:8000/api/v1/status \
  -H "Authorization: Bearer sk_live_abc123..." \
  -H "Content-Type: application/json"

Sequences

GET /api/v1/sequences

List all available test sequences

Response
{
  "sequences": [
    {
      "id": "pcb_functional_test",
      "name": "PCB Functional Test",
      "version": "1.0.0",
      "stepCount": 12,
      "estimatedDuration": 45.5
    }
  ]
}
GET /api/v1/sequences/{id}

Get details of a specific sequence

Response
{
  "id": "pcb_functional_test",
  "name": "PCB Functional Test",
  "version": "1.0.0",
  "description": "Complete functional test",
  "metadata": { ... },
  "config": { ... },
  "steps": [ ... ]
}
POST /api/v1/sequences

Upload a new sequence

Request Body
{
  "name": "New Test",
  "content": "name: New Test\nsteps: ...",
  "format": "yaml"
}

Test Execution

POST /api/v1/execution/start

Start a test execution

Request Body
{
  "sequenceId": "pcb_functional_test",
  "serialNumber": "PCB-2024-0001",
  "propertySet": "rev_a_limits.yaml",
  "operator": "jsmith",
  "variables": {
    "testMode": "production"
  }
}
Response
{
  "executionId": "exec_abc123",
  "status": "running",
  "startedAt": "2024-06-15T10:30:00Z"
}
GET /api/v1/execution/{id}/status

Get current execution status

Response
{
  "executionId": "exec_abc123",
  "status": "running",
  "currentStep": {
    "id": "measure_vcc",
    "name": "Measure VCC",
    "index": 3
  },
  "progress": {
    "completed": 2,
    "total": 12,
    "passed": 2,
    "failed": 0
  },
  "elapsedTime": 5.2
}
POST /api/v1/execution/{id}/abort

Abort a running test

POST /api/v1/execution/{id}/respond

Respond to operator prompt

Request Body
{
  "stepId": "verify_led",
  "response": "pass"
}

Results

GET /api/v1/results

Query test results

Query Parameters
sequenceId - Filter by sequence
serialNumber - Filter by serial
status - pass, fail, abort
from - Start date (ISO)
to - End date (ISO)
limit - Max results
Response
{
  "results": [
    {
      "id": "result_xyz789",
      "sequenceId": "pcb_functional_test",
      "serialNumber": "PCB-2024-0001",
      "status": "pass",
      "startedAt": "2024-06-15T10:30:00Z",
      "completedAt": "2024-06-15T10:30:45Z",
      "duration": 45.2,
      "operator": "jsmith"
    }
  ],
  "total": 1247,
  "page": 1
}
GET /api/v1/results/{id}

Get detailed result with step measurements

Response
{
  "id": "result_xyz789",
  ...
  "steps": [
    {
      "id": "measure_vcc",
      "name": "Measure VCC",
      "status": "pass",
      "value": 5.02,
      "unit": "V",
      "limits": {
        "low": 4.8,
        "high": 5.2
      },
      "duration": 1.2
    }
  ]
}

Hardware

GET /api/v1/hardware

List connected hardware devices

{
  "devices": [
    {
      "id": "main_dmm",
      "driver": "keysight_34461a",
      "status": "connected",
      "serial": "MY54321",
      "capabilities": ["measure_dc_voltage", ...]
    }
  ]
}
POST /api/v1/hardware/{id}/command

Send command to device

Request Body
{
  "action": "measure_dc_voltage",
  "params": {
    "range": 10
  }
}

WebSocket Events

Real-time updates are available via WebSocket connection at ws://localhost:8000/ws

Event Types

execution.started Test execution has started
execution.step.started Step execution started
execution.step.completed Step completed with result
execution.prompt Waiting for operator input
execution.completed Test execution completed
hardware.connected Device connected
hardware.disconnected Device disconnected
JavaScript Example
const ws = new WebSocket('ws://localhost:8000/ws');

ws.onopen = () => {
  console.log('Connected to SeqMaster');
  
  // Subscribe to execution events
  ws.send(JSON.stringify({
    type: 'subscribe',
    channel: 'execution'
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  
  switch (data.type) {
    case 'execution.step.completed':
      console.log(`Step ${data.step.name}: ${data.step.status}`);
      break;
    case 'execution.prompt':
      // Show prompt to operator
      showPrompt(data.prompt);
      break;
  }
};

API Playground

Interactive API documentation is available at /api/docs when SeqMaster is running.

Open API Docs →