Test Runs
How to manage test runs using the public API
The runs endpoints allow you to create and manage test executions in your project. You can create new runs, list existing runs, manage test cases within runs, and track their results. Write operations (create/update/delete) can only be performed by users with role test runner or with higher privileges.
Types of Runs
QA Sphere supports three types of test runs:
1. User Selection (Static Structure)
- Specified by
type: "static_struct" - Test cases are selected by their IDs, or for convenience by filters (folders, tags, priorities), which are resolved to test case IDs when the run is created or its selection updated (see Test Case Selection)
- Test cases in the run are fixed after creation unless manually updated
- Updates to versioned test case properties, such as title and steps, are reflected for test cases with open statuses
2. Static Runs
- Specified by
type: "static" - Test cases are selected by their IDs, or for convenience by filters (folders, tags, priorities), which are resolved to test case IDs when the run is created or its selection updated (see Test Case Selection)
- Similar to Static Structure in that test cases are fixed after creation
- Updates to versioned test case properties, such as title and steps, are not reflected in the run, even for test cases with open statuses
3. Live Runs
- Specified by
type: "live" - Only dynamic selection based on folder, tag, and priority filters
- Test cases are automatically added/removed when they match or do not match filter criteria
- Supports multiple query plans for flexible test case selection
- Updates to versioned test case properties, such as title and steps, are reflected for test cases with open statuses
- Updates to test cases are never propagated to closed runs
- For live and user selection runs, test case versions are fixed once the status is non-open. As a result, updates to versioned test case properties, such as title and steps, are not reflected in the run
- Changes to the folder and position of test cases are always propagated to all run types, except closed runs, because these changes are not versioned. This means that such updates do not create a new test case version and are applied to all existing versions of the test case
Test Case Selection
A run's test cases are chosen by its query plans. A query plan selects test cases in one of two ways, never both:
- Direct selection (by test case):
tcaseIdslists the test cases, by test case ID, sequence number or legacy ID - Selection by filters:
folderIds(test cases in these folders, subfolders included),tagIds(test cases with any of these tags) andpriorities(test cases with any of these priorities). Filters combine with AND, and a filter left out or empty doesn't narrow the selection
Which fields apply depends on the run type:
| Static and user selection runs | Live runs | |
|---|---|---|
| Query plans | One with tcaseIds, or one or more with filters, whose test cases are combined | One or more with filters, whose test cases are combined |
tcaseIds | Selects these test cases; [] selects none | Not allowed |
| A query plan with no fields | Selects no test cases | Selects every test case |
| When filters apply | Once, when the run is created or Update Run changes its selection | Continuously: test cases join and leave the run as they start or stop matching |
For static and user selection runs:
- Filters are a shortcut for listing test cases. The query plan stores the test cases they matched when applied, not the filters, so test cases that match later don't join the run. Get Run Selections returns those test cases
tcaseIdsand filters can't be combined: a query plan that sendstcaseIdswith any filter field, even an empty array, fails with400 Bad Request, and so do query plans that mix the two kinds. A filter sent empty still selects by filters, so{"folderIds": []}selects every test case
A run's query plans are also called its selections: Get Run Selections returns them, and Update Run takes them back as queryPlans.
Only standalone and filled test cases can be in a run.
List Runs
/paginated endpoints are transitional. In API v1, the base paths will return paginated responses and the /paginated suffix will be removed.
Returns all runs in a project with their current status.
Query Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
closed | boolean | Filter by run status. | No filter | closed=true |
milestoneIds | number | Filter by milestone ID; 0 matches runs without a milestone. Repeat the parameter for multiple IDs. | No filter | milestoneIds=1&milestoneIds=2 |
planIds | number | Filter by plan ID; 0 matches runs outside test plans. Repeat the parameter for multiple IDs. | No filter | planIds=3 |
configurationIds | string | Filter by configuration ID. Repeat the parameter for multiple IDs. | No filter | configurationIds=abc123 |
offset | number | Number of items to skip. | 0 | offset=10 |
limit | number | Maximum number of items to return. Accepted range: 0–1,000. | 100 | limit=20 |
sortField | string | Field to sort by: title, created_at, last_activity_at (the latest result or run log; the creation time for a run without either) or closed_at (open runs last). | created_at | sortField=created_at |
sortOrder | string | Sort direction for sortField: asc or desc. | desc | sortOrder=desc |
include | string | Include additional fields omitted by default. Accepted values: project, plan, milestone, assignment, configuration or statusCounts. Repeat the parameter for multiple values. | None | include=configuration&include=statusCounts |
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/paginatedResponse Fields
{
total: number // Number of matching runs across all pages
offset: number // Offset applied to this response
limit: number // Limit applied to this response
open: number // Number of open runs in the project, regardless of the filters
closed: number // Number of closed runs in the project, regardless of the filters
data: Array<{ // Runs in this page
id: number // Run ID
type: string // Type of the run (`static` | `static_struct` | `live`)
title: string // Title of the run
description: html // Description of the run
projectId: string // ID of the project the run belongs to
project: { // Project of the run; only with `include=project`
id: string // Project ID
code: string // Code of the project
title: string // Title of the project
} | null
planId: number | null // ID of the test plan the run belongs to, null if none
plan: { // Test plan of the run, null if none; only with `include=plan`
title: string // Title of the test plan
} | null
milestoneId: number | null // ID of the milestone of the run, null if none
milestone: { // Milestone of the run, null if none; only with `include=milestone`
title: string // Title of the milestone
} | null
assignmentId: number | null // ID of the assigned user, null if none
assignment: { // Assigned user, null if none; only with `include=assignment`
id: number // User ID
email: string // Email address of the user
name: string // Name of the user
avatar: string | null // Absolute URL of the avatar, null if none; fetching it requires authentication
role: string // Workspace role (`owner` | `admin` | `user` | `test-runner` | `viewer`)
} | null
configurationId: string | null // ID of the configuration of the run, null if none
configuration: { // Configuration of the run, null if none; only with `include=configuration`
id: string // Configuration ID
title: string // Title of the configuration
createdAt: datetime // Creation time
updatedAt: datetime // Last update time
} | null
statusCounts: { // Count of run test cases by status; only with `include=statusCounts`
all: number // Total test cases
blocked: number // Blocked test cases
failed: number // Failed test cases
open: number // Open test cases
passed: number // Passed test cases
skipped: number // Skipped test cases
custom1: number // Count of test cases with first custom status
custom2: number // Count of test cases with second custom status
custom3: number // Count of test cases with third custom status
custom4: number // Count of test cases with fourth custom status
} | null
integrationLink: { // Jira or Linear issue linked to the run, null if none
type: string // Integration type (`jira` | `linear`)
integrationId: string // ID of the integration
issueId: string // The issue as sent in `integrationIssueId`: its ID, or a Jira key / Linear identifier
issueTitle: string // Title of the issue
issueUrl: string // URL of the issue
remoteLinkId: string // ID of the link back to the run in the tracker; empty once QA Sphere found that link removed in the tracker
} | null
timeSpent: number | null // Time spent on the run, in milliseconds
isAutomated: boolean // Whether automated tests execute the run; `false` for a run people execute manually
createdAt: datetime // Creation time
lastActivityAt: datetime | null // Time of the latest result or run log in the run
closedAt: datetime | null // Closing time, null if open
closedByUserId: number | null // ID of the user who closed the run, null if open
}>
}List Runs (Deprecated)
Deprecated
This endpoint is deprecated. Use List Runs (GET /api/public/v0/project/{project_id}/run/paginated) instead.
Returns all runs in a project with their current status.
Query Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
closed | boolean | Filter by run status. | No filter | closed=true |
milestoneIds | number | Filter by milestone ID; 0 matches runs without a milestone. Repeat the parameter for multiple IDs. | No filter | milestoneIds=1&milestoneIds=2 |
limit | number | Maximum number of items to return. | No limit | limit=10 |
include | string | Return only these related objects. Accepted values: project, plan, milestone, assignment, configuration or statusCounts. Repeat the parameter for multiple values. | All of them | include=configuration&include=statusCounts |
By default every related object listed under Response Fields is returned. Supply one or more include values to return only the related objects you need — any related object you do not list is returned as null.
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/runResponse Fields
{
runs: Array<{
id: number // Run ID
type: string // Type of the run (`static` | `static_struct` | `live`)
title: string // Title of the run
description: html // Description of the run
projectId: string // ID of the project the run belongs to
project: { // Project details
id: string // Project ID
code: string // Code of the project
title: string // Title of the project
} | null
planId: number | null // ID of the test plan the run belongs to, null if none
plan: { // Test plan details (if any)
title: string // Title of the test plan
} | null
milestoneId: number | null // ID of the milestone of the run, null if none
milestone: { // Milestone of the run, null if none
title: string // Title of the milestone
} | null
assignmentId: number | null // ID of the assigned user, null if none
assignment: { // Assignee details (if any)
id: number // User ID
email: string // Email address of the user
name: string // Name of the user
avatar: string | null // Absolute URL of the avatar, null if none; fetching it requires authentication
role: string // Workspace role (`owner` | `admin` | `user` | `test-runner` | `viewer`)
} | null
configurationId: string | null // ID of the configuration of the run, null if none
configuration: { // Configuration of the run, null if none
id: string // Configuration ID
title: string // Title of the configuration
createdAt: datetime // Creation time
updatedAt: datetime // Last update time
} | null
statusCounts: { // Count of run test cases by status
all: number // Total test cases
blocked: number // Blocked test cases
failed: number // Failed test cases
open: number // Open test cases
passed: number // Passed test cases
skipped: number // Skipped test cases
custom1: number // Count of test cases with first custom status
custom2: number // Count of test cases with second custom status
custom3: number // Count of test cases with third custom status
custom4: number // Count of test cases with fourth custom status
} | null
timeSpent: number | null // Time spent on the run, in milliseconds
isAutomated: boolean // Whether automated tests execute the run; `false` for a run people execute manually
createdAt: datetime // Creation time
closedAt: datetime | null // Closing time, null if open
closedByUserId: number | null // ID of the user who closed the run, null if open
}>
}List Runs Assigned to Me
Returns the open runs assigned to the user of the API key, across every project they can access. Runs of archived projects are left out.
Query Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
offset | number | Number of items to skip. | 0 | offset=10 |
limit | number | Maximum number of items to return. Accepted range: 0–1,000. | 100 | limit=20 |
sortField | string | Field to sort by: title, created_at or last_activity_at (the latest result or run log; the creation time for a run without either). | created_at | sortField=title |
sortOrder | string | Sort direction for sortField: asc or desc. | desc | sortOrder=asc |
Response
Status: 200 OK
{
total: number // Number of matching assigned open runs across all pages
offset: number // Offset applied to this response
limit: number // Limit applied to this response
data: Run[] // Runs in the shape List Runs returns, with project, milestone, assignment, configuration and statusCounts filled in
}Get Run
Returns one run.
Response
Status: 200 OK
{
id: number // Run ID
type: string // Type of the run (`static` | `static_struct` | `live`)
title: string // Title of the run
description: html // Description of the run
authorId: number // ID of the user who created the run
planId: number | null // ID of the test plan the run belongs to, null if none
milestoneId: number | null // ID of the milestone of the run, null if none
assignmentId: number | null // ID of the assigned user, null if none
assignment: { // Assigned user, null if none
id: number // User ID
email: string // Email address of the user
name: string // Name of the user
avatar: string | null // Absolute URL of the avatar, null if none; fetching it requires authentication
role: string // Workspace role (`owner` | `admin` | `user` | `test-runner` | `viewer`)
} | null
configurationId: string | null // ID of the configuration of the run, null if none
configuration: { // Configuration of the run, null if none
id: string
title: string
createdAt: datetime
updatedAt: datetime
} | null
integrationLink: { // Jira or Linear issue linked to the run, null if none
type: string // Integration type (`jira` | `linear`)
integrationId: string // ID of the integration
issueId: string // The issue as sent in `integrationIssueId`: its ID, or a Jira key / Linear identifier
issueTitle: string // Title of the issue
issueUrl: string // URL of the issue
remoteLinkId: string // ID of the link back to the run in the tracker; empty once QA Sphere found that link removed in the tracker
} | null
timeSpent: number | null // Time spent on the run, in milliseconds
isAutomated: boolean // Whether automated tests execute the run; `false` for a run people execute manually
createdAt: datetime // Creation time
lastActivityAt: datetime | null // Time of the latest result or run log in the run
closedAt: datetime | null // Closing time, null if open
closedByUserId: number | null // ID of the user who closed the run, null if open
closedByUser: { // User who closed the run (if closed)
id: number // User ID
email: string // Email address of the user
name: string // Name of the user
avatar: string | null // Absolute URL of the avatar, null if none; fetching it requires authentication
role: string // Workspace role (`owner` | `admin` | `user` | `test-runner` | `viewer`)
} | null
}Get Status Counts of Open Runs
Returns the status counts of every open run in the project, in one request.
Response
Status: 200 OK
{
data: Array<{
runId: number // ID of the run
counts: Record<string, number> // Count of run test cases by status, keyed as `statusCounts` in List Runs
}>
}Create New Run
Creates a new test run in the project. Its queryPlans follow Test Case Selection: a static or user selection run takes one query plan with tcaseIds, or one or more with filters, resolved now; a live run takes one or more with filters.
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Request Body
{
title: string // Title of the run
description?: html // Description of the run
type: string // Type of the run (`static` | `static_struct` | `live`)
milestoneId?: number // Associated milestone
configurationId?: string // Associated configuration (see Configurations)
assignmentId?: number // Assigned user
integrationIssueId?: string // Issue to link the run to in the project's Jira or Linear integration
isAutomated?: boolean // Whether automated tests execute the run; `false` creates a run people execute manually (default `true`)
queryPlans: Array<{ // Test case selection criteria (see Test Case Selection)
// Direct selection (by test case), static and user selection runs only:
tcaseIds?: string[] // Test cases (test case ID, sequence number or legacy ID)
// Or selection by filters, any run type:
folderIds?: number[] // Test cases in these folders, subfolders included
tagIds?: number[] // Test cases with any of these tags
priorities?: string[] // Test cases with any of these priorities (`high` | `medium` | `low`)
}>
}Field Constraints
title: Must be 1–255 characters long and unique within the projectqueryPlans:- For static and user selection runs: one query plan with
tcaseIds, or one or more with filters - For live runs: filters only
- A query plan can't send
tcaseIdstogether with a filter field, even an empty one tcaseIds: Each value may be a test case ID, sequence number or legacy ID. A value that matches no test case in the project fails the request with400 Bad Request
- For static and user selection runs: one query plan with
milestoneId: The milestone must belong to the project and must not be archivedconfigurationId: Must be a configuration of the projectassignmentId: Must be an active user with permissions above Viewer roleintegrationIssueId: ID or key of an issue in the project's Jira or Linear integration. It is ignored when the project has no Jira or Linear integration. If the issue cannot be fetched, the run is not created: the response is400 Bad Requestfor an issue that doesn't exist, and otherwise has the status the integration endpoints return when the tracker refuses a request
Example Request - Live Run With Filtered Test Cases
curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
-d '{
"title": "Sprint 23 Regression",
"description": "<p>Regression test suite for Sprint 23 release</p>",
"type": "live",
"milestoneId": 5,
"queryPlans": [{
"folderIds": [1, 2],
"tagIds": [1],
"priorities": ["high"]
}, {
"folderIds": [4, 6],
"tagIds": [],
"priorities": ["medium", "high"]
}]
}' \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/runExample Request - Live Run With All Test Cases
curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
-d '{
"title": "Complete Test Suite",
"description": "<p>Run with all test cases from the project</p>",
"type": "live",
"milestoneId": 5,
"queryPlans": [{
"folderIds": [],
"tagIds": [],
"priorities": []
}]
}' \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/runExample Request - Static Run With Specific Test Cases
curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
-d '{
"title": "Specific Test Cases Run",
"type": "static",
"queryPlans": [{
"tcaseIds": ["1CEPaUhgH_Tvt2LZygwVRQa", "1CAPaUhgH_Tvt2LZygwVRTb", "1EEPaUhgH_Tvt2LZygwVRLm"]
}]
}' \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/runResponse
Status: 201 Created
{
id: number // ID of the created run
}Example Response
{
"id": 2
}Best Practices
- Use live runs for ongoing test suites that should automatically update
- Use static runs for fixed test sets like release certifications
- Always provide descriptive titles and link runs to milestones when applicable
- Assign runs to specific users for better accountability
Preview Run Test Cases
Returns the test cases a selection would put in a run, without creating or changing one. It is a POST only to carry the query plans; it changes nothing, so viewers can call it too.
Request Body
{
runType: string // Run type (`static` | `static_struct` | `live`)
queryPlans: Array<{ // Test case selection (see Test Case Selection)
// Direct selection (by test case), static and user selection runs only:
tcaseIds?: string[] // Test cases (test case ID, sequence number or legacy ID)
// Or selection by filters, any run type:
folderIds?: number[] // Test cases in these folders, subfolders included
tagIds?: number[] // Test cases with any of these tags
priorities?: string[] // Test cases with any of these priorities (`high` | `medium` | `low`)
}>
runId?: number // An existing run, to preview a change to its selection with Update Run
offset?: number // Number of items to skip (default 0)
limit?: number // Maximum number of items to return, 0–1,000 (default 100)
}With runId, test cases the run already has keep the version and status they have in the run, as Update Run would keep them.
Response
Status: 200 OK
{
total: number // Number of test cases the selection matches
offset: number // Offset applied to this response
limit: number // Limit applied to this response
data: RunTCase[] // Test cases in the page, folder by folder in the order the run would list them, in the shape List Run Test Cases returns without `include`
}Clone Existing Run
Creates a new run by cloning an existing one. The new run takes the source run's type and test case selection. Its other fields come only from the request, so a field left out, such as milestoneId or configurationId, is not copied from the source run. For live runs, the new run will reflect current test case states.
The support for cloning runs with test plans via this endpoint is planned for a future release.
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Request Body
{
runId: number // Source run ID to clone
title: string // Title of the new run
description?: html // New description
milestoneId?: number // New milestone
configurationId?: string // Configuration of the new run (see Configurations)
assignmentId?: number // New assignee
integrationIssueId?: string // Issue to link the new run to in the project's Jira or Linear integration
isAutomated?: boolean // Whether automated tests execute the run; `false` creates a run people execute manually (default `true`)
}Field Constraints
title: Must be 1–255 characters long and unique within the projectrunId: Must be a valid run ID in the projectmilestoneId: The milestone must belong to the project and must not be archivedconfigurationId: Must be a configuration of the projectassignmentId: Must be an active user with permissions above Viewer roleintegrationIssueId: Same as for Create New Run; the source run's issue link is not copiedisAutomated: Not copied from the source run
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
-d '{
"runId": 1,
"title": "Sprint 24 Regression - Clone",
"description": "<p>Cloned regression suite for Sprint 24</p>",
"milestoneId": 5,
"assignmentId": 1
}' \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/cloneResponse
Status: 201 Created
{
id: number // ID of the created run
}Example Response
{
"id": 2
}When cloning a live run, the new run will:
- Maintain the same query plans as the original run
- Reflect the current state of test cases (may differ from the original run)
- Start with all test cases in
openstatus regardless of the original run's results
Update Run
Updates a run. Fields left out keep their current values. Runs of a test plan are managed through the plan and can't be updated here, and a closed run must be reopened first.
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Request Body
{
title?: string // New title (1–255 characters)
description?: html // New description
type?: string // New type of the run (`static` | `static_struct` | `live`)
milestoneId?: number // Milestone to move the run to; 0 takes it out of its milestone
assignmentId?: number // User to assign the run to; 0 unassigns it
configurationId?: string // Configuration of the run; an empty string removes it
integrationIssueId?: string // Issue to link the run to; an empty string removes the link
queryPlans?: Array<{ // Full replacement of the run's test case selection
id?: number // Existing query plan to replace with the fields sent alongside it (see Get Run Selections); omit for a new one
tcaseIds?: string[] // Direct selection, as in Create New Run
folderIds?: number[] // Or selection by filters, as in Create New Run
tagIds?: number[]
priorities?: string[]
}>
}Field Constraints
title: Must be unique within the milestone, also when onlymilestoneIdchangesmilestoneId,assignmentIdandconfigurationId: Same as for Create New RunintegrationIssueId: ID or key of an issue in the project's Jira or Linear integration. Changing or removing the link also removes the link back from the old issue. If the issue cannot be fetched, the update fails and the run is left unchanged. It is ignored when the project has no Jira or Linear integration, except that an empty string still removes an existing linktype: Switching to or fromlivealso needsqueryPlansqueryPlans: The same rules as for Create New Run apply, checked against the newtype, so at least one query plan is needed ([{ "tcaseIds": [] }]empties a static or user selection run). Filters on a static or user selection run are resolved now, and the query plan stores the test cases they match. Anidmust be one of the run's own query plans
Changing the selection
queryPlans replaces the whole selection: a query plan left out is removed. Read the current ones with Get Run Selections, and check the outcome first with Preview Run Test Cases and its runId.
A query plan sent with an id is replaced by the fields sent alongside it. To keep a query plan, send its id with all its current fields, as Get Run Selections returns them. An id alone saves no fields: on a static or user selection run the query plan then selects no test cases, and on a live run it matches every test case.
Changing queryPlans or type re-selects the run's test cases:
- Test cases the run keeps also keep their results, version and status
- Test cases that no longer match leave the run with the time tracked on them, and their results stop counting in the run
- New test cases are added as open
Response
Status: 200 OK
The updated run, in the shape Get Run returns.
Errors
| Status Code | Description |
|---|---|
| 400 | A query plan id is not one of the run's |
| 409 | The run is closed or part of a test plan; the title is taken in the milestone |
Get Run Selections
Returns the run's selections, that is its query plans. Update Run replaces them as a whole, so read them first to change one.
Response
Status: 200 OK
{
selections: Array<{
id: number // Query plan ID, to pass back in Update Run
tcaseCount: number // Number of test cases the query plan selects
tcases: RunTCase[] | null // Selected test cases of a `static` or `static_struct` run, in the shape List Run Test Cases returns without `include`; null for a `live` run
folders: Array<{ // Folder filter of a live run; null for other runs
id: number
parentId: number
title: string
comment: html
pos: number
}> | null
tags: Array<{ // Tag filter of a live run; null for other runs
id: number
title: string
}> | null
priorities: string[] | null // Priority filter of a live run (`high` | `medium` | `low`); null for other runs
}>
}Close Run
Close an open test run.
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/closeResponse
Status: 200 OK
{
message: string
}Errors
| Status Code | Description |
|---|---|
| 409 | The run is already closed or is part of a test plan |
Reopen Run
Reopens a closed run.
- The run catches up with the changes made to test cases while it was closed, as an open run of its type follows them (see Types of Runs). A live run applies its filters again, so test cases may join or leave it
- An archived milestone of the run is unarchived
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Response
Status: 200 OK
{
message: string
}Errors
| Status Code | Description |
|---|---|
| 409 | The run is already open or is part of a test plan |
Close Runs
Closes several runs, like Close Run. Runs that are already closed are left as they are.
Request Body
{
runIds: number[] // Runs to close (1 to 100)
}Response
Status: 200 OK
{
message: string
}Errors
| Status Code | Description |
|---|---|
| 409 | A run is part of a test plan |
Reopen Runs
Reopens several runs, like Reopen Run. Runs that are already open are left as they are.
Request Body
{
runIds: number[] // Runs to reopen (1 to 100)
}Response
Status: 200 OK
{
message: string
}Errors
| Status Code | Description |
|---|---|
| 409 | A run is part of a test plan; its milestone changed meanwhile, so retry |
Move Runs to Milestone
Moves runs into a milestone, or out of their milestone. Closed runs can be moved too, and stay closed.
Request Body
{
runIds: number[] // Runs to move (1 to 100)
milestoneId: number // Milestone to move them to; 0 takes them out of their milestone
}Response
Status: 200 OK
{
message: string
}Errors
| Status Code | Description |
|---|---|
| 400 | The milestone is archived |
| 409 | A run is part of a test plan or a run's title is taken in the milestone |
Delete Run
Deletes a run. It goes to the trash, closed, and can be restored from there. The link back from a linked Jira or Linear issue is removed.
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Response
Status: 200 OK
{
message: string
}Errors
| Status Code | Description |
|---|---|
| 409 | The run is part of a test plan |
Delete Runs
Deletes several runs, like Delete Run. Each run gets its own trash entry.
Request Body
{
runIds: number[] // Runs to delete (1 to 100)
}Response
Status: 200 OK
{
message: string
}Errors
| Status Code | Description |
|---|---|
| 409 | A run is part of a test plan |
List Run Test Cases
/paginated endpoints are transitional. In API v1, the base paths will return paginated responses and the /paginated suffix will be removed.
Returns all test cases in a run with their current status.
Query Parameters
Some query parameters can be specified multiple times using the format param=value1¶m=value2¶m=value3.
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
search | string | Filter by title using case-insensitive partial matching. | No filter | search=ui |
tags | number | Filter by tag ID. Repeat the parameter for multiple IDs; tagsFilterOp sets how multiple values combine. | No filter | tags=12 |
tagsFilterOp | string | How multiple tags values combine: or (any of the tags), and (all of the tags) or not (none of the tags). | or | tagsFilterOp=and |
priorities | string | Filter by priority: high, medium or low. Repeat the parameter for multiple values; multiple values use OR logic. | No filter | priorities=low |
status | string | Filter by the status of the test case in the run: passed, failed, skipped, open, blocked or custom1–custom4. Repeat the parameter for multiple values; multiple values use OR logic. | No filter | status=failed |
automationResults | string | Filter by automated results: automated_passing (the latest automated result passed), automated_failing (it failed), has_automated (any automated result) or has_manual (any result a person reported). Repeat the parameter for multiple values; automationResultsFilterOp sets how multiple values combine. | No filter | automationResults=automated_failing |
automationResultsFilterOp | string | How multiple automationResults values combine: or, and or not. | or | automationResultsFilterOp=and |
cf_${custom field system name} | string | Filter by a value defined for the custom field. Repeat the parameter for multiple values; multiple values use OR logic. | No filter | cf_automation=Automated |
offset | number | Number of items to skip. | 0 | offset=10 |
limit | number | Maximum number of items to return. Accepted range: 0–1,000. | 100 | limit=20 |
sortField | string | Field to sort by: seq, folder_id, pos, title, priority or status. | folder_id, then pos | sortField=title |
sortOrder | string | Sort direction for sortField: asc or desc. | asc | sortOrder=asc |
include | string | Include additional fields omitted by default. Accepted values: folder, steps, tags, precondition, requirements or customFields. Repeat the parameter for multiple values. | None | include=steps |
- Different filters are combined with AND logic
- Multiple values for the same filter are combined with OR logic
include=steps,include=tags,include=precondition,include=requirementsandinclude=customFieldsreturn the content of the exact test case version pinned by the run, so the response matches what the run's results were recorded against even if a test case was edited later. The Test Cases list endpoint always returns the latest version instead.
Example Request
Fetch all run test cases with additional folder information
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/paginated?include=folder"Fetch all run test cases with their steps and tags in a single request
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/paginated?include=steps&include=tags"Fetch all test cases from a run with "Automation" custom field to be "Automated"
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/paginated?cf_automation=Automated"Fetch 20 test cases from a run sorted by title in ascending order
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/paginated?limit=20&sortField=title&sortOrder=asc"Fetch 10 test cases ordered by sequence number
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/paginated?limit=10&sortField=seq&sortOrder=asc"Fetch test cases with "backend" in their title from a run
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/paginated?search=backend"Fetch test cases with tag ID 12 from a run
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/paginated?tags=12"Fetch test cases with priority high from a run
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/paginated?priorities=high"Response Fields
{
total: number // Number of matching run test cases across all pages
offset: number // Offset applied to this response
limit: number // Limit applied to this response
data: Array<{ // Run test cases in this page
id: string // Test case ID
version: number // Version of the test case
legacyId: string // Legacy ID of the test case, empty if it has none
type: string // Type of the test case (`standalone` | `filled`)
folderId: number // ID of the folder containing the test case
pos: number // 0-based position of the test case in its folder
seq: number // Sequence number of the test case in the project
title: string // Title of the test case
priority: string // Priority of the test case (`high` | `medium` | `low`)
status: string // Status of the latest result added for the run test case (`open` if no results are added)
isAutomated: boolean // Whether an automated test produced the latest result
lastAutomatedStatus?: string // Status of the latest automated result, absent if there is none
hasManualResult?: boolean // True when a person reported a result; absent otherwise
isEmpty: boolean // Whether the test case has no precondition and no steps
templateTCaseId?: string // Corresponding template test case ID, if it is a filled test case
folder?: { // Folder containing the test case; only with `include=folder`
id: number // Folder ID
parentId: number // ID of the parent folder (0 for root folders)
title: string // Title of the folder
comment: html // Additional notes or description
pos: number // 0-based position of the folder among its siblings
}
steps?: Step[] // Steps of the pinned test case version if include=steps is passed (same shape as `steps` in the Get Run Test Case response below)
tags?: Array<{ // Tags of the pinned test case version; only with `include=tags`
id: number // Tag ID
title: string // Title of the tag
}>
precondition?: { // Precondition of the pinned test case version; only with `include=precondition`
projectId: string // ID of the project the precondition belongs to
id: number // Precondition ID; useful only for a shared precondition
version: number // Version of the precondition
type: string // Type of the precondition (`standalone` | `shared`)
title?: string // Title of the precondition; only for shared preconditions
text: html // Text of the precondition (empty when the test case has none)
isLatest: boolean // Whether this is the latest version of the precondition
createdAt: datetime // Time the precondition was first created; a standalone one is replaced by a new one whenever the test case's precondition is set
updatedAt: datetime // Time this version was created, or the deletion time once a shared precondition is deleted
deletedAt?: datetime // Deletion time, if the (shared) precondition was deleted
}
requirements?: Array<{ // Requirements of the pinned test case version; only with `include=requirements`
id: string // Requirement ID
text: string // Title of the requirement
url: string // URL of the requirement, empty if it has none
integrationLink: { // Jira or Linear issue linked to the requirement, null if none
type: string // Integration type (`jira` | `linear`)
integrationId: string // ID of the integration
issueId: string // The issue as sent in `integrationIssueId`: its ID, or a Jira key / Linear identifier
issueTitle: string // Title of the issue
issueUrl: string // URL of the issue
remoteLinkId: string // ID of the link back to the requirement in the tracker; empty once QA Sphere found that link removed in the tracker
} | null
}>
customFields?: { // Custom field values of the pinned test case version; only with `include=customFields`
[key: string]: { // Keyed by the custom field's system name; enabled fields only
value: string // Current value; for dropdown and checkbox fields, an option's value
isDefault: boolean // Whether the value is the field's default and follows changes to it
}
}
}>
}Sample Response
{
"total": 2,
"offset": 0,
"limit": 100,
"data": [
{
"id": "1CGeNaNVt_Axa7TcMjUm6Zh",
"version": 1,
"legacyId": "",
"type": "standalone",
"folderId": 11848,
"pos": 3,
"seq": 8,
"title": "The \"Checkout\" page with products from the cart should be shown after clicking the \"Checkout\" button",
"priority": "high",
"status": "open",
"isAutomated": false,
"isEmpty": true
},
{
"id": "1CGeNaNWP_Eiq5mjzPsKSX9",
"version": 1,
"legacyId": "",
"type": "filled",
"folderId": 11848,
"pos": 4,
"seq": 9,
"title": "The cart is still filled after going back from the \"Checkout\" page without submitting it",
"priority": "medium",
"status": "open",
"isAutomated": false,
"isEmpty": false,
"templateTCaseId": "1CGeNaNKq_Pw8sTcMjUm4Xb"
}
]
}List Run Test Cases (Deprecated)
Deprecated
This endpoint is deprecated. Use List Run Test Cases (GET /api/public/v0/project/{project_id}/run/{run_id}/tcase/paginated) instead.
Returns all test cases in a run with their current status.
Query Parameters
All query parameters are optional and some can be specified multiple times using the format param=value1¶m=value2¶m=value3.
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
search | string | Filter by title using case-insensitive partial matching. | No filter | search=ui |
tags | number | Filter by tag ID. Repeat the parameter for multiple IDs; tagsFilterOp sets how multiple values combine. | No filter | tags=12 |
tagsFilterOp | string | How multiple tags values combine: or (any of the tags), and (all of the tags) or not (none of the tags). | or | tagsFilterOp=and |
priorities | string | Filter by priority: high, medium or low. Repeat the parameter for multiple values; multiple values use OR logic. | No filter | priorities=low |
cf_${custom field system name} | string | Filter by a value defined for the custom field. Repeat the parameter for multiple values; multiple values use OR logic. | No filter | cf_automation=Automated |
include | string | Include additional fields omitted by default. Accepted values: folder, steps, tags, precondition, requirements or customFields. Repeat the parameter for multiple values. | None | include=steps |
- Different filters are combined with AND logic
- Multiple values for the same filter are combined with OR logic
include=steps,include=tags,include=precondition,include=requirementsandinclude=customFieldsreturn the content of the exact test case version pinned by the run, so the response matches what the run's results were recorded against even if a test case was edited later. The Test Cases list endpoint always returns the latest version instead.
Example Request
Fetch all run test cases with additional folder information
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase?include=folder"Fetch all run test cases with their steps and tags in a single request
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase?include=steps&include=tags"Fetch all test cases from a run with "Automation" custom field to be "Automated"
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase?cf_automation=Automated"Fetch test cases with "backend" in their title from a run
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase?search=backend"Fetch test cases with tag ID 12 from a run
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase?tags=12"Fetch test cases with priority high from a run
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase?priorities=high"Response Fields
{
tcases: Array<{
id: string // Test case ID
version: number // Version of the test case
legacyId: string // Legacy ID of the test case, empty if it has none
type: string // Type of the test case (`standalone` | `filled`)
folderId: number // ID of the folder containing the test case
pos: number // 0-based position of the test case in its folder
seq: number // Sequence number of the test case in the project
title: string // Title of the test case
priority: string // Priority of the test case (`high` | `medium` | `low`)
status: string // Status of the latest result added for the run test case (`open` if no results are added)
isAutomated: boolean // Whether an automated test produced the latest result
isEmpty: boolean // Whether the test case has no precondition and no steps
templateTCaseId?: string // Corresponding template test case ID, if it is a filled test case
folder?: { // Folder containing the test case; only with `include=folder`
id: number // Folder ID
parentId: number // ID of the parent folder (0 for root folders)
title: string // Title of the folder
comment: html // Additional notes or description
pos: number // 0-based position of the folder among its siblings
}
steps?: Step[] // Steps of the pinned test case version if include=steps is passed
// (same shape as `steps` in the Get Run Test Case response below)
tags?: Array<{ // Tags of the pinned test case version; only with `include=tags`
id: number // Tag ID
title: string // Title of the tag
}>
precondition?: { // Precondition of the pinned test case version; only with `include=precondition`
projectId: string // ID of the project the precondition belongs to
id: number // Precondition ID; useful only for a shared precondition
version: number // Version of the precondition
type: string // Type of the precondition (`standalone` | `shared`)
title?: string // Title of the precondition; only for shared preconditions
text: html // Text of the precondition (empty when the test case has none)
isLatest: boolean // Whether this is the latest version of the precondition
}
requirements?: Array<{ // Requirements of the pinned test case version; only with `include=requirements`
id: string // Requirement ID
text: string // Title of the requirement
url: string // URL of the requirement, empty if it has none
}>
customFields?: { // Custom field values of the pinned test case version; only with `include=customFields`
[key: string]: { // Keyed by the custom field's system name; enabled fields only
value: string // Current value; for dropdown and checkbox fields, an option's value
isDefault: boolean // Whether the value is the field's default and follows changes to it
}
}
}>
}Sample Response
{
"tcases": [
{
"id": "1CGeNaNVt_Axa7TcMjUm6Zh",
"version": 1,
"legacyId": "",
"type": "standalone",
"folderId": 11848,
"pos": 3,
"seq": 8,
"title": "The \"Checkout\" page with products from the cart should be shown after clicking the \"Checkout\" button",
"priority": "high",
"status": "open",
"isAutomated": false,
"isEmpty": true
},
{
"id": "1CGeNaNWP_Eiq5mjzPsKSX9",
"version": 1,
"legacyId": "",
"type": "filled",
"folderId": 11848,
"pos": 4,
"seq": 9,
"title": "The cart is still filled after going back from the \"Checkout\" page without submitting it",
"priority": "medium",
"status": "open",
"isAutomated": false,
"isEmpty": false,
"templateTCaseId": "1CGeNaNKq_Pw8sTcMjUm4Xb"
}
]
}Get Run Folder Tree
Returns the folders holding the run's test cases as a tree, with their parent folders. The response is not paginated.
Query Parameters
Takes the filters of List Run Test Cases: search, tags, tagsFilterOp, priorities, status, automationResults, automationResultsFilterOp and cf_${custom field system name}. Only folders holding a matching test case are returned.
Response
Status: 200 OK
{
folders: Array<{ // Root folders holding the run's test cases; null when no folder matches
id: number // Folder ID
parentId: number // ID of the parent folder (0 for root folders)
title: string // Title of the folder
comment: html // Additional notes or description
projectId: string // ID of the project the folder belongs to
pos: number // 0-based position of the folder among its siblings
children?: object[] // Subfolders holding the run's test cases, with the same fields as these folders; absent when there are none
}> | null
}Get Run Status Counts
Returns the number of the run's test cases in each status.
Query Parameters
Takes the filters of List Run Test Cases, to count only the matching test cases.
Response
Status: 200 OK
{
statusCounts: Record<string, number> // Count of run test cases by status, keyed as `statusCounts` in List Runs
}Get Run Time Spent
Returns the time each user spent in the run: the sum of timeTaken on the results they added, or null when none of them has a time. Results QA Sphere adds itself, when a test case is updated to its latest version or added back to the run, are left out. The run's timeSpent is the total.
Response
Status: 200 OK
{
users: Array<{ // Users who added results to the run, most time first and those without time last
id: number // User ID
email: string // Email address of the user
name: string // Name of the user
avatar: string | null // Absolute URL of the avatar, null if none; fetching it requires authentication
role: string // Workspace role (`owner` | `admin` | `user` | `test-runner` | `viewer`)
timeSpent: number | null // Time on the user's results, in milliseconds; null if none of them has a time
}>
}Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/12/time-spentExample Response
{
"users": [
{
"id": 1,
"email": "jane@example.com",
"name": "Jane Doe",
"avatar": null,
"role": "owner",
"timeSpent": 5400000
},
{
"id": 4,
"email": "sam@example.com",
"name": "Sam Lee",
"avatar": null,
"role": "test-runner",
"timeSpent": null
}
]
}Get Run Test Case
Get details of a single run test case using its ID, sequence or legacy ID.
Step data items follow the shape described in the Step Test Data section of the Test Cases page.
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/1Response Fields
{
id: string // Test case ID
version: number // Version of the test case
legacyId: string // Legacy ID of the test case, empty if it has none
type: string // Type of the test case (`standalone` | `filled`)
title: string // Title of the test case
seq: number // Sequence number of the test case in the project
folderId: number // ID of the folder containing the test case
pos: number // 0-based position of the test case in its folder
priority: string // Priority of the test case (`high` | `medium` | `low`)
comment: html // Text of the precondition. Deprecated: use `precondition.text`
precondition: { // Precondition of the test case version in the run
projectId: string // ID of the project the precondition belongs to
id: number // Precondition ID; useful only for a shared precondition
version: number // Version of the precondition
type: string // Type of the precondition (`standalone` | `shared`)
title?: string // Title of the precondition; only for shared preconditions
text: html // Text of the precondition (empty when the test case has none)
isLatest: boolean // Whether this is the latest version of the precondition
createdAt: datetime // Time the precondition was first created; a standalone one is replaced by a new one whenever the test case's precondition is set
updatedAt: datetime // Time this version was created, or the deletion time once a shared precondition is deleted
deletedAt?: datetime // Deletion time, if the (shared) precondition was deleted
}
steps: Array<{ // Steps of the test case
id: number // Step ID
type: string // Type of the step (`standalone` | `shared`)
version: number // Version of the step (always 1 for standalone steps)
isLatest: boolean // Whether this is the latest version of the step (always true for standalone steps)
title?: string // Title of the step (only for shared steps)
subSteps?: Array<{ // List of sub-steps; present on every shared step, absent on standalone steps
id: number // Sub-step ID
type: string // Type of the sub-step (always `shared_sub_step`)
version: number // Version of the sub-step (same as the parent step)
isLatest: boolean // Whether this is the latest version of the sub-step (same as the parent step)
description?: html // Details of the sub-step, absent when empty
expected?: html // Expected result of the sub-step, absent when empty
data?: StepData[] // Sub-step test data items, absent when there are none (see Step Test Data on the Test Cases page)
deletedAt?: datetime // Deletion time of the sub-step
}>
description?: html // Details of the step; only for standalone steps, absent when empty
expected?: html // Expected result of the step; only for standalone steps, absent when empty
data?: StepData[] // Step test data items; only for standalone steps, absent when there are none (see Step Test Data on the Test Cases page)
deletedAt?: datetime // Deletion time of the step
}>
tags: Array<{ // Tags of the test case
id: number // Tag ID
title: string // Title of the tag
}>
files: Array<{ // List of files attached to the test case; null or [] when there are none
id: string // File ID
fileName: string // Name of the file
mimeType: string // MIME type of the file
size: number // Size of the file in bytes
stableUrl?: string // Host-relative URL (`/api/file/{id}`) of an uploaded file, absolute for an external one; absent for legacy attachments
url?: string // Absolute URL of the file; absent when `stableUrl` is
}> | null
requirements: Array<{ // Test case requirement (currently only single requirement is supported on UI)
id: string // Requirement ID
text: string // Title of the requirement
url: string // URL of the requirement, empty if it has none
integrationLink: { // Jira or Linear issue linked to the requirement, null if none
type: string // Integration type (`jira` | `linear`)
integrationId: string // ID of the integration
issueId: string // The issue as sent in `integrationIssueId`: its ID, or a Jira key / Linear identifier
issueTitle: string // Title of the issue
issueUrl: string // URL of the issue
remoteLinkId: string // ID of the link back to the requirement in the tracker; empty once QA Sphere found that link removed in the tracker
} | null
}>
links: Array<{ // Additional links relevant to the test case; null or [] when there are none
text: string // Title of the link
url: string // URL of the link
}> | null
customFields: { // Custom field values of the test case
[key: string]: { // Keyed by the custom field's system name; enabled fields only
value: string // Current value; for dropdown and checkbox fields, an option's value
isDefault: boolean // Whether the value is the field's default and follows changes to it
}
}
authorId: number // ID of the user who created the test case
createdAt: datetime // Creation time
status: string // Status of the latest result added for the run test case (`open` if no results are added)
isAutomated: boolean // Whether an automated test produced the latest result
lastAutomatedStatus?: string // Status of the latest automated result, absent if there is none
hasManualResult?: boolean // True when a person reported a result; absent otherwise
isLatestVersion: boolean // Whether this is the latest version of the test case
isEmpty: boolean // Whether the test case has no precondition and no steps
templateTCaseId?: string // Corresponding template test case ID, if it is a filled test case
results: Array<{ // Results created for this test case in the run, newest first
id: number // Result ID
tcaseId: string // ID of the test case the result belongs to
tcaseVersion: number // Test case version the result was recorded against
authorId: number // ID of the user who added the result
author: { // The user who added the result
id: number // User ID
email: string // Email address of the user
name: string // Name of the user
avatar: string | null // Absolute URL of the avatar, null if none; fetching it requires authentication
role: string // Workspace role (`owner` | `admin` | `user` | `test-runner` | `viewer`)
}
status: string // Result status (`passed` | `failed` | `blocked` | `skipped` | `open` | `custom1` | `custom2` | `custom3` | `custom4`)
comment: html // Comments/observations while executing the test case
links: Array<{ // Issues linked to the result; null when it has none
id: number // Link ID, to remove it with `deleteLinkIds` in Update Result
resultId: number // ID of the result
integrationId: string | null // ID of the integration, null if it was deleted
integration: { // The integration, null if it was deleted
id: string // Integration ID
name: string // Name of the integration
type: string // Integration type (`jira` | `github` | `linear` | `custom`)
config: object // Tracker details, by type (see Get Result on the Results page)
} | null
url: string // URL of the issue
text: string // Title of the issue
meta: { id: string } | null // The issue's ID in the tracker (Jira and Linear links added by key or identifier hold the ID; older links may still hold the key or identifier); null when the link was added without meta
}> | null
timeTaken: number | null // Time taken for executing the test case, in milliseconds
isAutomated: boolean // Whether an automated test produced the result; `false` for a result a person reported
internal: boolean // Whether QA Sphere added the result, such as the reset to open when a test case is edited in an open run
createdAt: datetime // Creation time
}>
}Sample Response
{
"id": "1CEPaUhgH_Tvt2LZygwVRQa",
"version": 1,
"legacyId": "",
"type": "standalone",
"title": "Changing to corresponding cursor after hovering the element",
"seq": 1,
"folderId": 2,
"pos": 0,
"priority": "low",
"comment": "<p>The \"About Us\" page is opened</p>",
"precondition": {
"projectId": "2HKj57k3z_YXYQVTdnPqrs8",
"id": 1,
"version": 1,
"type": "standalone",
"text": "<p>The \"About Us\" page is opened</p>",
"isLatest": true,
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
},
"steps": [
{
"id": 1,
"version": 1,
"type": "standalone",
"description": "<p>Test the display across various screen sizes (desktop, tablet, mobile) to ensure that blocks and buttons adjust appropriately to different viewport widths</p>",
"isLatest": true
}
],
"tags": [
{
"id": 1,
"title": "About Us"
},
{
"id": 2,
"title": "Checklist"
}
],
"files": [],
"requirements": [],
"links": [],
"customFields": {},
"authorId": 1,
"createdAt": "2024-01-01T00:00:00.000Z",
"status": "blocked",
"isAutomated": false,
"hasManualResult": true,
"isLatestVersion": true,
"isEmpty": false,
"results": [
{
"id": 20293,
"tcaseId": "1CEPaUhgH_Tvt2LZygwVRQa",
"tcaseVersion": 1,
"authorId": 1,
"author": {
"id": 1,
"email": "owner@example.com",
"name": "System Owner",
"avatar": null,
"role": "owner"
},
"status": "blocked",
"comment": "",
"links": null,
"timeTaken": null,
"isAutomated": false,
"internal": false,
"createdAt": "2024-01-01T00:00:00.000Z"
}
]
}Errors
| Status Code | Description |
|---|---|
| 404 | The test case isn't in the run |
Update Run Test Case Version
Moves a run test case to the latest version of its test case. A run keeps the version it has results against (see Types of Runs); isLatestVersion in Get Run Test Case tells when a newer one exists.
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Request Body
{
updateToLatestVersion?: boolean // Move to the latest version; the test case's status in the run goes back to open
allowRunTCaseRemoval?: boolean // Live runs: remove the test case when its latest version no longer matches the run's filters
}Response
Status: 200 OK
{
message: string
removed: boolean // True when allowRunTCaseRemoval removed the test case from a live run instead of updating it
}Errors
| Status Code | Description |
|---|---|
| 400 | The run test case is already at the latest version |
| 404 | The test case isn't in the run |
| 409 | The run is closed; the latest version no longer matches a live run's filters and allowRunTCaseRemoval is not set |
Get Time Tracker
Get the time tracker of a run test case, using the test case's ID, sequence or legacy ID. Each test case in a run has at most one time tracker. It is the timer in the QA Sphere UI, and everyone working in the run shares it: any member with at least Test Runner role permissions can start or pause it, whoever started it. Adding a result without timeTaken uses the tracker's time (see Add Result). Removing the test case from the run removes its tracker.
Tracked time can be lost
- Adding a result for the test case removes its time tracker, whoever adds it. A result sent with
timeTakendiscards the tracker's time. - Closing the run stops its running trackers and does not keep the time of the interval that was running. Pause a tracker before the run closes to keep that time.
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/1/time-trackingResponse
Status: 200 OK
The time tracker (TimeTracker):
{
id: string // Time tracker ID
runId: number // ID of the run
tcaseId: string // ID of the test case
running: boolean // Whether the timer is running
duration: number // Time tracked so far, in milliseconds; includes the running interval
createdAt: datetime // Creation time
updatedAt: datetime // Last update time
}Example Response
{
"id": "1CGeNaNVt_Axa7TcMjUm6Zh",
"runId": 1,
"tcaseId": "1CEPaUhgH_Tvt2LZygwVRQa",
"running": true,
"duration": 95000,
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:01:20.000Z"
}Errors
| Status Code | Description |
|---|---|
| 404 | The test case isn't in the run, or it has no time tracker (none was started, or a result removed it) |
Start Time Tracker
Starts the time tracker of a run test case. Creates the tracker when the test case has none, otherwise resumes it. Starting a tracker does not pause the other trackers of the run. The request has no body.
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Example Request
curl \
-X POST \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/1/time-tracking/playResponse
Status: 200 OK
The time tracker, in the shape Get Time Tracker returns, with running true.
Errors
| Status Code | Description |
|---|---|
| 404 | The test case isn't in the run |
| 409 | The timer is already running; the run is closed |
Pause Time Tracker
Pauses the time tracker of a run test case and adds the running interval to its duration. A paused tracker holds at most 359,999,000 milliseconds (99:59
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Example Request
curl \
-X POST \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/1/time-tracking/pauseResponse
Status: 200 OK
The time tracker, in the shape Get Time Tracker returns, with running false.
Errors
| Status Code | Description |
|---|---|
| 404 | The test case isn't in the run, or it has no time tracker (none was started, or a result removed it) |
| 409 | The timer is not running; the run is closed |
List Running Time Trackers
Lists the running time trackers of the run, whoever started them. Use it to show which test cases are being timed instead of getting each test case's tracker. See Pagination for the offset-based contract.
Query Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
offset | number | Number of items to skip. | 0 | offset=10 |
limit | number | Maximum number of items to return. Accepted range: 0–1,000. | 100 | limit=20 |
sortField | string | Field to sort by: started_at or created_at. | started_at | sortField=created_at |
sortOrder | string | Sort direction for sortField: asc or desc. | desc | sortOrder=asc |
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/time-tracking/active/paginated?limit=100"Response
Status: 200 OK
{
total: number // Number of running trackers across all pages
offset: number // Offset applied to this response
limit: number // Limit applied to this response
data: TimeTracker[] // Running trackers in this page, in the shape Get Time Tracker returns
}Create Run Log
Create a log entry for a test run. A run log is about the run as a whole rather than one of its test cases, for example an automated test suite that failed to start, or other output from CI/CD pipelines and automation frameworks. Run logs can only be added through the public API, and not to closed runs.
Path Parameters
project_id: The project identifier (can be either the project code or UUID)run_id: The run identifier (numeric)
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Request Body
{
comment: string // Log message content (HTML supported, minimum 1 character)
}Field Constraints
comment: Must be at least 1 character long. HTML content is sanitized and leading/trailing whitespace is trimmed.
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
-d '{
"comment": "<p>Build #1234 failed: 3 test cases did not pass</p>"
}' \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/logResponse Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the run log |
Example Response
Status: 201 Created
{
"id": "1CGeNaNVt_Axa7TcMjUm6Zh"
}Error Responses
| Status Code | Description |
|---|---|
| 400 | An empty comment |
| 409 | Test run is closed |
List Run Logs
Returns the run's logs. A run log is a message about the run as a whole rather than one of its test cases, such as an automated test suite that failed to start. Automation adds them through Create Run Log.
Query Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
offset | number | Number of items to skip. | 0 | offset=10 |
limit | number | Maximum number of items to return. Accepted range: 0–1,000. | 100 | limit=20 |
sortField | string | Field to sort by: created_at or api_key_id to group the logs of each API key, newest first within each key. | created_at | sortField=api_key_id |
sortOrder | string | Sort direction for sortField: asc or desc. | desc | sortOrder=asc |
Response
Status: 200 OK
{
total: number // Number of matching logs across all pages
offset: number // Offset applied to this response
limit: number // Limit applied to this response
data: Array<{ // Logs in this page
id: string // Log ID
runId: number // ID of the run
comment: html // Log message
apiKey: { // API key that created the log (if any)
id: string
name: string
} | null
dismissed: boolean // Whether the log was dismissed in the web app
createdAt: datetime // Creation time
}>
}