Get run
Retrieve a single test run by its ID. Returns comprehensive run data including metadata, phases, measurements, and logs.
API v2 Preview
The TofuPilot API v2.0 is currently in public preview and is subject to change as we stabilize until release (planned for Oct 2025).
Access
| API Key | Access Level | Description |
|---|---|---|
| User | Full | Users have full access to runs |
| Station | Limited | Stations can only access runs for procedures they are linked to |
Endpoint
/v2/runs/{id}API key for authentication. Use format: Bearer YOUR_API_KEY
In: header
Path Parameters
ID of the run to retrieve.
uuidResponse Body
from tofupilot.v2 import TofuPilot
# Initialize the TofuPilot client
client = TofuPilot()
# Execute the operation
result = client.runs.get(
id="550e8400-e29b-41d4-a716-446655440000"
)
# Handle response
print(result){
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2024-01-15T10:30:00Z",
"started_at": "2024-01-15T10:35:00Z",
"ended_at": "2024-01-15T10:37:30Z",
"duration": "PT2M30S",
"outcome": "PASS",
"docstring": "Test run for production validation",
"created_by_user": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "John Doe",
"email": "john.doe@example.com",
"image": "https://example.com/user-avatar.jpg"
},
"created_by_station": {
"id": "550e8400-e29b-41d4-a716-446655440002",
"name": "Test Station 01",
"image": "https://example.com/station-01.jpg"
},
"operated_by": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "John Doe",
"email": "john.doe@example.com",
"image": "https://example.com/operator-avatar.jpg"
},
"procedure": {
"id": "550e8400-e29b-41d4-a716-446655440003",
"name": "PCB Functional Test",
"version": {
"id": "550e8400-e29b-41d4-a716-446655440010",
"tag": "v2.1.0"
}
},
"unit": {
"id": "550e8400-e29b-41d4-a716-446655440004",
"serial_number": "SN-2024-001234",
"part": {
"id": "550e8400-e29b-41d4-a716-446655440007",
"number": "PCB-MAIN-001",
"name": "Main Control Board",
"revision": {
"id": "550e8400-e29b-41d4-a716-446655440006",
"number": "REV-A",
"image": "https://example.com/revision-image.jpg"
}
},
"batch": {
"id": "550e8400-e29b-41d4-a716-446655440005",
"number": "BATCH-2024-Q1-001"
}
},
"phases": [
{
"id": "550e8400-e29b-41d4-a716-446655440008",
"name": "Power On Test",
"outcome": "PASS",
"started_at": "2024-01-15T10:35:00Z",
"ended_at": "2024-01-15T10:36:30Z",
"duration": "PT1M30S",
"docstring": "Verifies that the board powers on correctly and all voltage rails are within spec.",
"measurements": [
{
"id": "550e8400-e29b-41d4-a716-446655440009",
"name": "Input Voltage",
"outcome": "PASS",
"units": "V",
"validators": [
{
"outcome": "PASS",
"operator": ">=",
"expected_value": 3,
"expression": "x >= 3.0",
"is_decisive": true,
"is_expression_only": true,
"analytics_expression": "string",
"has_custom_expression": true
}
],
"aggregations": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"type": "MEAN",
"outcome": "PASS",
"value": 42.5,
"unit": "V",
"validators": [
{
"outcome": "PASS",
"operator": ">=",
"expected_value": 3,
"expression": "x >= 3.0",
"is_decisive": true,
"is_expression_only": true,
"analytics_expression": "string",
"has_custom_expression": true
}
]
}
],
"measured_value": 12.05,
"data_series": [
{
"data": [
0
],
"units": "string",
"validators": [
{
"outcome": "PASS",
"operator": ">=",
"expected_value": 3,
"expression": "x >= 3.0",
"is_decisive": true,
"is_expression_only": true,
"analytics_expression": "string",
"has_custom_expression": true
}
],
"aggregations": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"type": "MEAN",
"outcome": "PASS",
"value": 42.5,
"unit": "V",
"validators": [
{
"outcome": "PASS",
"operator": ">=",
"expected_value": 3,
"expression": "x >= 3.0",
"is_decisive": true,
"is_expression_only": true,
"analytics_expression": "string",
"has_custom_expression": true
}
]
}
]
}
]
}
]
}
],
"attachments": [
{
"id": "550e8400-e29b-41d4-a716-446655440011",
"name": "test-results.pdf",
"size": 1048576,
"content_type": "application/pdf",
"is_report": false,
"download_url": "https://s3.amazonaws.com/bucket/file?X-Amz-Algorithm=..."
}
],
"logs": [
{
"id": "string",
"level": "DEBUG",
"timestamp": "2019-08-24T14:15:22Z",
"message": "string",
"source_file": "string",
"line_number": 0
}
],
"sub_units": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"serial_number": "SN-SUB-001"
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"serial_number": "SN-SUB-002"
}
]
}{
"message": "Bad request",
"code": "BAD_REQUEST",
"issues": []
}{
"message": "Not found",
"code": "NOT_FOUND",
"issues": []
}{
"message": "Internal server error",
"code": "INTERNAL_SERVER_ERROR",
"issues": []
}How is this guide?
Create run POST
Create a new test run linking to a procedure and unit. Unit identifiers are matched case-insensitively - existing entities are reused, new ones are created automatically.
List and filter runs GET
Retrieve a paginated list of test runs with optional filtering by unit, procedure, date range, outcome, and other criteria. Supports sorting and includes run metadata.