Re-sort a correction or change its status
const url = 'https://example.com/v1/corrections/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"sortedTo":"improve","status":"open","link":"example","reason":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/v1/corrections/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "sortedTo": "improve", "status": "open", "link": "example", "reason": "example" }'A re-sort, a status, or both (the re-sort first), by the change table: re-sorting from open, being-fixed or with-owner (to owner sets with-owner; away from owner, open); being-fixed from open or with-owner, with link; open from being-fixed or wont-fix (with-owner for one sorted to the owner); wont-fix from anything but removed, with reason, and it drops fixedIn. fixed is set only by a pin or a deploy. Anything else is 409 correction-status-change-not-allowed. Needs publish on the correction’s agent (or flow), or, for one more than one project serves, write on the correction’s project.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”A re-sort, a status, or both (the re-sort first). fixed is set only by a pin or a deploy, and removed by POST /v1/corrections/{correctionId}/remove.
object
Responses
Section titled “Responses”The changed correction.
A person’s correction of one run: whether its decisions (the tool calls) and its answer were right, and what was right instead. It says at least one of decisions, answer and items.
object
Example
{ "subject": { "kind": "agent" }, "decisions": "right", "answer": "right", "items": [ { "verdict": "right" } ], "expert": true, "madeBy": { "kind": "user" }, "status": "open", "sortedTo": "improve", "sorted": { "by": { "kind": "fix-job" } }, "link": { "kind": "improve-run" }, "fixedIn": { "how": "pin", "by": { "kind": "user" } }, "reopenedIn": { "how": "pin", "by": { "kind": "user" } }, "statusNote": { "by": { "kind": "user" } }}Malformed body: a link without being-fixed, being-fixed without a link, or wont-fix without a reason.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}permission-denied: this needs publish on the agent, or write on the correction’s project for an agent more than one project serves. Without an authorization store, key-project-mismatch (details.keyProjectId, details.projectId): the API key or session is limited to a project, and this acts in another one, the record’s or its agent’s or test set’s (with a store, that is permission-denied, or the record isn’t found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No live correction with that id under this workspace.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}correction-status-change-not-allowed: the change table does not allow it from its status, or it changed twice while the change was made: read it and try again (details: { from, to }). Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/corrections/{correctionId}: Fetch a correction with its copiesPOST /v1/corrections/{correctionId}/remove: Remove a correction- Kindgi 0.4.0
- Error code
authz-backend-unavailable - Error code
correction-status-change-not-allowed - Error code
database-busy - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
key-project-mismatch - Error code
permission-denied - Error code
rate-limit-exceeded - Error code
request-too-large - Error code
tenant-state-unavailable - Every error code