Why API
The Why API keeps a record of decisions and their results for your account. Record an assessment at each decision: the pattern and its version, the asset and its operating context, whether the pattern matched and whether your existing alarm warned. Attach the result when it arrives, with the time it became available. An assessment counts only earlier cases whose results were available at its decision time, and is stored as it was answered. An evaluation compares the pattern with the existing alarm on the same cases. Every assessment, result and deletion is written to a receipt chain for the account, which you can export and verify. Record quiet cases too, so that missed failures and false warnings can be counted.
Scope and limits
POST /v1/why/assess_pattern
Record a pattern assessment
Request body (application/json)
| Field | Type | Description |
|---|
asset required | string | |
pattern required | string | |
pattern_version required | string | |
context required | object | Comparable conditions, for example tool and recipe. |
outcome required | string | Name of the future event whose occurrence is recorded as a failure. |
horizon required | object | |
assessment_id required | string | |
as_of required | string | RFC 3339 with explicit time zone and up to six fractional digits. |
matched required | boolean | |
baseline_warning required | boolean | |
evidence_ref | string | Source identifier for the observed condition. |
Responses
| 200 | Operation result. |
| 400 | Missing or invalid API key. |
| 401 | unauthorized |
| 405 | method_not_allowed |
| 409 | assessment_conflict |
| 413 | body_too_large |
| 415 | unsupported_media_type |
| 500 | internal_error |
| 503 | storage_unavailable |
Example request
curl -X POST "https://api.qriton.com/v1/why/assess_pattern" \
-H "Authorization: Bearer $QRITON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"asset":"press-07","pattern":"slow_cycle_with_normal_force","pattern_version":"1","context":{"recipe":"join-a3","tool":"nest-42"},"outcome":"gauge_failure","horizon":{"count":5,"unit":"join"},"assessment_id":"window-07","as_of":"2026-11-16T09:00:00Z","matched":true,"baseline_warning":false,"evidence_ref":"controller-cycle-07"}'
Example response
{
"asset": "press-07",
"pattern": "slow_cycle_with_normal_force",
"pattern_version": "1",
"context": {
"recipe": "join-a3",
"tool": "nest-42"
},
"outcome": "gauge_failure",
"horizon": {
"count": 5,
"unit": "join"
},
"assessment_id": "window-07",
"as_of": "2026-11-16T09:00:00Z",
"matched": true,
"baseline_warning": false,
"evidence_ref": "controller-cycle-07",
"prior_resolved_matches": 0,
"prior_failures": 0,
"estimated_failure_probability": null,
"probability_interval_95": null,
"evidence": [],
"reason": "insufficient_history",
"recommendation": "review",
"receipt": {
"sequence": 0,
"timestamp_utc": "2026-11-16T09:00:01.250Z",
"operation": "inject",
"previous_hash": null,
"payload": {
"kind": "assessment",
"assessment_id": "window-07",
"as_of": "2026-11-16T09:00:00Z",
"matched": true,
"baseline_warning": false,
"recommendation": "review",
"prior_resolved_matches": 0,
"prior_failures": 0,
"request_sha256": "c76a380d1ca6784b50898b3f24d2564f84d793cbb854338eeaee64956bb058a1",
"result_sha256": "49b142cc2e7a45c2f6eb436fe293839d22f7bff08c37db511c5ad86c5e1ce685"
},
"receipt_hash": "03cf5214c46c28bfd1a6a3cd3292537a29b8af71b0672801ab3f96a297db7790"
}
}
POST /v1/why/record_outcome
Resolve an assessment from an independent record
Request body (application/json)
| Field | Type | Description |
|---|
assessment_id required | string | |
status required | string: "pass", "fail", "uninspected", "intervened" | |
observed_at required | string | RFC 3339 with explicit time zone and up to six fractional digits. |
available_at required | string | RFC 3339 with explicit time zone and up to six fractional digits. |
evidence_ref required | string | Independent inspection or intervention record. |
observed_units required | integer | |
Responses
| 200 | Operation result. |
| 400 | Missing or invalid API key. |
| 401 | unauthorized |
| 404 | assessment_not_found |
| 405 | method_not_allowed |
| 409 | outcome_conflict |
| 413 | body_too_large |
| 415 | unsupported_media_type |
| 500 | internal_error |
| 503 | storage_unavailable |
Example request
curl -X POST "https://api.qriton.com/v1/why/record_outcome" \
-H "Authorization: Bearer $QRITON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assessment_id":"window-07","status":"fail","observed_at":"2026-11-16T09:04:00Z","available_at":"2026-11-16T09:06:00Z","evidence_ref":"inspection-07","observed_units":4}'
Example response
{
"assessment_id": "window-07",
"status": "fail",
"observed_at": "2026-11-16T09:04:00Z",
"available_at": "2026-11-16T09:06:00Z",
"evidence_ref": "inspection-07",
"observed_units": 4,
"receipt": {
"sequence": 1,
"timestamp_utc": "2026-11-16T09:06:00.410Z",
"operation": "edit",
"previous_hash": "03cf5214c46c28bfd1a6a3cd3292537a29b8af71b0672801ab3f96a297db7790",
"payload": {
"kind": "outcome",
"assessment_id": "window-07",
"status": "fail",
"observed_units": 4,
"observed_at": "2026-11-16T09:04:00Z",
"available_at": "2026-11-16T09:06:00Z",
"request_sha256": "c76a380d1ca6784b50898b3f24d2564f84d793cbb854338eeaee64956bb058a1",
"outcome_sha256": "6d1e2f599ec3fc26d990805094e50459501192b82e8a1202410f4f62246869aa"
},
"receipt_hash": "d8e4dd3593ad522cd6af95b01072f85796a6c0c4eed984c35f54634993bca073"
}
}
POST /v1/why/evaluate_pattern
Compare a pattern and a baseline on the same eligible windows
Request body (application/json)
| Field | Type | Description |
|---|
asset required | string | |
pattern required | string | |
pattern_version required | string | |
context required | object | Comparable conditions, for example tool and recipe. |
outcome required | string | Name of the future event whose occurrence is recorded as a failure. |
horizon required | object | |
as_of required | string | RFC 3339 with explicit time zone and up to six fractional digits. |
Responses
| 200 | Operation result. |
| 400 | Missing or invalid API key. |
| 401 | unauthorized |
| 405 | method_not_allowed |
| 413 | body_too_large |
| 415 | unsupported_media_type |
| 500 | internal_error |
| 503 | storage_unavailable |
Example request
curl -X POST "https://api.qriton.com/v1/why/evaluate_pattern" \
-H "Authorization: Bearer $QRITON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"asset":"press-07","pattern":"slow_cycle_with_normal_force","pattern_version":"1","context":{"recipe":"join-a3","tool":"nest-42"},"outcome":"gauge_failure","horizon":{"count":5,"unit":"join"},"as_of":"2026-11-16T09:06:00Z"}'
Example response
{
"asset": "press-07",
"pattern": "slow_cycle_with_normal_force",
"pattern_version": "1",
"context": {
"recipe": "join-a3",
"tool": "nest-42"
},
"outcome": "gauge_failure",
"horizon": {
"count": 5,
"unit": "join"
},
"as_of": "2026-11-16T09:06:00Z",
"counts": {
"total": 1,
"resolved": 1,
"pending": 0,
"uninspected": 0,
"intervened": 0
},
"pattern_metrics": {
"warnings": 1,
"caught": 1,
"false_warnings": 0,
"missed": 0,
"quiet": 0,
"mean_lead_seconds": 240
},
"baseline_metrics": {
"warnings": 0,
"caught": 0,
"false_warnings": 0,
"missed": 1,
"quiet": 0,
"mean_lead_seconds": null
},
"workload_comparison": {
"pattern_warnings_all": 1,
"baseline_warnings_all": 0,
"same_warning_count": false,
"status": "unequal_workload",
"extra_failures_caught_at_equal_workload": null
}
}
GET /v1/why/assessments
List stored assessments, oldest first
Parameters
| Name | In | Type | Description |
|---|
asset | query | string | Only this asset. |
pattern | query | string | Only this pattern. |
limit | query | integer | Number of items to return. |
offset | query | integer | Position of the first item. |
Responses
| 200 | Operation result. |
| 400 | Missing or invalid API key. |
| 401 | unauthorized |
| 405 | method_not_allowed |
| 500 | internal_error |
| 503 | storage_unavailable |
Example request
curl -X GET "https://api.qriton.com/v1/why/assessments" \
-H "Authorization: Bearer $QRITON_API_KEY"
Example response
{
"assessments": [
{
"assessment_id": "window-07",
"asset": "press-07",
"pattern": "slow_cycle_with_normal_force",
"pattern_version": "1",
"as_of": "2026-11-16T09:00:00Z",
"matched": true,
"baseline_warning": false,
"status": "fail"
}
],
"count": 1,
"offset": 0,
"limit": 100
}
GET /v1/why/assessments/{assessment_id}
Read one assessment, its outcome and their receipts
Parameters
| Name | In | Type | Description |
|---|
assessment_id required | path | string | The ID given to assess_pattern, URL-encoded. |
Responses
| 200 | Operation result. |
| 400 | Missing or invalid API key. |
| 401 | unauthorized |
| 404 | assessment_not_found |
| 405 | method_not_allowed |
| 500 | internal_error |
| 503 | storage_unavailable |
Example request
curl -X GET "https://api.qriton.com/v1/why/assessments/{assessment_id}" \
-H "Authorization: Bearer $QRITON_API_KEY"
Example response
{
"assessment": {
"asset": "press-07",
"pattern": "slow_cycle_with_normal_force",
"pattern_version": "1",
"context": {
"recipe": "join-a3",
"tool": "nest-42"
},
"outcome": "gauge_failure",
"horizon": {
"count": 5,
"unit": "join"
},
"assessment_id": "window-07",
"as_of": "2026-11-16T09:00:00Z",
"matched": true,
"baseline_warning": false,
"evidence_ref": "controller-cycle-07",
"prior_resolved_matches": 0,
"prior_failures": 0,
"estimated_failure_probability": null,
"probability_interval_95": null,
"evidence": [],
"reason": "insufficient_history",
"recommendation": "review",
"receipt": {
"sequence": 0,
"timestamp_utc": "2026-11-16T09:00:01.250Z",
"operation": "inject",
"previous_hash": null,
"payload": {
"kind": "assessment",
"assessment_id": "window-07",
"as_of": "2026-11-16T09:00:00Z",
"matched": true,
"baseline_warning": false,
"recommendation": "review",
"prior_resolved_matches": 0,
"prior_failures": 0,
"request_sha256": "c76a380d1ca6784b50898b3f24d2564f84d793cbb854338eeaee64956bb058a1",
"result_sha256": "49b142cc2e7a45c2f6eb436fe293839d22f7bff08c37db511c5ad86c5e1ce685"
},
"receipt_hash": "03cf5214c46c28bfd1a6a3cd3292537a29b8af71b0672801ab3f96a297db7790"
}
},
"outcome": {
"assessment_id": "window-07",
"status": "fail",
"observed_at": "2026-11-16T09:04:00Z",
"available_at": "2026-11-16T09:06:00Z",
"evidence_ref": "inspection-07",
"observed_units": 4,
"receipt": {
"sequence": 1,
"timestamp_utc": "2026-11-16T09:06:00.410Z",
"operation": "edit",
"previous_hash": "03cf5214c46c28bfd1a6a3cd3292537a29b8af71b0672801ab3f96a297db7790",
"payload": {
"kind": "outcome",
"assessment_id": "window-07",
"status": "fail",
"observed_units": 4,
"observed_at": "2026-11-16T09:04:00Z",
"available_at": "2026-11-16T09:06:00Z",
"request_sha256": "c76a380d1ca6784b50898b3f24d2564f84d793cbb854338eeaee64956bb058a1",
"outcome_sha256": "6d1e2f599ec3fc26d990805094e50459501192b82e8a1202410f4f62246869aa"
},
"receipt_hash": "d8e4dd3593ad522cd6af95b01072f85796a6c0c4eed984c35f54634993bca073"
}
}
}
DELETE /v1/why/assessments/{assessment_id}
Delete an assessment and its outcome; the deletion is written to the receipt chain
Parameters
| Name | In | Type | Description |
|---|
assessment_id required | path | string | The ID given to assess_pattern, URL-encoded. |
Responses
| 200 | Operation result. |
| 400 | Missing or invalid API key. |
| 401 | unauthorized |
| 404 | assessment_not_found |
| 405 | method_not_allowed |
| 500 | internal_error |
| 503 | storage_unavailable |
Example request
curl -X DELETE "https://api.qriton.com/v1/why/assessments/{assessment_id}" \
-H "Authorization: Bearer $QRITON_API_KEY"
Example response
{
"assessment_id": "window-07",
"deleted": true,
"receipt": {
"sequence": 2,
"timestamp_utc": "2026-11-17T08:00:00.000Z",
"operation": "forget",
"previous_hash": "d8e4dd3593ad522cd6af95b01072f85796a6c0c4eed984c35f54634993bca073",
"payload": {
"kind": "assessment",
"assessment_id": "window-07",
"request_sha256": "c76a380d1ca6784b50898b3f24d2564f84d793cbb854338eeaee64956bb058a1",
"outcome_sha256": "6d1e2f599ec3fc26d990805094e50459501192b82e8a1202410f4f62246869aa"
},
"receipt_hash": "25b1b7fa7e981fcb9dda8cd71e4031aea0717d9f6c2b7eb0d41b8e08c5141f3d"
}
}
GET /v1/why/receipts
Page through the receipt chain of the account
Parameters
| Name | In | Type | Description |
|---|
limit | query | integer | Number of items to return. |
offset | query | integer | Position of the first item. |
Responses
| 200 | Operation result. |
| 400 | Missing or invalid API key. |
| 401 | unauthorized |
| 405 | method_not_allowed |
| 500 | internal_error |
| 503 | storage_unavailable |
Example request
curl -X GET "https://api.qriton.com/v1/why/receipts" \
-H "Authorization: Bearer $QRITON_API_KEY"
Example response
{
"receipts": [
{
"sequence": 0,
"timestamp_utc": "2026-11-16T09:00:01.250Z",
"operation": "inject",
"previous_hash": null,
"payload": {
"kind": "assessment",
"assessment_id": "window-07",
"as_of": "2026-11-16T09:00:00Z",
"matched": true,
"baseline_warning": false,
"recommendation": "review",
"prior_resolved_matches": 0,
"prior_failures": 0,
"request_sha256": "c76a380d1ca6784b50898b3f24d2564f84d793cbb854338eeaee64956bb058a1",
"result_sha256": "49b142cc2e7a45c2f6eb436fe293839d22f7bff08c37db511c5ad86c5e1ce685"
},
"receipt_hash": "03cf5214c46c28bfd1a6a3cd3292537a29b8af71b0672801ab3f96a297db7790"
},
{
"sequence": 1,
"timestamp_utc": "2026-11-16T09:06:00.410Z",
"operation": "edit",
"previous_hash": "03cf5214c46c28bfd1a6a3cd3292537a29b8af71b0672801ab3f96a297db7790",
"payload": {
"kind": "outcome",
"assessment_id": "window-07",
"status": "fail",
"observed_units": 4,
"observed_at": "2026-11-16T09:04:00Z",
"available_at": "2026-11-16T09:06:00Z",
"request_sha256": "c76a380d1ca6784b50898b3f24d2564f84d793cbb854338eeaee64956bb058a1",
"outcome_sha256": "6d1e2f599ec3fc26d990805094e50459501192b82e8a1202410f4f62246869aa"
},
"receipt_hash": "d8e4dd3593ad522cd6af95b01072f85796a6c0c4eed984c35f54634993bca073"
}
],
"count": 2,
"offset": 0,
"limit": 100,
"head": "d8e4dd3593ad522cd6af95b01072f85796a6c0c4eed984c35f54634993bca073"
}
GET /v1/why/receipts/export
Export the receipt chain as JSON lines, with the head in the X-Receipt-Head header
Responses
| 200 | Operation result. |
| 400 | Missing or invalid API key. |
| 401 | unauthorized |
| 405 | method_not_allowed |
| 500 | internal_error |
| 503 | storage_unavailable |
Example request
curl -X GET "https://api.qriton.com/v1/why/receipts/export" \
-H "Authorization: Bearer $QRITON_API_KEY"
Example response
"{\"sequence\":0,\"timestamp_utc\":\"2026-11-16T09:00:01.250Z\",\"operation\":\"inject\",\"previous_hash\":null,\"payload\":{\"kind\":\"assessment\",\"assessment_id\":\"window-07\",\"as_of\":\"2026-11-16T09:00:00Z\",\"matched\":true,\"baseline_warning\":false,\"recommendation\":\"review\",\"prior_resolved_matches\":0,\"prior_failures\":0,\"request_sha256\":\"c76a380d1ca6784b50898b3f24d2564f84d793cbb854338eeaee64956bb058a1\",\"result_sha256\":\"49b142cc2e7a45c2f6eb436fe293839d22f7bff08c37db511c5ad86c5e1ce685\"},\"receipt_hash\":\"03cf5214c46c28bfd1a6a3cd3292537a29b8af71b0672801ab3f96a297db7790\"}\n{\"sequence\":1,\"timestamp_utc\":\"2026-11-16T09:06:00.410Z\",\"operation\":\"edit\",\"previous_hash\":\"03cf5214c46c28bfd1a6a3cd3292537a29b8af71b0672801ab3f96a297db7790\",\"payload\":{\"kind\":\"outcome\",\"assessment_id\":\"window-07\",\"status\":\"fail\",\"observed_units\":4,\"observed_at\":\"2026-11-16T09:04:00Z\",\"available_at\":\"2026-11-16T09:06:00Z\",\"request_sha256\":\"c76a380d1ca6784b50898b3f24d2564f84d793cbb854338eeaee64956bb058a1\",\"outcome_sha256\":\"6d1e2f599ec3fc26d990805094e50459501192b82e8a1202410f4f62246869aa\"},\"receipt_hash\":\"d8e4dd3593ad522cd6af95b01072f85796a6c0c4eed984c35f54634993bca073\"}\n"
Scope and limits
- Comparable windows. Comparisons require the same tenant, asset, pattern, version, context, future outcome and horizon. The caller defines the condition and supplies a decision for every eligible window, including quiet windows.
- Evidence cutoff. Assessments use earlier windows with results available by the supplied decision time. Observation and availability times are supplied by the caller. A timestamp or evidence reference alone cannot authenticate a physical measurement.
- Observed frequency. The failure estimate is the fraction of comparable matched, resolved windows that failed. At least five are required. Its 95% Wilson interval assumes independent windows. Selection, repeated measurements and changes in the process can affect both the estimate and the interval.
- Incomplete inspections. A pass requires inspection of the full horizon. Windows awaiting a result, windows without an inspection and windows interrupted by an intervention are counted separately. Supply an independent inspection for quiet windows to measure missed failures.
- What the receipts show. Each new assessment, outcome and deletion adds one receipt to a hash-linked chain for the account. A receipt holds the identifiers and times supplied by the caller and hashes of the request and the result. A chain verified against a head you kept shows that no assessment was changed or removed without a trace after it was recorded. It cannot show that a reading or an inspection was correct.
- Deleted assessments. A deleted assessment and its outcome leave the store and later evaluations. The deletion stays visible in the receipt chain. Compare the chain with an evaluation before relying on its counts.
- Decision support. Review requests flag matched conditions. The caller retains control of holds and releases. A measured association does not establish the cause of a defect or the effect of acting on a warning.