TESTMETRIX API Reference
TESTMETRIX exposes a fully documented REST API built with Django REST Framework and documented with drf-spectacular (OpenAPI 3).
Interactive Documentation
The easiest way to explore the API is via the hosted Swagger UI:
https://app.testmetrix.ai/api/schema/swagger-ui/
The raw OpenAPI 3 schema is available at:
https://app.testmetrix.ai/api/schema/
Authentication
All API endpoints require authentication. TESTMETRIX uses Token authentication.
Obtain a Token
curl -X POST https://app.testmetrix.ai/api/login/ \
-H "Content-Type: application/json" \
-d '{"username": "your_username", "password": "your_password"}'
Response:
{
"token": "9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b",
"user": { "id": 1, "username": "your_username", "email": "you@example.com" }
}
Use the Token
Include the token in the Authorization header for all subsequent requests:
curl https://app.testmetrix.ai/api/projects/ \
-H "Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
Key Endpoints
Projects & Infrastructure
| Method | Endpoint | Description |
|---|---|---|
GET | /api/projects/ | List all projects |
POST | /api/projects/ | Create a project |
GET | /api/projects/{id}/ | Get project details |
GET | /api/projects/{id}/activity/ | Project audit activity log |
GET | /api/hils/ | List HiL systems |
POST | /api/hils/ | Create a HiL system |
GET | /api/hils/usage/ | HiL usage statistics |
POST | /api/hils/bulk-delete/ | Delete multiple HiL systems |
Pipelines & Test Runs
| Method | Endpoint | Description |
|---|---|---|
GET | /api/pipelines/ | List pipeline definitions |
POST | /api/pipelines/ | Create a pipeline definition |
GET | /api/pipeline-executions/ | List pipeline executions |
POST | /api/pipelines/{pipeline_id}/runs/ | Upload JUnit XML and create a test run |
GET | /api/test_run_overview/ | List test runs with pass/fail statistics |
GET | /api/test_run_overview/export/csv/ | Export test run overview as CSV |
GET | /api/test_run_detailed/{test_run_id}/ | Detailed test run with per-case results |
GET | /api/runs/{run_id}/junit/download/ | Download original JUnit XML |
Coverage
| Method | Endpoint | Description |
|---|---|---|
POST | /api/runs/{run_id}/coverage/ | Upload Cobertura XML coverage report |
GET | /api/runs/{run_id}/coverage/download/ | Download coverage XML |
GET | /api/coverage-reports/ | List coverage reports |
GET | /api/coverage-reports/{id}/packages/ | List packages in a coverage report |
GET | /api/coverage-reports/packages/{id}/files/ | List files in a package |
GET | /api/coverage-reports/files/{id}/lines/ | List coverage lines in a file |
Metrics & Artifacts
| Method | Endpoint | Description |
|---|---|---|
POST | /api/runs/{run_id}/metrics/ | Upload run-level time-series metric |
POST | /api/runs/{run_id}/testcases/{testcase_id}/metrics/ | Upload test-case-level metric |
POST | /api/runs/{run_id}/testcases/{testcase_id}/artifacts/ | Upload test case artifact |
POST | /api/runs/{run_id}/hil-config/ | Upload HiL YAML configuration |
Verification Domain
| Method | Endpoint | Description |
|---|---|---|
GET | /api/verification-projects/ | List verification projects |
POST | /api/verification-projects/ | Create a verification project |
GET | /api/verification-projects/{id}/metrics/ | Coverage & testcase metrics |
GET/POST | /api/verification-projects/{id}/attachments/ | List / upload attachments |
GET | /api/requirement-projects/ | List requirements projects |
POST | /api/requirement-projects/ | Create a requirements project |
GET | /api/requirement-projects/{id}/metrics/ | HLR/LLR coverage metrics |
GET | /api/requirement-projects/{id}/hlr/ | List High-Level Requirements |
POST | /api/requirement-projects/{id}/hlr/ | Create an HLR |
GET | /api/requirement-projects/hlr/{hlr_id}/llr/ | List Low-Level Requirements |
POST | /api/requirement-projects/hlr/{hlr_id}/llr/ | Create an LLR |
GET | /api/requirement-projects/hlr/{hlr_id}/references/ | List HLR references |
GET | /api/requirement-projects/llr/{llr_id}/references/ | List LLR references |
GET | /api/testcase-projects/ | List testcase projects |
POST | /api/testcase-projects/ | Create a testcase project |
GET | /api/testcase-projects/{id}/testcases/ | List testcases |
POST | /api/testcase-projects/{id}/testcases/ | Create a testcase |
User Management & Audit
| Method | Endpoint | Description |
|---|---|---|
GET | /api/users/ | List users (staff only) |
POST | /api/users/ | Create a user (staff only) |
GET | /api/users/me/ | Get current user profile |
GET | /api/roles/ | List roles |
GET | /api/audit/ | Full audit log (staff only) |
Pagination
List endpoints are paginated. The default page size is 20. Use ?page=2 to navigate.
{
"count": 142,
"next": "https://app.testmetrix.ai/api/requirement-projects/?page=2",
"previous": null,
"results": [...]
}
CI/CD Integration Example
Here is a minimal shell script to upload JUnit results from a CI pipeline:
#!/bin/bash
# upload-results.sh — run after your test suite completes
API_URL="https://app.testmetrix.ai/testmetrix/api"
TOKEN="${TESTMETRIX_API_TOKEN}"
PIPELINE_ID="${TESTMETRIX_PIPELINE_ID}"
JUNIT_FILE="test-results.xml"
HIL_NAME="HIL-01"
curl -sS -X POST "${API_URL}/pipelines/${PIPELINE_ID}/runs/" \
-H "Authorization: Token ${TOKEN}" \
-F "junit_file=@${JUNIT_FILE}" \
-F "hil_name=${HIL_NAME}"
Set TESTMETRIX_API_TOKEN and TESTMETRIX_PIPELINE_ID as CI/CD variables in your GitLab project.
Full Schema
For the complete, up-to-date API specification, refer to the hosted docs:
- Swagger UI — try endpoints interactively
- OpenAPI YAML — download the raw schema