# Clarifications

The questions activQC asks instead of rejecting, and how to answer them.

Paths start at `$ACTIVQC_BASE_URL`, and every call sends `Authorization: Bearer $ACTIVQC_KEY`. Errors use the [error envelope](https://activqc.wavbee.com/docs/errors.md). [All endpoints](https://activqc.wavbee.com/docs/api-reference.md).

## GET /v1/qc/runs/{qc_run_id}/clarifications

List the questions a run raised.

Every question raised for this run, open and resolved.

**Auth:** a secret key, `Authorization: Bearer $ACTIVQC_KEY`.

#### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `qc_run_id` | path | integer | **Required.** |

#### Example request

```bash
curl -s "$ACTIVQC_BASE_URL/v1/qc/runs/{qc_run_id}/clarifications" \
  -H "Authorization: Bearer $ACTIVQC_KEY"
```

#### Responses

| Status | Meaning |
|---|---|
| `200` | Listed. |
| `401` | No key. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |
| `404` | Absent or owned by another tenant. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |

#### Response `200`

| Field | Type | Description |
|---|---|---|
| `object` | string | **Required.** Example `list`. |
| `data` | array of object | **Required.** |
| `data[].id` | string | **Required.** Example `clr_9f2c1a7b4d8e0356`. |
| `data[].object` | string | **Required.** Example `qc.clarification`. |
| `data[].run_id` | integer | **Required.** Example `42`. |
| `data[].rule_id` | string | **Required.** Example `P15`. |
| `data[].status` | string | **Required.** One of `open`, `answered`, `expired`, `superseded`. |
| `data[].target` | object |  |
| `data[].target.type` | string | **Required.** One of `release`, `track`. |
| `data[].target.track_number` | integer or null |  |
| `data[].question` | string | **Required.** Example `This release is submitted as a Single but has 7 tracks, which is an Album. Should we change the release type to Album?`. |
| `data[].options` | array of object | **Required.** |
| `data[].options[].id` | string | **Required.** Example `release_title`. |
| `data[].options[].label` | string | **Required.** Example `Yes - change the release type to Album`. |
| `data[].options[].patch` | object or null | A single RFC 6902 operation. `null` on an option means it applies nothing. |
| `data[].options[].patch.op` | string | **Required.** One of `add`, `replace`, `remove`. |
| `data[].options[].patch.path` | string | **Required.** Example `/tracks/0/title`. |
| `data[].options[].patch.value` | any | Absent for `remove`. |
| `data[].options[].input` | string | What the answer's `value` must be: one of `choices` (select), a list of them (multi), a line of text (text), or a builder upload's id (upload, `kind: document`). One of `select`, `multi`, `text`, `date`, `upload`. |
| `data[].options[].choices` | array of object | For select and multi. |
| `data[].options[].choices[].value` | string | **Required.** Example `aiva`. |
| `data[].options[].choices[].label` | string | **Required.** Example `AIVA`. |
| `data[].options[].required` | boolean | Whether a value must be given. Defaults to true. |
| `data[].options[].max_length` | integer | For text; never above 200. |
| `data[].options[].accept` | array of string | For upload: the MIME types taken, within PDF, JPEG and PNG. |
| `data[].options[].max_bytes` | integer | For upload; never above 10 MB. Example `10485760`. |
| `data[].proposed_patch` | object or null | A single RFC 6902 operation. `null` on an option means it applies nothing. |
| `data[].proposed_patch.op` | string | **Required.** One of `add`, `replace`, `remove`. |
| `data[].proposed_patch.path` | string | **Required.** Example `/tracks/0/title`. |
| `data[].proposed_patch.value` | any | Absent for `remove`. |
| `data[].applied_patch` | object or null | What the answer actually changed: op, path, before, after. |
| `data[].answer` | object or null | The option chosen and the value given with it. An uploaded file is described in `document`, with a link (an hour) the reviewer can open. |
| `data[].answer.option_id` | string | Example `tool`. |
| `data[].answer.value` | any or null | The accepted value: a string, or a list for `multi`. |
| `data[].answer.document` | object |  |
| `data[].answer.document.filename` | string | Example `licence.pdf`. |
| `data[].answer.document.content_type` | string | Example `application/pdf`. |
| `data[].answer.document.byte_size` | integer |  |
| `data[].answer.document.url` | string or null |  |
| `data[].expires_at` | string (date-time) or null | After this the run escalates to manual_review. |
| `data[].answered_at` | string (date-time) or null |  |
| `data[].created_at` | string (date-time) |  |

```json
{
  "object": "list",
  "data": [
    {
      "id": "clr_9f2c1a7b4d8e0356",
      "object": "qc.clarification",
      "run_id": 42,
      "rule_id": "P15",
      "status": "open",
      "target": {
        "type": "release",
        "track_number": 1
      },
      "question": "This release is submitted as a Single but has 7 tracks, which is an Album. Should we change the release type to Album?",
      "options": [
        {
          "id": "release_title",
          "label": "Yes - change the release type to Album",
          "patch": null,
          "input": null,
          "choices": null,
          "required": null,
          "max_length": null,
          "accept": [
            "application/pdf",
            "image/jpeg",
            "image/png"
          ],
          "max_bytes": 10485760
        }
      ],
      "proposed_patch": {
        "op": "add",
        "path": "/tracks/0/title",
        "value": {}
      },
      "applied_patch": {},
      "answer": {
        "option_id": "licence",
        "value": null,
        "document": {
          "filename": "licence.pdf",
          "content_type": "application/pdf",
          "byte_size": 48213,
          "url": "https://qc.example/rails/active_storage/blobs/redirect/…/licence.pdf"
        }
      },
      "expires_at": "2026-11-24T10:00:00Z",
      "answered_at": "2026-11-24T10:00:00Z",
      "created_at": "2026-11-24T10:00:00Z"
    }
  ]
}
```

## POST /v1/qc/clarifications/{id}/answer

Answer a clarification.

Applies the answer's patch (filled with its `value` when the option asks for one), re-checks only the rules that path touches, and returns the clarification with the re-folded run.

**Auth:** a secret key, `Authorization: Bearer $ACTIVQC_KEY`.

Send an `Idempotency-Key` header (a new UUID per operation; a retry reuses it).

#### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string | **Required.** The clarification's public id (`clr_…`). |
| `Idempotency-Key` | header | string | **Required.** A unique string per operation, for example a UUID. A retry with the same key returns the first answer. Missing: 422. |

#### Request body

`application/json`.

Answer with exactly one of `option_id` or `patch`. A supplied patch may only touch a path this clarification proposed. An option with an `input` takes its `value` beside `option_id`; a value it refuses is a 422 naming `field: value`, and nothing is applied.

| Field | Type | Description |
|---|---|---|
| `option_id` | string | Example `release_title`. |
| `patch` | object or null | A single RFC 6902 operation. `null` on an option means it applies nothing. |
| `patch.op` | string | **Required.** One of `add`, `replace`, `remove`. |
| `patch.path` | string | **Required.** Example `/tracks/0/title`. |
| `patch.value` | any | Absent for `remove`. |
| `value` | any | For an option with an input: a choice's value (select), a list of them (multi), the text (text), or the signed id of a `document` builder upload (upload). Example `aiva`. |

#### Example request

```bash
curl -s -X POST "$ACTIVQC_BASE_URL/v1/qc/clarifications/{id}/answer" \
  -H "Authorization: Bearer $ACTIVQC_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "option_id": "remove"
}'
```

#### Responses

| Status | Meaning |
|---|---|
| `200` | Answered. |
| `401` | No key. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |
| `404` | Absent or owned by another tenant. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |
| `409` | Already answered, or past its deadline. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |
| `422` | The patch touches a path this clarification never proposed, or the option refuses the value. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |

#### Response `200`

| Field | Type | Description |
|---|---|---|
| `id` | string | **Required.** Example `clr_9f2c1a7b4d8e0356`. |
| `object` | string | **Required.** Example `qc.clarification`. |
| `run_id` | integer | **Required.** Example `42`. |
| `rule_id` | string | **Required.** Example `P15`. |
| `status` | string | **Required.** One of `open`, `answered`, `expired`, `superseded`. |
| `target` | object |  |
| `target.type` | string | **Required.** One of `release`, `track`. |
| `target.track_number` | integer or null |  |
| `question` | string | **Required.** Example `This release is submitted as a Single but has 7 tracks, which is an Album. Should we change the release type to Album?`. |
| `options` | array of object | **Required.** |
| `options[].id` | string | **Required.** Example `release_title`. |
| `options[].label` | string | **Required.** Example `Yes - change the release type to Album`. |
| `options[].patch` | object or null | A single RFC 6902 operation. `null` on an option means it applies nothing. |
| `options[].patch.op` | string | **Required.** One of `add`, `replace`, `remove`. |
| `options[].patch.path` | string | **Required.** Example `/tracks/0/title`. |
| `options[].patch.value` | any | Absent for `remove`. |
| `options[].input` | string | What the answer's `value` must be: one of `choices` (select), a list of them (multi), a line of text (text), or a builder upload's id (upload, `kind: document`). One of `select`, `multi`, `text`, `date`, `upload`. |
| `options[].choices` | array of object | For select and multi. |
| `options[].choices[].value` | string | **Required.** Example `aiva`. |
| `options[].choices[].label` | string | **Required.** Example `AIVA`. |
| `options[].required` | boolean | Whether a value must be given. Defaults to true. |
| `options[].max_length` | integer | For text; never above 200. |
| `options[].accept` | array of string | For upload: the MIME types taken, within PDF, JPEG and PNG. |
| `options[].max_bytes` | integer | For upload; never above 10 MB. Example `10485760`. |
| `proposed_patch` | object or null | A single RFC 6902 operation. `null` on an option means it applies nothing. |
| `proposed_patch.op` | string | **Required.** One of `add`, `replace`, `remove`. |
| `proposed_patch.path` | string | **Required.** Example `/tracks/0/title`. |
| `proposed_patch.value` | any | Absent for `remove`. |
| `applied_patch` | object or null | What the answer actually changed: op, path, before, after. |
| `answer` | object or null | The option chosen and the value given with it. An uploaded file is described in `document`, with a link (an hour) the reviewer can open. |
| `answer.option_id` | string | Example `tool`. |
| `answer.value` | any or null | The accepted value: a string, or a list for `multi`. |
| `answer.document` | object |  |
| `answer.document.filename` | string | Example `licence.pdf`. |
| `answer.document.content_type` | string | Example `application/pdf`. |
| `answer.document.byte_size` | integer |  |
| `answer.document.url` | string or null |  |
| `expires_at` | string (date-time) or null | After this the run escalates to manual_review. |
| `answered_at` | string (date-time) or null |  |
| `created_at` | string (date-time) |  |
| `run` | object |  |
| `run.id` | integer | **Required.** Example `42`. |
| `run.object` | string | **Required.** Example `qc.run`. |
| `run.status` | string | **Required.** One of `queued`, `running`, `completed`. |
| `run.tier` | integer | **Required.** Example `1`. |
| `run.profile` | string or null | Example `apple`. |
| `run.verdict` | string or null | One of `pass`, `pass_with_warnings`, `needs_clarification`, `manual_review`, `fail`. |
| `run.final_decision` | string or null | One of `accepted`, `changes_required`, `rejected`. |
| `run.verdict_phase` | string or null | Example `fast_lane`. |
| `run.rulebook_version` | string or null | Example `1.0.0`. |
| `run.counts` | map of integer |  |
| `run.decision` | object or null | The one decision shown to the artist, worked out from the findings' outcomes. `checking` while `artwork_check`, `audio_check` or `model_check` is pending and nothing already fails. A clean draft is pre-submit (no audio checks ran), so it never promises the release is accepted. |
| `run.decision.state` | string | **Required.** One of `checking`, `accepted`, `rejected`, `manual_review`, `needs_answers`. |
| `run.decision.headline` | string | **Required.** Example `Rejected`. |
| `run.decision.summary` | string | **Required.** Plain words for the artist; on a draft, manual review is promised after you submit. |
| `run.decision.open_questions` | integer | **Required.** What blocks Submit (open questions and fixable fails); the headline's N. The response's top-level `open_questions` can be higher: it also counts advisory ones. |
| `run.decision.reasons` | array of object | **Required.** One line per finding that matters, worst first. |
| `run.decision.reasons[].id` | string | **Required.** `<rule>:<release\|track>:<n>`, the key a finding's answer is kept under. Example `AR7:release:`. |
| `run.decision.reasons[].outcome` | string | **Required.** One of `fail`, `manual_review`, `clarify`, `not_run`, `warn`. |
| `run.decision.reasons[].text` | string | **Required.** |
| `run.decision.reasons[].target` | object | **Required.** |
| `run.decision.reasons[].anchor` | string or null |  |
| `run.decision.reasons[].pins` | array of integer | **Required.** Numbers of the marks on the cover that belong to this finding. |
| `run.decision.reasons[].deciding` | boolean | **Required.** Whether this reason is what the decision rests on. |
| `run.decision.reasons[].open` | boolean | **Required.** A question or one-tap fix still waiting for the artist. |
| `run.decision.reasons[].answered` | boolean | The artist answered it is correct as it is; a person decides. |
| `run.decision.reasons[].answer_label` | string | What the artist answered, when answered. |
| `run.decision.reasons[].fix` | string | What would make it acceptable: the first change on offer. |
| `run.decision.reasons[].simulated` | boolean | True when the reason was read from a simulated scan (test keys only). |
| `run.trust` | object or null | The uploading account's trust the run was decided with (rule TR1), frozen when it was decided. Null when the release named no account, or before the run is decided. For your server only: the artist never sees it. |
| `run.trust.account_id` | string | **Required.** Example `artist-8812`. |
| `run.trust.score` | integer | **Required.** Example `50`. |
| `run.trust.band` | string | **Required.** One of `low`, `medium`, `high`. |
| `run.trust.source` | string | **Required.** `override` (pinned by WAVBEE staff), `tenant` (the trust_score you sent) or `computed`. One of `override`, `tenant`, `computed`. |
| `run.trust.reasons` | array of string | **Required.** |
| `run.created_at` | string (date-time) | **Required.** |
| `run.completed_at` | string (date-time) or null |  |
| `rechecked` | array of string | The checks re-evaluated because of this answer. |

```json
{
  "id": "clr_9f2c1a7b4d8e0356",
  "object": "qc.clarification",
  "run_id": 42,
  "rule_id": "P15",
  "status": "open",
  "target": {
    "type": "release",
    "track_number": 1
  },
  "question": "This release is submitted as a Single but has 7 tracks, which is an Album. Should we change the release type to Album?",
  "options": [
    {
      "id": "release_title",
      "label": "Yes - change the release type to Album",
      "patch": {
        "op": "add",
        "path": "/tracks/0/title",
        "value": {}
      },
      "input": "select",
      "choices": [
        {
          "value": "aiva",
          "label": "AIVA"
        }
      ],
      "required": false,
      "max_length": 1,
      "accept": [
        "application/pdf",
        "image/jpeg",
        "image/png"
      ],
      "max_bytes": 10485760
    }
  ],
  "proposed_patch": {
    "op": "add",
    "path": "/tracks/0/title",
    "value": {}
  },
  "applied_patch": {},
  "answer": {
    "option_id": "licence",
    "value": null,
    "document": {
      "filename": "licence.pdf",
      "content_type": "application/pdf",
      "byte_size": 48213,
      "url": "https://qc.example/rails/active_storage/blobs/redirect/…/licence.pdf"
    }
  },
  "expires_at": "2026-11-24T10:00:00Z",
  "answered_at": "2026-11-24T10:00:00Z",
  "created_at": "2026-11-24T10:00:00Z",
  "run": {
    "id": 42,
    "object": "qc.run",
    "status": "queued",
    "tier": 1,
    "profile": "apple",
    "verdict": "pass",
    "final_decision": "accepted",
    "verdict_phase": "fast_lane",
    "rulebook_version": "1.0.0",
    "counts": {},
    "decision": {
      "state": "checking",
      "headline": "Rejected",
      "summary": "string",
      "open_questions": 1,
      "reasons": [
        {
          "id": "AR7:release:",
          "outcome": null,
          "text": null,
          "target": null,
          "anchor": null,
          "pins": null,
          "deciding": null,
          "open": null,
          "answered": null,
          "answer_label": null,
          "fix": null,
          "simulated": null
        }
      ]
    },
    "trust": {
      "account_id": "artist-8812",
      "score": 50,
      "band": "low",
      "source": "override",
      "reasons": [
        "3 releases accepted (+6)"
      ]
    },
    "created_at": "2026-11-24T10:00:00Z",
    "completed_at": "2026-11-24T10:00:00Z"
  },
  "rechecked": [
    "string"
  ]
}
```

