Skip to main content

Test Management API

These endpoints cover the core of ProvaLab.io: creating projects, writing test cases, organizing them into plans, executing runs, and recording results.


Projects

List projects

GET /api/v1/organizations/{organization_id}/projects
ParameterInTypeRequiredDescription
organization_idpathintegerYesOrganization ID
pagequeryintegerNoPage number (default: 1)
page_sizequeryintegerNoItems per page (default: 20, max: 100)
statusquerystringNoFilter: active, archived, completed
searchquerystringNoSearch in name and description
curl https://your-tms-instance.com/api/v1/organizations/1/projects \
-H "Authorization: Bearer YOUR_TOKEN"

Response 200 OK

{
"items": [
{
"id": 1,
"name": "E-Commerce Platform",
"slug": "ecommerce",
"description": "Main e-commerce application",
"status": "active",
"created_at": "2025-11-15T10:00:00Z"
}
],
"total": 1,
"page": 1,
"page_size": 20,
"total_pages": 1
}

Create a project

POST /api/v1/organizations/{organization_id}/projects
FieldTypeRequiredDescription
namestringYesProject name
slugstringNoURL-friendly identifier (auto-generated if omitted)
descriptionstringNoProject description
statusstringNoactive (default), archived, completed
settingsobjectNoProject-level settings
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/projects \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "E-Commerce Platform",
"slug": "ecommerce",
"description": "Main e-commerce application",
"settings": {
"enable_ci_integration": true,
"default_test_environment": "staging"
}
}'

Response 201 Created

{
"id": 1,
"organization_id": 1,
"name": "E-Commerce Platform",
"slug": "ecommerce",
"description": "Main e-commerce application",
"status": "active",
"created_by_id": 1,
"created_at": "2025-11-15T10:00:00Z",
"updated_at": "2025-11-15T10:00:00Z"
}

Get a project

GET /api/v1/organizations/{organization_id}/projects/{project_id}
curl https://your-tms-instance.com/api/v1/organizations/1/projects/1 \
-H "Authorization: Bearer YOUR_TOKEN"

Response 200 OK

{
"id": 1,
"organization_id": 1,
"name": "E-Commerce Platform",
"slug": "ecommerce",
"description": "Main e-commerce application",
"status": "active",
"created_by_id": 1,
"created_at": "2025-11-15T10:00:00Z",
"updated_at": "2025-11-15T10:00:00Z",
"members_count": 5,
"test_cases_count": 150,
"modules": [
{
"id": 1,
"name": "Authentication",
"description": "User authentication module"
}
]
}

Update a project

PUT /api/v1/organizations/{organization_id}/projects/{project_id}
curl -X PUT https://your-tms-instance.com/api/v1/organizations/1/projects/1 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "E-Commerce Platform (v2)",
"description": "Updated e-commerce platform"
}'

Delete a project

DELETE /api/v1/organizations/{organization_id}/projects/{project_id}
curl -X DELETE https://your-tms-instance.com/api/v1/organizations/1/projects/1 \
-H "Authorization: Bearer YOUR_TOKEN"

Response 204 No Content


Test cases

List test cases

GET /api/v1/test-management/cases
ParameterInTypeRequiredDescription
test_suite_idqueryintegerNoFilter by suite
lifecycle_statusquerystringNodraft, review, approved, deprecated
searchquerystringNoSearch in title and description
pagequeryintegerNoPage number (default: 1)
page_sizequeryintegerNoItems per page (default: 20)
curl "https://your-tms-instance.com/api/v1/test-management/cases?test_suite_id=1&lifecycle_status=approved" \
-H "Authorization: Bearer YOUR_TOKEN"

Response 200 OK

{
"items": [
{
"id": 1,
"title": "Verify successful login with valid credentials",
"priority": "high",
"type": "functional",
"lifecycle_status": "approved",
"created_at": "2025-11-15T10:00:00Z"
}
],
"total": 1,
"page": 1,
"page_size": 20,
"total_pages": 1
}

Create a test case

POST /api/v1/test-management/cases?test_suite_id={suite_id}
FieldTypeRequiredDescription
titlestringYesTest case title
descriptionstringNoDetailed description
prioritystringNolow, medium, high, critical
typestringNofunctional, regression, smoke, performance, security
lifecycle_statusstringNodraft (default)
preconditionsstringNoRequired setup before test execution
stepsarrayNoOrdered test steps (see below)
expected_resultstringNoOverall expected outcome
tagsarrayNoTags for categorization

Each step in the steps array:

