Sync many prompts' FAQ answers
sync_prompt_answersSet the FAQ answers of up to 100 tracked prompts in one transaction, e.g. from a release that keeps its answers in a repository. items is [{ queryId or query, answer, expectedHash? }]. query matches a tracked prompt by its text with case and spacing ignored — the query or the faqQuestion list_prompts returns, a dimension variant included; a text that matches several tracked prompts is refused for that item with reason ambiguous-query and their candidateQueryIds (send one as queryId). A prompt that is not tracked is tracked first, under add_prompt's quota; an archived one with that text is revived (revived: true, its history continues), except one that was replaced by a reworded prompt (refused, reason replaced, with replacedByQueryId) or one tracked only as an archived variant (refused, reason archived-variant). A created prompt whose automatic checks start in a later month carries automaticChecksFrom, as add_prompt does. Every item is checked with set_prompt_answer's rule before anything is written: one invalid item — or the same prompt twice — refuses the whole batch with { ok: false, reason: "invalid", index, field, max }. dryRun: true returns exactly what the run would do and writes nothing. A real run needs idempotencyKey (≤200 characters) — one idempotencyKey per batch, e.g. - such as "v4.2-1", since a release of more than 100 answers is several batches. Only a run in which every item applied (unchanged, changed or created) is kept under its key: the same key with the same request again returns that first result and writes nothing, and the same key with a different request is refused with reason idempotency-mismatch. A run with a conflict, a refusal or a missing prompt is not kept, so after fixing the cause the same key runs again. A kept key lives 7 to 14 days (records older than 7 days are pruned weekly). Returns items [{ index, queryId, status, answerHash, previousHash, reason? }] and counts; status is unchanged, changed, created (would-create in a dry run), missing (no such tracked prompt), conflict (the stored answer's hash is not the item's expectedHash; nothing written for it) or refused (with its reason: add_prompt's, e.g. over-quota, or one above). answerHash is the item's answer after the run, previousHash before it. An unchanged item records nothing; each change is recorded with source in the answer's history, as set_prompt_answer records it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| dryRun | No | true: say what would happen, write nothing (default false). | |
| siteId | No | Optional on a connected app: the site chosen with select_site is used. If given, it must be that site. With an API key it is required: a site id from list_sites. | |
| source | No | Optional label for these writes (≤100 characters), e.g. "ci:release-4.2". | |
| idempotencyKey | No | Required for a real run (≤200 characters): one per batch, e.g. <release>-<batch>; resend the same key when you retry that batch. |