scan_coverage
Start an AI coverage scan: it reads the connected source repository, enumerates source files, and derives the application's user-facing areas (framework-agnostic). Returns immediately; the scan runs in the background (duration depends on repository size and scan work).
Needs a connected source repo (Settings → App Repository). Rejected with 409 conflict if a scan is already running, or if no repository is connected.
Request
POST /api/v1/ops/projects/{project}/coverage/scan
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
project | path | string | yes | The project's public id. |
- cURL
- CLI
- MCP
curl -X POST -H "Authorization: Bearer $TESTVIBE_API_KEY" \
"$TESTVIBE_SERVER/api/v1/ops/projects/$PROJECT/coverage/scan"
testvibe coverage scan --wait --timeout 1200
Tool scan_coverage — optional project. Poll get_coverage until scan.status leaves running.
Response
202 Accepted
{ "scanId": 88, "requestId": "9f3c…", "status": "running" }
Poll get_coverage until scan.status is succeeded or failed. A missing status is not an outcome — keep polling.
testvibe coverage scan --wait polls for you, bounded by --timeout <seconds> (default 5400; 0 waits indefinitely; env TESTVIBE_WAIT_TIMEOUT_SECONDS). A wait that ends before the scan does exits 3 — no verdict — not 1. See the CLI wait contract.
Errors
| HTTP | When |
|---|---|
404 not_found | No such project in this workspace. |
409 conflict | A scan is already running, or no source repository is connected. |