Create corrections

Files a correction of one question of one of the org's Kai decisions: the right answer, which must be one of that question's options and not what Kai answered, and why.

POST /v1/decisions/{decision}/corrections

Addresshttps://api.hanzo.ai/v1/decisions/{decision}/corrections
MethodPOST
OperationdecisionsCorrect
AuthAuthorization: Bearer $HANZO_API_KEY

Files a correction of one question of one of the org's Kai decisions: the right answer, which must be one of that question's options and not what Kai answered, and why. A decision Kai captured can teach a capability of its question (/v1/capabilities); one made with capture off is kept with state missing and cannot. The org's first correction turns capture on, so its next decisions can teach. Refused: 409 not_wrong when the answer is Kai's own, 409 corrected when the question already has a correction, 404 when the decision captured no such question.

Request

6 fields, body application/json (required).

FieldInTypeRequiredDescription
decisionpathstringyesDecision is the decision's id.
answerbodystring—Answer is the right option label; a score's level may be named by its index.
cohortbodystring—Cohort groups corrections the org files together.
decisionbodystring—Decision is the decision's id.
notebodystring—Note says why, for the person reading it later.
questionbodystring—Question is the question's key.

Response

StatusBodyMeaning
201Correctioncreated
defaultproblem-detailsrefused

201 body — 12 fields.

FieldInTypeAlwaysDescription
answerbodystring—Answer is the right answer; Base what Kai answered.
atbodyinteger (int64)—
basebodystring—
bybodystring—
cohortbodystring—
decisionbodystring—
idbodystring—
labelsbodystring[]—
notebodystring—
questionbodystring—
statebodystring—State is captured when the decision's state is held and the correction can teach, missing when the decision was made with capture off.
typebodystring—

Failure carries the platform error shape — see Errors.

Examples

hanzo decisions corrections create <decision>
import { Configuration, AiApi } from 'hanzoai';

const api = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.decisionsCorrect({ decision: 'decision', answer: "<answer>", cohort: "<cohort>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AiApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AiApi(client).decisions_correct(decision='decision', answer="<answer>", cohort="<cohort>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AiAPI.DecisionsCorrect(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, ai_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = ai_api::decisions_correct(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AiApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AiApi(client).decisionsCorrect();
curl -X POST https://api.hanzo.ai/v1/decisions/<decision>/corrections \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "answer": "<answer>",
       "cohort": "<cohort>"
     }'

Tool ai, op decisionsCorrect — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "ai",
         "arguments": {
           "op": "decisionsCorrect",
           "input": {
             "decision": "<decision>",
             "answer": "<answer>",
             "cohort": "<cohort>"
           }
         }
       }
     }'

AI API · All Hanzo APIs · Interactive reference

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.