Create a retrieval golden set
Create a retrieval golden set — golden cases of a query and its expected keys, searched in namespaces the credential can read. Requires knowledge:manage.
v2 compatibility notes
POST /api/v2/knowledge/goldenSets/create creates a golden set, as a person does on the Console Knowledge Quality page. A run of the set measures how well retrieval finds each case’s golden keys. It needs knowledge:manage and answers 201 with the KnowledgeGoldenSet.
{ id, name, scope, namespaces, cases, status, createdAt, lastRunRequestedAt }; lastRunRequestedAt is when a run was last requested on demand, or null. The set is recorded as created by the credential, which is never returned. Namespaces resolve from the credential, never the request; a Personal key acts as its owner.
An unknown field, a blank name or scope, a count outside its range, a repeated or blank caseId, a blank query or an unknown status answers 400 bad_request.
Send an Idempotency-Key to retry safely. A repeat returns the recorded 201 only while the credential still holds knowledge:manage and knowledge:read and still reads every namespace the set searches now and every namespace the recorded response names; otherwise it answers 403 for a missing knowledge:read, or 409 idempotency_result_unavailable. See Knowledge curation replay.
Authorizations
Headers
1–255 printable ASCII characters. A repeat with the same key and request never runs the write again, a 5xx included. It returns the first response (Idempotency-Replayed: true) only when the route's current authorization policy permits disclosure; otherwise 409 idempotency_result_unavailable. Honoured for External App JWTs and platform and MCP keys; an External App's static companion key is not protected.
1 - 255Body
A new golden set: its name, the scope it measures, the namespaces to search (1–50, each one the caller may read) and its cases. Each case is a query and the golden keys a good retrieval returns for it (a case key, or a synced entry's source id), 1–50 per case; 1–100 cases with distinct caseIds. status defaults to active.
Response
The golden set created
One retrieval golden set whose every namespace the caller may read: the golden cases a run measures and the namespaces each is searched in. Each case is a query and the golden keys a good retrieval returns for it (a case key, or a synced entry's source id), 1–50 per case; 1–100 cases with distinct caseIds. lastRunRequestedAt is when a run was last requested on demand (null if never). Never names who created it.

