Hanzo
OpenapiLabel

Assert ground truth about events

Records a batch of ground truth against the entities it judges.

POST /v1/label

Addresshttps://api.hanzo.ai/v1/label
MethodPOST
OperationriskLabel
AuthAuthorization: Bearer $HANZO_API_KEY

Records a batch of ground truth against the entities it judges.

Each assertion carries TWO times — when the judged event happened, and when the assertion became knowable — and both are required. The second is what keeps a chargeback that landed in June out of a model that had to decide in February.

It is idempotent on the CONTENT of an assertion, so a webhook that redelivers is safe. It never overwrites: a source that corrects itself later files a NEW assertion, which wins from the moment it became knowable and leaves every earlier observation instant seeing exactly what it saw.

The asserter is stamped from the validated credential and is not a body field.

Request

9 fields, body application/json (required).

FieldInTypeRequiredDescription
labelsbodyriskLabelFact[]Labels is the batch. Each member is judged on its own: one refusal does not discard the rest, because a webhook redelivering five disputes must not lose four…
labels[].atbodystringAt is when the judged event happened, RFC 3339.
labels[].confidencebodynumberConfidence in [0,1]. A processor chargeback is 1; an analyst's hunch is not.
labels[].dispositionbodystringDisposition is productive, unproductive, or empty for an explicit unjudged — the AML engine's own vocabulary, verbatim.
labels[].evidencebodystringEvidence points at the record this conclusion came from: a dispute id, a case id, a decision id.
labels[].kindbodystringKind is what the subject is: account, agent, merchant, payout, person, session or transaction.
labels[].seenbodystringSeen is when this assertion became KNOWABLE, RFC 3339.
labels[].sourcebodystringSource is who asserted: chargeoff, dispute, case, refund, review or sample.
labels[].subjectbodystringSubject identifies the thing being judged, in the tenant's own namespace.

Response

StatusBodyMeaning
200riskLabelOutok

200 body — 9 fields.

FieldInTypeAlwaysDescription
duplicatebodyintegerDuplicate is how many members this tenant already held, byte for byte.
mirrorbodystringMirror names why the columnar copy did not take this batch, when it did not.
pendingbodyintegerPending is how many assertions the derived copy is still to take.
recordedbodyintegerRecorded is how many members became a NEW row in the tenant's record.
refusedbodyintegerRefused is how many members failed admission and were NOT recorded.
resultsbodyriskLabelResult[]Results is per fact, in the order sent, so a caller can retry exactly the members that were refused and can log the content digest of the ones that landed.
results[].idbodystringID is the content digest of the assertion — the id a redelivery of the same fact resolves to.
results[].refusalbodystringRefusal states what was wrong, for the refused.
results[].statusbodystringStatus is recorded, duplicate or refused.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.


Label API · All Hanzo APIs · Interactive reference

How is this guide?

On this page