The automation/cases namespace provides API methods for retrieving automation cases for a Testmo project.
GET /projects/{project_id}/automation/cases
Returns a list of automation cases for the specified project.
This method uses pagination so you might need to request additional pages to retrieve all results.
project_id id required
ID of the project.
Request
page integer
Number of page to return (default: first page).
per_page integer
Maximum number of cases to return (supported: 15, 25, 50, 100; default: 100).
order string
Sort order (ascending or descending) (supported: asc, desc; default: asc).
sort string
Sort field for the list of automation cases (supported: automation_sources:created_at, automation_cases:name, automation_cases:elapsed_average, automation_cases:failure_count, automation_cases:flaky_percent; default: automation_sources:created_at).
source_id string
Comma-separated list of automation source IDs to filter by.
status string
Comma-separated list of status IDs to filter by. Use: 1 for Neutral, 2 for Success, 3 for Failure, 4 for Running.
name string
Filter results by automation case name.
folder string
Filter results by folder name.
expands string
Comma-separated list of expands to return.
"page": {
"type": "integer",
"format": "int64",
"description": "Number of page to return (default: first page)."
},
"per_page": {
"type": "integer",
"format": "int64",
"enum": [15, 25, 50, 100],
"description": "Maximum number of cases to return per page (default: 100)."
},
"order": {
"type": "string",
"enum": ["asc", "desc"],
"description": "Sort order (ascending or descending)."
},
"sort": {
"type": "string",
"enum": [
"automation_sources:created_at",
"automation_cases:name",
"automation_cases:elapsed_average",
"automation_cases:failure_count",
"automation_cases:flaky_percent"
],
"description": "Sort field for the list of automation cases."
},
"source_id": {
"type": "string",
"description": "Comma-separated list of automation source IDs to filter by."
},
"status": {
"type": "string",
"description": "Comma-separated list of status IDs to filter by. Use: 1 for Neutral, 2 for Success, 3 for Failure, 4 for Running."
},
"name": {
"type": "string",
"description": "Filter results by automation case name."
},
"folder": {
"type": "string",
"description": "Filter results by folder name."
},
"expands": {
"type": "string",
"description": "Comma-separated list of expands to return."
}
This method supports the following expands so you can automatically include additional information for referenced objects:
automation_sourcesstatuses
Response
GET /api/v1/projects/1/automation/cases
200 OK
{
"page": 1,
"prev_page": null,
"next_page": null,
"last_page": 1,
"per_page": 100,
"total": 3,
"result": [
{
"id": 1,
"project_id": 1,
"source_id": 1,
"key": "TC-001",
"name": "Login test",
"folder": "auth",
"status": 2,
"elapsed_count": 10,
"elapsed_total": 5000,
"elapsed_average": 500,
"test_count": 10,
"success_count": 9,
"failure_count": 1,
"status_count": 10,
"flaky_count": 1,
"flaky_percent": 10.0,
"created_at": "2026-01-10T09:00:00.000Z",
"updated_at": "2026-03-01T14:22:00.000Z"
},
..
]
}
Examples
// Filter by automation source
GET /api/v1/projects/1/automation/cases?source_id=1
// Filter by status (failures only)
GET /api/v1/projects/1/automation/cases?status=3
// Sort by failure count descending
GET /api/v1/projects/1/automation/cases?sort=automation_cases:failure_count&order=desc
// Include automation source details
GET /api/v1/projects/1/automation/cases?expands=automation_sources
// Paginate through results (page 2, 50 per page)
GET /api/v1/projects/1/automation/cases?page=2&per_page=50Status codes
200 401 403 404 429 (details)