Export corrections
const url = 'https://example.com/v1/corrections/export?format=csv&agentId=example&from=experts&madeBy=me&scopeKind=tenant';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/corrections/export?format=csv&agentId=example&from=experts&madeBy=me&scopeKind=tenant' \ --header 'Authorization: Bearer <token>'Every correction of an agent the list’s filters match, streamed as CSV (format=csv, the default: RFC 4180, UTF-8, a header row) or JSON lines (format=jsonl: one correction per line, as the list sends it). Each comes only when the caller may read its project, and a project scope the caller can’t read is a 403 before anything is sent. The run’s own text isn’t exported, only its id. A CSV field that starts with =, +, -, @, a tab or a carriage return gets a leading ', so a spreadsheet doesn’t run it. Recorded in the audit log: corrections-export-started before the first row (when it can’t be written, a 500 and nothing is sent), and corrections-exported when the stream ends, with the rows sent and succeeded or failed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”csv (the default) or jsonl.
Only corrections of this run.
The agent whose corrections are exported.
Only corrections of runs of this agent version. Needs agentId.
Only corrections of runs of this flow.
Only corrections in these statuses: one, or several, repeated or comma-separated. not-fixed is short for open, being-fixed and with-owner. Removed corrections come back only when removed is asked for.
Only corrections sorted to these (repeated or comma-separated), with none for unsorted ones.
experts: corrections under a restricted corrector group. end-users: an app’s end users’ (participantId), not experts’. all (the default): every one.
me: only the caller’s own corrections.
Only corrections made at or after this time.
Only corrections made before this time.
Only corrections recorded under this corrector group.
Only corrections made for this app end user’s opaque id.
Discriminator for the ?scopeKind + ?scopeId + ?inherit triplet. Tenant carries no id (implicit from session); org/project require scopeId.
Optional scope discriminator. If absent, no scope filter is applied.
Required IF scopeKind is org or project. MUST be absent if scopeKind=tenant (tenant is implicit from the session). Malformed combinations return 400 scope-invalid.
Responses
Section titled “Responses”The corrections, as CSV or JSON lines (by format).
Examplegenerated
exampleMalformed query parameter, no agentId, or a limit or cursor.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}permission-denied: a project scope the caller can’t read.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}persistence-error: the export couldn’t be recorded, so nothing was sent.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The database was too busy to answer in time (database-busy); Retry-After (whole seconds) says when to try again.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}