FieldTypeRequiredDescription
step_numberintegerYesStep order (1, 2, 3...)
actionstringYesWhat to do
expected_resultstringYesWhat should happen
curl -X POST "https://your-tms-instance.com/api/v1/test-management/cases?test_suite_id=1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Verify successful login with valid credentials",
"description": "Test that users can log in with correct email and password",
"priority": "high",
"type": "functional",
"preconditions": "User account exists in the system",
"steps": [
{
"step_number": 1,
"action": "Navigate to login page",
"expected_result": "Login form is displayed"
},
{
"step_number": 2,
"action": "Enter valid email and password",
"expected_result": "Credentials are accepted"
},
{
"step_number": 3,
"action": "Click login button",
"expected_result": "User is redirected to dashboard"
}
],
"expected_result": "User successfully logs in and sees dashboard",
"tags": ["authentication", "login", "smoke"]
}'

Response 201 Created

{
"id": 1,
"test_suite_id": 1,
"title": "Verify successful login with valid credentials",
"description": "Test that users can log in with correct email and password",
"priority": "high",
"type": "functional",
"lifecycle_status": "draft",
"created_by_id": 1,
"created_at": "2025-11-15T10:00:00Z",
"steps": [
{
"step_number": 1,
"action": "Navigate to login page",
"expected_result": "Login form is displayed"
}
]
}

Get a test case

GET /api/v1/test-management/cases/{case_id}
curl https://your-tms-instance.com/api/v1/test-management/cases/1 \
-H "Authorization: Bearer YOUR_TOKEN"

Update a test case

PUT /api/v1/test-management/cases/{case_id}
curl -X PUT https://your-tms-instance.com/api/v1/test-management/cases/1 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated test case title",
"priority": "critical"
}'

Change lifecycle status

Move a test case through the review workflow: draft -> review -> approved -> deprecated.

POST /api/v1/test-management/cases/{case_id}/lifecycle
FieldTypeRequiredDescription
new_statusstringYesTarget status
commentstringNoReason for the status change
curl -X POST https://your-tms-instance.com/api/v1/test-management/cases/1/lifecycle \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"new_status": "approved",
"comment": "Reviewed and approved by QA lead"
}'

Delete a test case

DELETE /api/v1/test-management/cases/{case_id}
curl -X DELETE https://your-tms-instance.com/api/v1/test-management/cases/1 \
-H "Authorization: Bearer YOUR_TOKEN"

Response 204 No Content


Test suites

Test suites group related test cases together (e.g., "Login Tests", "Payment Tests").

List test suites

GET /api/v1/organizations/{organization_id}/test-suites?module_id={module_id}
curl "https://your-tms-instance.com/api/v1/organizations/1/test-suites?module_id=1" \
-H "Authorization: Bearer YOUR_TOKEN"

Create a test suite

POST /api/v1/test-management/suites?module_id={module_id}
curl -X POST "https://your-tms-instance.com/api/v1/test-management/suites?module_id=1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "User Authentication Tests",
"description": "Test suite for login, logout, and password management",
"priority": "high"
}'

Response 201 Created

{
"id": 1,
"module_id": 1,
"name": "User Authentication Tests",
"description": "Test suite for login, logout, and password management",
"priority": "high",
"created_at": "2025-11-15T10:00:00Z"
}

Test plans

Test plans define which test cases to execute for a release, sprint, or testing cycle.

List test plans

GET /api/v1/organizations/{organization_id}/test-plans
ParameterInTypeRequiredDescription
project_idqueryintegerNoFilter by project
statusquerystringNodraft, in_review, approved, active, completed, archived
test_plan_typequerystringNosmoke, sanity, regression, system, integration, uat, performance, security, e2e
priorityquerystringNolow, medium, high, critical
curl "https://your-tms-instance.com/api/v1/organizations/1/test-plans?project_id=1&status=active" \
-H "Authorization: Bearer YOUR_TOKEN"

Create a test plan

POST /api/v1/organizations/{organization_id}/test-plans
FieldTypeRequiredDescription
namestringYesTest plan name
project_idintegerYesProject ID
test_plan_typestringYesSee type options above
prioritystringNolow, medium (default), high, critical
descriptionstringNoPlan description
objectivesstringNoTesting objectives
target_pass_ratenumberNoTarget pass rate (default: 95.0)
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/test-plans \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Sprint 12 Regression",
"project_id": 1,
"test_plan_type": "regression",
"priority": "high",
"description": "Full regression for Sprint 12 release",
"target_pass_rate": 95.0
}'

Response 201 Created

{
"id": 1,
"name": "Sprint 12 Regression",
"project_id": 1,
"test_plan_type": "regression",
"status": "draft",
"priority": "high",
"target_pass_rate": 95.0,
"created_at": "2025-11-15T10:00:00Z"
}

Test runs

Test runs are executions of a test plan or a set of test cases.

Create a test run

