Skip to main content

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:

RoutesNeeds
/automation-planner/*automationPlanner (Team), and the Automation Planner switched on in Settings → Features
/projects/:projectId/release-readiness*, POST /test-cases/quarantinequarantineAndReleaseGate (Starter)
POST /executionshostedExecution (Starter)
/test-cases* (except /test-cases/sync and quarantine), /test-cycles*The Test Cases / Test Cycles module switched on (403 FEATURE_DISABLED otherwise)

OpenAPI​

FormatURL
JSONhttps://api.agnox.dev/api/openapi.json
YAMLhttps://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:

RoleCan
ViewerRead everything below and export test cases
Developer, AdminAlso 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 }
StatuscodeMeaning
400INVALID_REQUEST (or UNKNOWN_FORMAT, INVALID_FILE, LIMIT_EXCEEDED, NOTHING_TO_IMPORT, INVALID_REPORT, EMPTY_REPORT, AMBIGUOUS_FORMAT)The request is not valid
401Missing, invalid or revoked key
403FORBIDDEN, ENTITLEMENT_REQUIRED, FEATURE_DISABLED, EXTERNAL_CI_DISABLEDThe 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
404NOT_FOUND, NOTHING_TO_EXPORTNot found in your organization (another organization's ids are always 404)
409CONFLICTThe cycle cannot take the run
429Rate limited

Rate limits​

Limits are counted per organization, so every key in an organization shares one budget, in one-minute windows:

ScopeLimit
All /api/v1 endpoints100 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:

HeaderMeaning
X-RateLimit-LimitRequests allowed in the window
X-RateLimit-RemainingRequests left in the current window
X-RateLimit-ResetWhen 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​

MethodPathDescription
GET/api/v1/projectsProjects: id, name, slug
GET/api/v1/executionsRuns, newest first, each with its runName and groupName. Filters: projectId, status (comma-separated), groupName
POST/api/v1/executionsTrigger 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/reportsUpload JUnit XML or Allure results as a finished run. 201 { taskId, status, format, summary, … }. Developer or Admin key
GET/api/v1/executions/{taskId}/failuresFailed tests with error, signature, file, test key, linked test case and page context
GET/api/v1/test-casesTest 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/quarantineQuarantine or release a test, by testCaseId or by projectId + testKey
POST/api/v1/test-cases/syncRegister automated tests from code as test cases
GET/api/v1/automation-planner/candidatesManual test cases ranked for automation. projectId (required), folder, minPriority, includeExcluded, limit, offset
POST/api/v1/automation-planner/briefSteps, history and naming rule to automate manual test cases
POST/api/v1/test-cases/exportExport test cases as files ({ files: [{ path, content }] })
POST/api/v1/test-cases/importImport test cases from a file (see Import and export)
GET/api/v1/test-cyclesTest cycles, newest first. Filter: projectId
GET/api/v1/test-cycles/{id}One cycle with its items
GET/api/v1/failure-clustersMost frequent failure signatures. projectId, days (1–30), limit. Needs Root Cause Analysis
GET/api/v1/quality/unstable-testsTests 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-contextOne 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}/analysisRoot 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-timelineDaily 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-readinessRelease 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/policyThe project's release gate policy, its defaults and the customized fields
PATCH/api/v1/projects/{projectId}/release-readiness/policyChange the release gate policy; null resets a field. Developer or Admin key
GET/api/v1/quality/area-historyQuality 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.

FieldDescription
projectIdRequired. Project id
filesRequired. [{ "name": "TEST-login.xml", "content": "<testsuite …>" }], 1–2,000 files of text, at most 20 MB each; body limit 50 MB
formatjunit, allure or auto (default). auto refuses a mix of both formats (AMBIGUOUS_FORMAT) and unrecognised files (UNKNOWN_FORMAT)
toolTool that produced the report, e.g. maestro, pytest
sourceexternal-ci (default) or local
environmentdevelopment, qa, staging or production (default)
groupNameRun 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, runUrlGit and CI details, as on the Ingest API
runNameName 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, cycleIdOpt 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: true means 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.
  • classification is one of likely_product_regression, likely_broken_test, likely_flaky, likely_environment, likely_test_data or unknown. 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. evidence lists every signal that fired, strongest first.
  • contextUsed is metadata only: it never contains code, tokens or credentials.
  • Errors: 403 FEATURE_DISABLED when Root Cause Analysis is off, 403 AI_NOT_CONFIGURED when your organization has no AI key for its provider, and 403 FORBIDDEN for 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: high when the area has a suspected regression or a failure cluster classified as a regression, medium with recent failures or flaky or quarantined tests, low otherwise.
  • summary: counts of matching test cases, runs scanned, recent failures, failing tests, quarantined, flaky and suspected-regression tests, and active failure clusters.
  • regressionSuspected, flakyOrQuarantined and testCases: 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. clustersAvailable is false when 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
  • agnox CLI for terminals and CI: npx -y @agnox/mcp-server@latest --help

Both ship in the @agnox/mcp-server npm package.