Synchronize Scan Completion or Request Verified Refund
vulkill_complete_scanSyncs remote scanner state for an existing scan to finalize verified findings or issue an atomic credit refund when the job never started.
Instructions
Synchronize the remote scanner engine state for an existing scanId, finalizing verified findings or issuing an atomic credit refund when the engine confirms the job never started. Call after vulkill_start_scan to settle an active job. Do not use to start new scans (use vulkill_start_scan) or to browse workspace history (use vulkill_list_reports). The scanId must belong to the caller's workspace. Refund verification triggers when cancelRequested=true or started=false (cancelRequested takes precedence when both are passed, and omitting both runs normal completion sync), while summary is ignored when finalized findings exist and saved only as an audit note when a not_started job is refunded. Requires scan-owner VULKILL_API_KEY or OAuth 2.1 auth and returns HTTP 403 for foreign workspaces. Queries the authoritative engine rather than client claims, blocks refunds on running or completed jobs after network timeouts, and credits the originating credit_periods row at most once.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scanId | Yes | Unique scan identifier returned by vulkill_start_scan. | |
| started | No | Optional legacy boolean flag indicating whether client dispatch succeeded. | |
| summary | No | Optional operator fallback note (1 to 600 characters). | |
| cancelRequested | No | Boolean flag requesting job cancellation and server-verified refund evaluation (default false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when the engine status check succeeded and the scan record was synchronized. | |
| scanId | Yes | Scan report identifier. | |
| status | Yes | Updated authoritative status ('running', 'completed', 'not_started_refunded', or 'failed'). | |
| reportUrl | Yes | Dashboard URL for viewing the finalized report (https://app.vulkill.com/scans). | |
| refundIssued | Yes | True only on the single atomic transition where reserved credits are restored. | |
| sitesCharged | Yes | Net live-site credits charged after completion or refund (0 if refunded). | |
| creditsCharged | Yes | Net file credits charged after completion or refund (0 if refunded). |