Skip to content

Export corrections

View as Markdown
GET
/v1/corrections/export
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.

format
string
Allowed values: csv jsonl

csv (the default) or jsonl.

runId
string
>= 1 characters

Only corrections of this run.

agentId
required
string
>= 1 characters

The agent whose corrections are exported.

agentVersion
string
>= 1 characters

Only corrections of runs of this agent version. Needs agentId.

flowId
string
>= 1 characters

Only corrections of runs of this flow.

status
Array<string>
Allowed values: not-fixed open being-fixed with-owner fixed wont-fix removed

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.

sortedTo
Array<string>
Allowed values: none improve developer owner

Only corrections sorted to these (repeated or comma-separated), with none for unsorted ones.

from
string
Allowed values: experts end-users all

experts: corrections under a restricted corrector group. end-users: an app’s end users’ (participantId), not experts’. all (the default): every one.

madeBy
string
Allowed values: me

me: only the caller’s own corrections.

since
string format: date-time

Only corrections made at or after this time.

until
string format: date-time

Only corrections made before this time.

correctorGroupId
string
>= 1 characters

Only corrections recorded under this corrector group.

participantId
string
>= 1 characters

Only corrections made for this app end user’s opaque id.

scopeKind

Discriminator for the ?scopeKind + ?scopeId + ?inherit triplet. Tenant carries no id (implicit from session); org/project require scopeId.

string
Allowed values: tenant org project

Optional scope discriminator. If absent, no scope filter is applied.

scopeId
string
>= 1 characters

Required IF scopeKind is org or project. MUST be absent if scopeKind=tenant (the workspace is implicit from the session). Malformed combinations return 400 scope-invalid.

The corrections, as CSV or JSON lines (by format).

string

Malformed query parameter, no agentId, or a limit or cursor.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Missing / malformed / expired / revoked bearer token.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

permission-denied: a project scope the caller can’t read.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

persistence-error: the export couldn’t be recorded, so nothing was sent.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
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.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

See also