---
title: "Answer Source Verification"
method: PATCH
path: "/api/v1/sources/{source_id}/verifications/{question_id}"
tags: ["v1", "Source Verifications"]
---

# Answer Source Verification

`PATCH /api/v1/sources/{source_id}/verifications/{question_id}`

## Request

- Base URL: `https://api.jeevyfabrication.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.jeevyfabrication.com/api/v1/sources/{source_id}/verifications/{question_id}`
- Auth: none declared

Engineer answered one pending question.

Flow:
  1. Look up the pending row by ``(source_id, question_id)`` to
     find its ``gate_type``.
  2. Apply the answer to ``seg_correspondence`` JSONB via the
     gate's ``apply_answer_fn`` (registered in gate_registry).
  3. Persist the answer + flip the row's status to 'answered'.
  4. If this was the LAST pending question for the current gate:
     - Look up the next gate in the source's chain.
     - If there's a next gate, dispatch a triage_source job for
       it (worker runs phase2 triage after phase1 is fully
       answered, etc.).
     - If there's NO next gate (current gate is last), mark the
       source verified.
  5. Return shape lets the FE decide whether to surface "next
     round loading" UI or "all done."

Returns 404 if no pending row matches ``(source_id, question_id)``.

## Path parameters

- `source_id` integer, required
- `question_id` string, required

## Request body

- PatchVerificationRequest: Body for ``PATCH /sources/{source_id}/verifications/{question_id}``. The ``answer`` field carries the chat-card answer envelope — matches the shape ``_apply_answer_to_seg_correspondence`` consumes today (see ``correspondence_phase1.py:929`` for the per-type value shapes).
  - `answer` object, required

## Response `200`

Successful Response

- PatchVerificationResponse: Returned by ``PATCH .../verifications/{question_id}``. Fields: * ``status`` — outcome of the apply path (``"answered"`` / ``"ok_no_assembly"`` / etc.). * ``remaining_pending`` — count of pending rows across all gates for this source after the flip. FE uses this to render progress. * ``source_verified`` — True when this answer caused ``is_verified`` to flip (i.e. last gate in chain just finished with zero remaining pending). * ``next_gate_dispatched`` — gate_type the FE can expect new pending rows from soon (auto-dispatched when this answer ended the current gate but more gates remain). None when no chain advance happened.
  - `status` string, required
  - `remaining_pending` integer, required
  - `source_verified` boolean
  - `next_gate_dispatched` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api.md) - [All operations](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/revisions/ad9a01abeac9?raw)
