Test Cases
Test cases are the core data model in QA Hub. Each has a unique code, Gherkin BDD content, and metadata.
Endpoints
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /api/v1/cases | read | List test cases |
POST | /api/v1/cases | write | Create a test case |
GET | /api/v1/cases/{id} | read | Get a single test case |
PATCH | /api/v1/cases/{id} | write | Update a test case |
DELETE | /api/v1/cases/{id} | write | Delete a test case |
The {id} parameter accepts either the cuid (clxyz...) or the human-readable code (TC-001).
List test cases
GET /api/v1/cases?project_id=clxyz123&status=READY&limit=50&offset=0
Authorization: Bearer qh_...
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
project_id | string | — | Filter by project |
status | string | — | DRAFT, READY, or DEPRECATED |
limit | integer | 100 | Max records (max 500) |
offset | integer | 0 | Pagination offset |
Response
{
"data": [
{
"id": "clcase001",
"code": "TC-001",
"title": "Guest checkout — successful order",
"bdd_content": "Feature: Guest checkout\n\n Scenario: ...",
"status": "READY",
"priority": "HIGH",
"layer": "UI",
"is_e2e": true,
"automation_status": "MANUAL",
"tags": ["checkout", "guest"],
"tickets": [{ "key": "PROJ-42", "source": "JIRA" }]
}
],
"pagination": { "total": 148, "limit": 50, "offset": 0 }
}
Create a test case
POST /api/v1/cases
Authorization: Bearer qh_...
Content-Type: application/json
{
"title": "Login — invalid password shows error",
"bdd_content": "Feature: Login\n\n Scenario: Invalid password\n Given the user is on the login page\n When they enter an incorrect password\n Then an error message is displayed",
"project_id": "clxyz123",
"status": "DRAFT",
"priority": "HIGH",
"layer": "UI",
"is_e2e": false,
"tags": ["auth", "login"],
"tickets": [{ "key": "PROJ-10", "source": "JIRA" }]
}
Required fields: title, bdd_content
Update a test case
PATCH /api/v1/cases/TC-001
Authorization: Bearer qh_...
Content-Type: application/json
{
"status": "READY",
"automation_status": "AUTOMATED"
}
Only include the fields you want to change. All fields are optional in a PATCH request.
Automation status values
| Value | Meaning |
|---|---|
MANUAL | Executed manually only |
IN_PROGRESS | Automation is being written |
AUTOMATED | Has a passing automated test |
FLAKY | Automated but unstable |
ARCHIVED | No longer maintained |