Skip to main content
Training Data

Update a Q&A entry

Updates title, questions, answer, or source. Questions replaces the whole list; preserve the union yourself when merging. Supply expectedRevision from GET or oracle.existing / oracle.target to apply only to the version you reviewed. A stale revision returns 409 revision_conflict; a question owned by another entry returns 409 question_already_used. Content changes attempt indexing before returning; check indexStatus.

PATCH
/v2/training_data/qna/{id}

Optional onMatch checks changed questions or answer against the addressed entry and retrieved candidates. reject refuses overlap; update permits deliberate replacement but refuses unclear results; create overrides the result. PATCH never merges entries. Checks are bounded advice and do not lock the rest of the knowledge base. A missing onMatch applies the requested update without semantic judging.

Authorizationstringheaderrequired

API key as Bearer token. Use: Authorization: Bearer sk_...

idstringrequired

The Q&A entry ID

Example: 67ec1234abcd5678ef901235
Featurebase-Versionenum<string>header

API version for this request. Defaults to your organization's configured API version if not specified.

Available options: 2026-08-19.orbit, 2026-01-01.nova, 2025-12-12.clover
Example: 2026-08-19.orbit

Body

application/json
answerstring

Replacement answer

Required string length: 1 - 100000
Example: You can request a refund within 60 days from **Settings → Billing**.
answerFormatenum<string>default:markdown

Format of answer. markdown (default) is stored as-is; html is converted to markdown.

Available options: markdown, html
Example: markdown
expectedRevisioninteger

Apply only if the entry still has this revision. A stale revision returns 409 revision_conflict without writing. Get the revision from retrieve, oracle.existing, or oracle.target.

Required range: 0 <= x <= 9007199254740991
Example: 1
onMatchenum<string>

Optional inline knowledge check for a content change. Omit it (the default) and the change is applied immediately. Pass it to check the changed questions / answer against the addressed entry and retrieved workspace candidates first: reject: respond 409 conflicts_with_existing and leave the entry untouched; update or create: apply the change and report the match in match. A PATCH never merges two entries. Ignored when neither questions nor answer changes.

Available options: reject, update, create
Example: reject
questionsstring[]

Replacement question list (replaces all existing questions)

Required array length: 1 - 50
sourcestring

Free-form label for the pipeline or system this entry came from. Filter lists by it to review or sweep everything from one source.

Required string length: 1 - 100
Example: resolved-conversations
titlestring

New label

Required string length: 1 - 500
Example: Refund requests

Response

application/json

Success

answerstringrequired

The answer the AI agent gives (markdown)

Example: You can request a refund within 30 days from **Settings → Billing**.
createdAtstringrequired

ISO timestamp of creation

Example: 2026-09-03T10:15:00.000Z
externalIdstring | nullrequired

Stable identifier supplied by the source system

Example: resolution-1842
idstringrequired

Q&A entry ID

Example: 67ec1234abcd5678ef901235
indexStatusenum<string>required

Whether the entry is searchable by the AI agent. failed entries are stored and indexing is retried hourly up to three times. Re-send the resource to retry after exhaustion.

Available options: pending, indexed, failed
Example: indexed
matchobject | null

Present only when onMatch was passed and the check ran: the verdict and the closest existing item, even when the write went ahead. null otherwise (the default), including when the payload was unchanged.

objectenum<string>required

Object type identifier

Available options: qna
Example: qna
outcomeenum<string>

What the write did — present on create and update responses. created: a new entry. updated: an entry already carried one of the questions (or was merged into with onMatch: "update") and got new content or an indexing retry. unchanged: everything in the payload was already on that entry; nothing written, nothing re-indexed.

Available options: created, updated, unchanged
Example: created
questionsstring[]required

Question variants the answer applies to

revisionintegerrequired

Q&A revision. Send it as expectedRevision on PATCH to reject stale changes.

Example: 1
sourcestring | nullrequired

Pipeline label, if one was set

Example: resolved-conversations
titlestringrequired

Short label for the entry

Example: Refund requests
updatedAtstringrequired

ISO timestamp of the last change

Example: 2026-09-03T10:15:30.000Z