POST /api/v1/organizations/{organization_id}/test-runs
FieldTypeRequiredDescription
namestringYesRun name
project_idintegerYesProject ID
test_plan_idintegerNoTest plan ID
environmentstringNodev, staging, prod
test_case_idsarrayNoSpecific test case IDs to include
assigned_to_idintegerNoAssignee user ID
configurationobjectNoRun configuration (browser, OS, build number)
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/test-runs \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Sprint 10 Regression",
"project_id": 1,
"test_plan_id": 1,
"environment": "staging",
"test_case_ids": [1, 2, 3, 4, 5],
"configuration": {
"browser": "chrome",
"os": "linux",
"build_number": "1.2.3"
}
}'

Response 201 Created

{
"id": 1,
"name": "Sprint 10 Regression",
"project_id": 1,
"status": "pending",
"environment": "staging",
"total_test_cases": 5,
"executed": 0,
"passed": 0,
"failed": 0,
"skipped": 0,
"created_at": "2025-11-15T10:00:00Z"
}

Start a test run

POST /api/v1/organizations/{organization_id}/test-runs/{run_id}/start
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/test-runs/1/start \
-H "Authorization: Bearer YOUR_TOKEN"

Response 200 OK

{
"id": 1,
"status": "running",
"started_at": "2025-11-15T10:00:00Z"
}

Get test run details

GET /api/v1/organizations/{organization_id}/test-runs/{run_id}
curl https://your-tms-instance.com/api/v1/organizations/1/test-runs/1 \
-H "Authorization: Bearer YOUR_TOKEN"

Response 200 OK

{
"id": 1,
"name": "Sprint 10 Regression",
"project_id": 1,
"status": "running",
"environment": "staging",
"total_test_cases": 5,
"executed": 3,
"passed": 2,
"failed": 1,
"skipped": 0,
"progress": 60,
"started_at": "2025-11-15T10:00:00Z",
"results": [
{
"test_case_id": 1,
"status": "passed",
"duration": 2.5,
"executed_at": "2025-11-15T10:01:00Z"
},
{
"test_case_id": 2,
"status": "failed",
"duration": 3.2,
"error_message": "Assertion failed: Expected 'Welcome' but got 'Error'",
"executed_at": "2025-11-15T10:02:00Z"
}
]
}

Record a test result

Submit the result for an individual test case within a run.

POST /api/v1/organizations/{organization_id}/test-runs/{run_id}/results
FieldTypeRequiredDescription
test_case_idintegerYesTest case ID
statusstringYespassed, failed, skipped, blocked
durationnumberNoExecution time in seconds
executed_by_idintegerNoUser who ran the test
executed_atstringNoISO 8601 timestamp
commentstringNoNotes about the result
artifactsarrayNoScreenshots, logs, etc.
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/test-runs/1/results \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"test_case_id": 1,
"status": "passed",
"duration": 2.5,
"executed_by_id": 1,
"comment": "Test passed on first attempt",
"artifacts": [
{
"type": "screenshot",
"url": "https://storage.example.com/screenshots/run1-tc1.png"
}
]
}'

Response 201 Created

{
"id": 1,
"test_run_id": 1,
"test_case_id": 1,
"status": "passed",
"duration": 2.5,
"executed_at": "2025-11-15T10:01:00Z"
}

Complete a test run

Mark a test run as finished.

POST /api/v1/organizations/{organization_id}/test-runs/{run_id}/complete
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/test-runs/1/complete \
-H "Authorization: Bearer YOUR_TOKEN"

Response 200 OK

{
"id": 1,
"status": "completed",
"completed_at": "2025-11-15T11:00:00Z",
"summary": {
"total": 5,
"passed": 4,
"failed": 1,
"skipped": 0,
"pass_rate": 80.0
}
}

Practical example: end-to-end workflow

Here is a complete workflow showing how to create a project, add a test case, run it, and record the result:

# 1. Create a project
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/projects \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "My App", "slug": "myapp"}'

# 2. Create a test case (assuming test suite ID 1 exists)
curl -X POST "https://your-tms-instance.com/api/v1/test-management/cases?test_suite_id=1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Homepage loads within 3 seconds",
"priority": "high",
"type": "performance"
}'

# 3. Create a test run
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/test-runs \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Quick Smoke Test",
"project_id": 1,
"environment": "staging",
"test_case_ids": [1]
}'

# 4. Start the run
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/test-runs/1/start \
-H "Authorization: Bearer YOUR_TOKEN"

# 5. Record the result
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/test-runs/1/results \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"test_case_id": 1,
"status": "passed",
"duration": 1.8
}'

# 6. Complete the run
curl -X POST https://your-tms-instance.com/api/v1/organizations/1/test-runs/1/complete \
-H "Authorization: Bearer YOUR_TOKEN"

Next steps

  • Integrations API -- Set up webhooks and connect Jira, Slack, and GitHub
  • AI API -- Generate test cases and analyze failures with AI