# TestNeo REST contracts used by n8n templates All calls use: ```http Authorization: Bearer Content-Type: application/json ``` Base URL: **`https://app.testneo.ai`** for production customers. `http://127.0.0.1:8001` is **self-hosted dev only** — do not point production n8n at localhost. These are the **same** routes MCP / `demo-agent-checkout` use. There is no separate “n8n API.” --- ## 1. Ingest AgentRunSummary (Template 1 + 2) ```http POST /api/web/v1/projects/{project_id}/unified-contexts/ingest/agent-run ``` **Body:** ```json { "summary": { /* agent_run_summary.v1 — see fixtures/ */ }, "upsert": true, "generate_tests": false, "max_tests": 6, "include_ui_tests": true, "include_api_tests": true } ``` **Success (200):** `context_id`, `entity_count`, `agent_run_id`, `contract_version: agent_run_ingest.v1` --- ## 2. Semantic assert (Template 1) ```http POST /api/web/v1/semantic-assert ``` **Body:** ```json { "actual": "Agent claim text…", "expected_meaning": "What success means…", "threshold": 0.75, "project_id": 14 } ``` **Success (200):** `passed` (bool), `similarity_score`, `threshold`, `contract_version: semantic_assert.v1` --- ## 3. Execute golden test (Template 1) ```http POST /api/web/v1/test-cases/{test_case_id}/execute ``` **Body:** ```json { "execution_source": "n8n_post_agent_verification", "trigger_reason": "post_agent_gate", "environment_name": "staging" } ``` Optional: `"use_agent": true` when `TESTNEO_USE_AGENT=true` — requires TestNeo **local agent** connected (`GET /api/web/v1/agents/my-agent` → `agent_connected: true`). Default (omit or false) = **cloud execution**. **Success (200):** response includes `execution_id` (top-level or under `data`). --- ## 4. Poll execution (Template 1) ```http GET /api/web/v1/analytics/execution/{execution_id}/summary ``` **Terminal statuses (case-insensitive):** `passed` / `pass` / `success` / `successful` / `completed` / `complete` `failed` / `fail` / `error` / `errored` / `timed_out` / `timeout` / `cancelled` / `canceled` / `aborted` / `terminated` **Pass subset:** `passed` / `pass` / `success` / `successful` / `completed` / `complete` Dashboard: `{WEB_APP_URL}/test-runner/execution/{execution_id}` --- ## 5. Mark deployed / create outcome stub (Template 3) ```http POST /api/web/v1/release-readiness/outcome ``` ```json { "project_id": 14, "bundle_id": "", "release_name": "optional", "confidence_at_ship": 89, "gate_status_at_ship": "GATE_PASS" } ``` --- ## 6. List outcomes (Template 3) ```http GET /api/web/v1/release-readiness/outcomes?project_id={id}&limit=30 ``` --- ## 7. Record outcome (Template 3) ```http PATCH /api/web/v1/release-readiness/outcome/{outcome_id} ``` ```json { "rollback": false, "incident_within_7d": false, "incident_within_30d": false, "hotfix_pr_count": 0, "outcome_notes": "Clean ship" } ```