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.
Authorization: Bearer your-api-key-here
curl -X GET http://localhost:8000/api/v1/status \
-H "Authorization: Bearer sk_live_abc123..." \
-H "Content-Type: application/json"
Sequences
/api/v1/sequences
List all available test sequences
{
"sequences": [
{
"id": "pcb_functional_test",
"name": "PCB Functional Test",
"version": "1.0.0",
"stepCount": 12,
"estimatedDuration": 45.5
}
]
}
/api/v1/sequences/{id}
Get details of a specific sequence
{
"id": "pcb_functional_test",
"name": "PCB Functional Test",
"version": "1.0.0",
"description": "Complete functional test",
"metadata": { ... },
"config": { ... },
"steps": [ ... ]
}
/api/v1/sequences
Upload a new sequence
{
"name": "New Test",
"content": "name: New Test\nsteps: ...",
"format": "yaml"
}
Test Execution
/api/v1/execution/start
Start a test execution
{
"sequenceId": "pcb_functional_test",
"serialNumber": "PCB-2024-0001",
"propertySet": "rev_a_limits.yaml",
"operator": "jsmith",
"variables": {
"testMode": "production"
}
}
{
"executionId": "exec_abc123",
"status": "running",
"startedAt": "2024-06-15T10:30:00Z"
}
/api/v1/execution/{id}/status
Get current execution status
{
"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
}
/api/v1/execution/{id}/abort
Abort a running test
/api/v1/execution/{id}/respond
Respond to operator prompt
{
"stepId": "verify_led",
"response": "pass"
}
Results
/api/v1/results
Query test results
sequenceId - Filter by sequenceserialNumber - Filter by serialstatus - pass, fail, abortfrom - Start date (ISO)to - End date (ISO)limit - Max results{
"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
}
/api/v1/results/{id}
Get detailed result with step measurements
{
"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
/api/v1/hardware
List connected hardware devices
{
"devices": [
{
"id": "main_dmm",
"driver": "keysight_34461a",
"status": "connected",
"serial": "MY54321",
"capabilities": ["measure_dc_voltage", ...]
}
]
}
/api/v1/hardware/{id}/command
Send command to device
{
"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
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.