Public API v1
A stable API for integrations, scripts, the agnox CLI and the Agnox MCP server. Everything under /api/v1 keeps its shape: fields are only ever added, and a breaking change ships as /api/v2.
Plans
The public API and the MCP server are included from the Starter plan. On Free, an API key answers 403 ENTITLEMENT_REQUIRED (feature: "publicApiAndMcp") on every route except POST /api/v1/reports (agnox report upload), which is part of External CI. Some routes also need their own capability, whoever calls them:
| Routes | Needs |
|---|---|
/automation-planner/* | automationPlanner (Team), and the Automation Planner switched on in Settings → Features |
/projects/:projectId/release-readiness*, POST /test-cases/quarantine | quarantineAndReleaseGate (Starter) |
POST /executions | hostedExecution (Starter) |
/test-cases* (except /test-cases/sync and quarantine), /test-cycles* | The Test Cases / Test Cycles module switched on (403 FEATURE_DISABLED otherwise) |
OpenAPI
| Format | URL |
|---|---|
| JSON | https://api.agnox.dev/api/openapi.json |
| YAML | https://api.agnox.dev/api/openapi.yaml |
The document is OpenAPI 3.1 and is generated from the same schemas that validate the routes, so it always matches the API. Import it into Postman, Insomnia or a client generator. Settings → My Profile → API & integrations links to both files.
Authentication
Create an API key in Settings → My Profile → API keys and send it in the x-api-key header:
curl -H "x-api-key: $AGNOX_API_KEY" https://api.agnox.dev/api/v1/projects
Authorization: Bearer <key> also works. A key acts with the role of the person who created it, inside their organization:
| Role | Can |
|---|---|
| Viewer | Read everything below and export test cases |
| Developer, Admin | Also trigger runs, quarantine tests, sync and import test cases |
Responses
Every response is { "success": true, "data": … } or { "success": false, "error": "…", "code": "…" }. Dates are ISO 8601 strings.
List endpoints take limit (1–100, default 25; larger values are clamped to 100) and offset, and return:
{ "items": [], "total": 0, "limit": 25, "offset": 0, "hasMore": false }
| Status | code | Meaning |
|---|---|---|
| 400 | INVALID_REQUEST (or UNKNOWN_FORMAT, INVALID_FILE, LIMIT_EXCEEDED, NOTHING_TO_IMPORT, INVALID_REPORT, EMPTY_REPORT, AMBIGUOUS_FORMAT) | The request is not valid |
| 401 | Missing, invalid or revoked key | |
| 403 | FORBIDDEN, ENTITLEMENT_REQUIRED, FEATURE_DISABLED, EXTERNAL_CI_DISABLED | The key's role may not do this, the plan does not include the capability (the body names feature and requiredPlan), the feature is off for the organization, or a quota is reached |
| 404 | NOT_FOUND, NOTHING_TO_EXPORT | Not found in your organization (another organization's ids are always 404) |
| 409 | CONFLICT | The cycle cannot take the run |
| 429 | Rate limited |
Rate limits
Limits are counted per organization, so every key in an organization shares one budget, in one-minute windows:
| Scope | Limit |
|---|---|
All /api/v1 endpoints | 100 requests per minute per organization |
POST /api/v1/executions (trigger a run) | Also 10 per minute per organization |
POST /api/v1/reports (upload a report) | Also 100 per minute per organization, so each shard of a sharded CI run can upload its own report |
| Failed authentication (missing or invalid key) | 30 per minute per client IP address |
Responses within the limit carry these headers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed in the window |
X-RateLimit-Remaining | Requests left in the current window |
X-RateLimit-Reset | When the window resets (ISO 8601) |
Over the limit, the API answers 429 with a body such as:
{ "success": false, "error": "Too Many Requests", "message": "API rate limit exceeded. Please try again in a moment.", "retryAfter": 42, "limit": 100, "window": 60000 }
retryAfter is in seconds. Wait that long before retrying. Polling a run every few seconds, as agnox trigger --wait does every 5 seconds, stays well inside the limit.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/projects | Projects: id, name, slug |
| GET | /api/v1/executions | Runs, newest first, each with its runName and groupName. Filters: projectId, status (comma-separated), groupName |
| POST | /api/v1/executions | Trigger a run. Same body as POST /api/ci/trigger. 201 { taskId, cycleId? } |
| GET | /api/v1/executions/{taskId} | One run with its counts |
| POST | /api/v1/reports | Upload JUnit XML or Allure results as a finished run. 201 { taskId, status, format, summary, … }. Developer or Admin key |
| GET | /api/v1/executions/{taskId}/failures | Failed tests with error, signature, file, test key, linked test case and page context |
| GET | /api/v1/test-cases | Test cases of a project. projectId (required), folderPath, tags, quarantined |
| GET | /api/v1/test-cases/{id} | One test case with steps. id is an id or a tcId such as AG-TC-12 |
| POST | /api/v1/test-cases/quarantine | Quarantine or release a test, by testCaseId or by projectId + testKey |
| POST | /api/v1/test-cases/sync | Register automated tests from code as test cases |
| GET | /api/v1/automation-planner/candidates | Manual test cases ranked for automation. projectId (required), folder, minPriority, includeExcluded, limit, offset |
| POST | /api/v1/automation-planner/brief | Steps, history and naming rule to automate manual test cases |
| POST | /api/v1/test-cases/export | Export test cases as files ({ files: [{ path, content }] }) |
| POST | /api/v1/test-cases/import | Import test cases from a file (see Import and export) |
| GET | /api/v1/test-cycles | Test cycles, newest first. Filter: projectId |
| GET | /api/v1/test-cycles/{id} | One cycle with its items |
| GET | /api/v1/failure-clusters | Most frequent failure signatures. projectId, days (1–30), limit. Needs Root Cause Analysis |
| GET | /api/v1/quality/unstable-tests | Tests that need attention: quarantined, scored D or F, or suspected regressions, with their Safe Auto-Quarantine metadata. projectId (required) |
| GET | /api/v1/quality/failing-test-context | One failing test without the whole run: error, stack snippet, last step, report URL, the run it came from (taskId, runName, groupName) and stability context. projectId (required); one of testId, testKey, testTitle (alias testName) or specFile; executionId (alias taskId), groupName. Without a run id, the newest of the last 30 FAILED/UNSTABLE runs holding the test is used, so a failure in an earlier shard is found |
| POST | /api/v1/executions/{taskId}/analysis | Root cause analysis of one failed test: diagnosis, classification with evidence, contextUsed. Body: testId or testTitle, forceRefresh. Needs Root Cause Analysis and your organization's AI key; Developer or Admin key |
| GET | /api/v1/quality/stability-timeline | Daily pass rate with the GitHub commits of the same window. projectId (required), days (7, 14 or 30, default 14) |
| GET | /api/v1/projects/{projectId}/release-readiness | Release Readiness Gate verdict (READY, REVIEW_REQUIRED, BLOCKED) with its checks, evaluated runs and blocking failures. branch, commit, environment, groupName |
| GET | /api/v1/projects/{projectId}/release-readiness/policy | The project's release gate policy, its defaults and the customized fields |
| PATCH | /api/v1/projects/{projectId}/release-readiness/policy | Change the release gate policy; null resets a field. Developer or Admin key |
| GET | /api/v1/quality/area-history | Quality history of a spec file, folder or keyword. projectId and pathOrPattern (required), days (1–30, default 30) |
Upload a report
POST /api/v1/reports records a finished External CI (or local) run from the JUnit XML files or Allure results of any framework. It is what agnox report upload calls.
| Field | Description |
|---|---|
projectId | Required. Project id |
files | Required. [{ "name": "TEST-login.xml", "content": "<testsuite …>" }], 1–2,000 files of text, at most 20 MB each; body limit 50 MB |
format | junit, allure or auto (default). auto refuses a mix of both formats (AMBIGUOUS_FORMAT) and unrecognised files (UNKNOWN_FORMAT) |
tool | Tool that produced the report, e.g. maestro, pytest |
source | external-ci (default) or local |
environment | development, qa, staging or production (default) |
groupName | Run group for the Dashboard's Grouped view, e.g. "Mobile CI #42". Trimmed and cut to 128 characters; empty means no group |
ciProvider, repository, branch, commitSha, prNumber, runUrl | Git and CI details, as on the Ingest API |
runName | Name of the run, e.g. "Android"; shown as the run's label in the dashboard, matched by the release gate's required run names, and the name of a cycle from createCycle. agnox report upload defaults it to the GitHub Actions job (GITHUB_JOB) |
createCycle, cycleId | Opt in to a Test Cycle, as on the Ingest API |
Send one request per device or platform (for example one for Android and one for iOS), with the same groupName: the files of one request become one run, and the same test in two of its files counts as a retry.
The response carries the run's taskId and status, a summary (total, passed, failed, skipped, flaky, attempts, durationMs), quarantineBypassed and any warnings. A report that cannot be read is answered with a 400 whose error names the file (and the line, for XML), and nothing is recorded. A report whose results would take more than 14 MB once stored (thousands of long failures) is refused with LIMIT_EXCEEDED: split it into several uploads. Refused with EXTERNAL_CI_DISABLED while External CI is off, and counted against the monthly external run quota. See JUnit XML & Allure Report Ingestion for how each report field is mapped.
Tests that need attention
GET /api/v1/quality/unstable-tests lists suspected regressions first. A suspected regression (regressionSuspected: the newest runs failed in a row; branchRegressionSuspected: it fails only on a feature branch) is a likely product bug: Agnox never auto-quarantines it, and it should not be treated as flaky.
{
"id": "6650…", "tcId": "AG-TC-12", "title": "checkout › pays with card", "file": "tests/checkout.spec.ts",
"isQuarantined": true, "quarantineSource": "auto", "quarantineReasonCode": "auto_flaky_retry",
"stabilityScore": "D", "regressionSuspected": false, "branchRegressionSuspected": false,
"protectedTagsMatched": [], "consecutivePassesSinceQuarantine": 2, "autoReleasePassThreshold": 3
}
quarantineReasonCode is auto_flaky_oscillation, auto_flaky_retry or manual. protectedTagsMatched lists the project's protected tags (such as @p0 or @smoke) the test carries; those tests are never auto-quarantined. consecutivePassesSinceQuarantine counts toward autoReleasePassThreshold.
Root cause analysis
POST /api/v1/executions/{taskId}/analysis with { "testId": "t1" } (or testTitle) returns:
{
"taskId": "run-k3j2", "testName": "checkout › pays with card", "file": "tests/checkout.spec.ts",
"testKey": "4c1f…", "failureSignature": "a1b2c3d4e5f6a7b8c9d0e1f2",
"rootCause": "…", "suggestedFix": "…", "cached": true,
"classification": "likely_broken_test",
"evidence": ["failure cluster correlation: test-code (high confidence)"],
"contextUsed": { "github": true, "repository": "acme/shop", "filePath": "tests/checkout.spec.ts", "commitSha": "9f2c…", "comparedFromSha": "41aa…" }
}
- The diagnosis is cached per error fingerprint.
cached: truemeans no AI tokens were spent. With"forceRefresh": true, Agnox reads the GitHub context again and asks your AI model for a new diagnosis, which replaces the saved one. classificationis one oflikely_product_regression,likely_broken_test,likely_flaky,likely_environment,likely_test_dataorunknown. It comes from signals Agnox already stores, not from the AI model: suspected regressions, the failure cluster's correlation, the quarantine reason and the stability grade. A regression signal always wins over a flaky one.evidencelists every signal that fired, strongest first.contextUsedis metadata only: it never contains code, tokens or credentials.- Errors:
403 FEATURE_DISABLEDwhen Root Cause Analysis is off,403 AI_NOT_CONFIGUREDwhen your organization has no AI key for its provider, and403 FORBIDDENfor a Viewer key.
Stability timeline
GET /api/v1/quality/stability-timeline?projectId=…&days=14 returns days (date, runs, passed, failed, passRate from 0 to 100, or null on a day without runs), totalRuns, and the GitHub commits (sha, message, author, date, url) made in the window, with the repository they come from. It uses no AI tokens. Local runs are left out. commits is empty when GitHub is not connected; see Stability Timeline.
Area quality history
GET /api/v1/quality/area-history?projectId=…&pathOrPattern=tests/checkout summarises one area of your suite. pathOrPattern is literal text, matched case-insensitively against spec files, test titles and folder paths. The response has:
risk:highwhen the area has a suspected regression or a failure cluster classified as a regression,mediumwith recent failures or flaky or quarantined tests,lowotherwise.summary: counts of matching test cases, runs scanned, recent failures, failing tests, quarantined, flaky and suspected-regression tests, and active failure clusters.regressionSuspected,flakyOrQuarantinedandtestCases: test references with their grade, quarantine reason and protected tags.failingTests: failures per test in the window, with the last failure time and signature.clusters: the failure clusters behind those failures.clustersAvailableisfalsewhen Root Cause Analysis is off.
It reads stored data only: no AI tokens, no writes. Lists are capped at 20.
Release readiness
GET /api/v1/projects/{projectId}/release-readiness returns a deterministic verdict (READY, REVIEW_REQUIRED or BLOCKED), a summary, the checks (each with id, status pass/warn/fail, summary and evidence of run ids, test keys and counts), the evaluated runs, blockingFailures, quarantinedFailures and a dashboardUrl. Local runs never count. Without commit or groupName, the latest run's group (or commit) is evaluated. The thresholds come from the project's policy (GET/PATCH …/release-readiness/policy), the same policy as Settings → Run Settings → Release Gate Policy. In CI, agnox gate check calls this endpoint; coding agents use the get_release_readiness MCP tool. See Release Readiness Gate.
Run summary
{
"taskId": "run-k3j2", "projectId": "665f…", "status": "FAILED",
"environment": "staging", "trigger": "github", "groupName": "Nightly",
"startTime": "2026-11-12T08:00:00.000Z", "endTime": "2026-11-12T08:04:10.000Z", "durationMs": 250000,
"total": 120, "passed": 117, "failed": 3
}
Failures
GET /api/v1/executions/{taskId}/failures returns the run's taskId, projectId and items:
{
"name": "checkout › pays with card",
"file": "tests/checkout.spec.ts",
"testKey": "4c1f…",
"testCaseId": "6650…",
"error": "TimeoutError: locator.click: Timeout 5000ms exceeded…",
"failureSignature": "a1b2c3d4e5f6a7b8c9d0e1f2",
"isQuarantined": false,
"attemptCount": 2,
"context": {
"failureUrl": "https://shop.test/pay",
"pageTitle": "Pay",
"consoleErrors": ["…"],
"networkErrors": [{ "url": "https://shop.test/api/pay", "status": 500, "method": "POST" }],
"testIds": ["pay-button"],
"domSnapshot": "<button data-testid=\"pay-button\">Pay</button>"
}
}
testIds and domSnapshot are the locator context the Playwright reporter captured at the moment of failure, the input for repairing a broken locator.
Quarantine
# By test key, from a failure (the test case is created if it has none yet)
curl -X POST -H "x-api-key: $AGNOX_API_KEY" -H "content-type: application/json" \
https://api.agnox.dev/api/v1/test-cases/quarantine \
-d '{"projectId":"665f…","testKey":"4c1f…","title":"checkout › pays with card","quarantined":true}'
Sync test cases from code
POST /api/v1/test-cases/sync with { projectId, tests: [{ file, titlePath }] } (at most 500) computes each test's key and makes sure an automated test case exists for it. A title that names a manual test case by its key (AG-TC-12: Sign in) turns that case into the automated one; so does an exact, unambiguous title match. The response counts received, created, promoted (manual cases that became automated), alreadyLinked and skipped (entries whose key cannot be computed).
Automation Planner
GET /api/v1/automation-planner/candidates?projectId=… returns candidates, best first, each with caseKey, score (0–100), priority, reasons, manualRunCount, manualFailureCount, lastManualRunAt, stepCount and hasPreconditions. minPriority is the lowest priority to return: CRITICAL, HIGH, MEDIUM or LOW. Page with offset and limit (at most 100); total counts every match. Cases the team marked not automatable, or filed under a suite the project excludes, are left out and counted in notAutomatableCount; includeExcluded=true returns them too, each with an exclusion (source: case or suite, reason, suite). excludedSuites lists the project's excluded suites.
POST /api/v1/automation-planner/brief with { projectId, caseKeys, testCaseIds } (at most 30 test cases, either list is enough) returns each case with its ordered steps, plus repository, taggingRule and a ready agentPrompt. Cases that are missing or already automated are listed in unavailable. Viewer keys can call both, and neither uses AI. See Automation Planner.
Tools built on this API
- MCP server for Claude Code, Cursor, Claude Desktop and Windsurf:
npx -y @agnox/mcp-server agnoxCLI for terminals and CI:npx -y @agnox/mcp-server@latest --help
Both ship in the @agnox/mcp-server npm package.