code-occurrences

Ingest Code Occurrences

Ingest ONE batch of a key-usage run (Developer+).

Lifecycle: omit scan_id to OPEN a run (the response mints + echoes the id), echo it on follow-up batches, send final=true on the last one to CLOSE the run — only the close reconciles gone and runs the mass-gone guard. A scan_id that is not the project's current open run is a 422.

Each ref is resolved server-side to the BASE-version key_uuid; refs matching no live base key are counted unresolved and echoed (the missing-key signal), never stored. Re-posting a batch is idempotent. The response ALWAYS carries scan_id when supported — the CLI treats its absence as a pre-contract backend and must not drop occurrences silently.

post/v1/projects/{project_id}/code-occurrences

Request

  • Base URL: https://api.sonenta.dev
  • URL: https://api.sonenta.dev/v1/projects/{project_id}/code-occurrences
  • Auth: none declared

Path parameters

project_idstring required

Request body

scan_idstring nullable

Omit on the FIRST batch to open a run — the response mints and echoes the id. Echo that id on every follow-up batch of the same run.

finalboolean

Set true on the LAST batch (or the only batch of a single-shot run) to close the run: reconcile gone and run the mass-gone guard. Non-final batches only upsert.

metaobject nullable

Free-form run context (tool, version, sha).

confirm_mass_goneboolean

Set true ONLY when a final that retires most of the project's live occurrences is intended. Without it such a close is refused (422) — the usual cause is a partial checkout.

Response

Successful Response

scan_idstring required

ALWAYS present when supported. Absence = pre-contract backend.

statusstring required

open (more batches expected) or final (run closed).

submittedinteger required
resolvedinteger required
unresolvedinteger required
newinteger required
persistinginteger required
goneinteger required
seen_total_for_scaninteger required
base_version_uuidstring nullable
formulaobject required

Changes

No recorded changes to this operation across all 1 revision of this API.