curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/answer' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"context": {},
"facts": {},
"include_decision": true,
"mode": "string",
"question": "string",
"rules": [
{
"category": "standard",
"constraints": [],
"description": "Two-person tent, green — replacement for damaged pole set.",
"effect": {
"0": "p",
"1": "e",
"2": "r",
"3": "m",
"4": "i",
"5": "t"
},
"enabled": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"if": [],
"name": "Two-Person Tent",
"priority": 1,
"then": []
}
],
"subject": "Replacement tent pole set"
}'
{
"auto_send": true,
"decision": {
"action": {
"confidence": 7.5,
"name": "Two-Person Tent",
"ready": true,
"reason": "Two-person tent, green — replacement for damaged pole set.",
"rule_conclusion": "string",
"rule_name": "string"
},
"confidence": 7.5,
"decision": "string",
"decision_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"dropped_citations": [
"string"
],
"evaluated_goal": "string",
"grounding": {
"cited_rule_count": 1,
"grounded_entity_count": 1,
"grounded_target_count": 1,
"status": "pending"
},
"gss_machine": {
"authority": "string",
"categories": [],
"classification_confidence": 7.5,
"domains": [],
"escalation_triggered": true,
"explanation": "string",
"grounded_symbol": "string",
"gss_v3_shadow": {
"candidate_rules": null,
"matched_predicates": null,
"matched_symbols": null,
"org_scoped": null
},
"horn_clauses_fired": [],
"inferred_symbols": [],
"intents": [],
"machine_confidence": 7.5,
"machine_output": "string",
"machine_state_version": 1,
"safety_gate_triggered": true,
"seed_grounded": true,
"seed_source": "string",
"symbol_alignment": 1.5
},
"plain_explanation": "string",
"proof": {
"cited_rules": [],
"derivation": {
"authorizing_predicate": null,
"cited_org_rules": null,
"org_facts_used": null,
"replayable": null,
"steps": null
},
"neural_steps": 1,
"planner_steps": 1,
"proof_score": 7.5,
"proof_status": "string",
"request_policy_hash": "string",
"symbolic_steps": 1
},
"rationale": "string",
"refusal": {
"missing_facts": [],
"reason": "Two-person tent, green — replacement for damaged pole set.",
"requires_human_review": true
},
"trace": [
{
"description": null,
"duration_ms": null,
"input": null,
"output": null,
"step_type": null,
"task_id": null
}
],
"usage": {
"billable": true,
"billing_tier": "string",
"elapsed_ms": 250,
"iterations": 8,
"max_depth_reached": 1,
"outcome_cost_microdollars": 1
},
"verifiable_bundle": null,
"warnings": [
"string"
],
"x_nsr": {
"action_results": [],
"action_runtime": {
"approved_action_types": null,
"blocked_action_types": null,
"executed_action_types": null,
"execution_receipt": null,
"lifecycle_stage": null,
"prepared_action_types": null,
"review_required_action_types": null
},
"answer": null,
"assistant_message": "string",
"audit_trace": [],
"context": {
"hydrated_entities": null,
"hydrated_rules": null,
"hydrated_triples": null,
"request_facts": null,
"request_rules": null,
"skipped_rule_names": null,
"skipped_rules": null
},
"cost": {
"api_surface": null,
"billable_outcome": null,
"billing_tier": null,
"elapsed_ms": null,
"estimated_cost_units": null,
"iterations": null,
"max_depth_reached": null,
"neural_steps": null,
"outcome_cost_microdollars": null,
"planner_steps": null,
"symbolic_steps": null
},
"explanation": "string",
"facts": [],
"goal": "string",
"mode": "fast",
"org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"proof": {
"cited_rules": null,
"completed_tasks": null,
"neural_steps": null,
"planner_steps": null,
"symbolic_steps": null
},
"session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"success": true,
"suggested_actions": [],
"tool_calls": [],
"trace": [],
"trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"uncertainty": {
"aleatoric": null,
"epistemic": null,
"mandatory_review": null,
"requires_human_review": null,
"total": null
},
"validation": {
"action_execution_eligible": null,
"action_execution_reason": null,
"cited_rule_count": null,
"grounded_entity_count": null,
"grounded_target_count": null,
"grounding_status": null,
"llm_backend_live": null,
"llm_provider": null,
"proof_score": null,
"proof_status": null,
"symbolic_step_count": null,
"validation_level": null
}
}
},
"evidence": {
"because": "string",
"cited_rules": [
"string"
],
"decision_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"grounding": "string",
"policy_hash": "string",
"replayable": true
},
"gaps": [
{
"fact": "string",
"needed_by_rule": "string"
}
],
"reply": {
"auto_send": true,
"macro_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"macro_name": "string",
"missing_slots": [
"string"
],
"rendered": "string",
"rule_name": "string"
},
"requires_human": [
"string"
],
"subject": "Replacement tent pole set",
"tool_call": null,
"verdict": "string"
}
Answer one ticket.
Required scope: write
POST
/
api
/
v1
/
answer
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/answer' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"context": {},
"facts": {},
"include_decision": true,
"mode": "string",
"question": "string",
"rules": [
{
"category": "standard",
"constraints": [],
"description": "Two-person tent, green — replacement for damaged pole set.",
"effect": {
"0": "p",
"1": "e",
"2": "r",
"3": "m",
"4": "i",
"5": "t"
},
"enabled": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"if": [],
"name": "Two-Person Tent",
"priority": 1,
"then": []
}
],
"subject": "Replacement tent pole set"
}'
{
"auto_send": true,
"decision": {
"action": {
"confidence": 7.5,
"name": "Two-Person Tent",
"ready": true,
"reason": "Two-person tent, green — replacement for damaged pole set.",
"rule_conclusion": "string",
"rule_name": "string"
},
"confidence": 7.5,
"decision": "string",
"decision_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"dropped_citations": [
"string"
],
"evaluated_goal": "string",
"grounding": {
"cited_rule_count": 1,
"grounded_entity_count": 1,
"grounded_target_count": 1,
"status": "pending"
},
"gss_machine": {
"authority": "string",
"categories": [],
"classification_confidence": 7.5,
"domains": [],
"escalation_triggered": true,
"explanation": "string",
"grounded_symbol": "string",
"gss_v3_shadow": {
"candidate_rules": null,
"matched_predicates": null,
"matched_symbols": null,
"org_scoped": null
},
"horn_clauses_fired": [],
"inferred_symbols": [],
"intents": [],
"machine_confidence": 7.5,
"machine_output": "string",
"machine_state_version": 1,
"safety_gate_triggered": true,
"seed_grounded": true,
"seed_source": "string",
"symbol_alignment": 1.5
},
"plain_explanation": "string",
"proof": {
"cited_rules": [],
"derivation": {
"authorizing_predicate": null,
"cited_org_rules": null,
"org_facts_used": null,
"replayable": null,
"steps": null
},
"neural_steps": 1,
"planner_steps": 1,
"proof_score": 7.5,
"proof_status": "string",
"request_policy_hash": "string",
"symbolic_steps": 1
},
"rationale": "string",
"refusal": {
"missing_facts": [],
"reason": "Two-person tent, green — replacement for damaged pole set.",
"requires_human_review": true
},
"trace": [
{
"description": null,
"duration_ms": null,
"input": null,
"output": null,
"step_type": null,
"task_id": null
}
],
"usage": {
"billable": true,
"billing_tier": "string",
"elapsed_ms": 250,
"iterations": 8,
"max_depth_reached": 1,
"outcome_cost_microdollars": 1
},
"verifiable_bundle": null,
"warnings": [
"string"
],
"x_nsr": {
"action_results": [],
"action_runtime": {
"approved_action_types": null,
"blocked_action_types": null,
"executed_action_types": null,
"execution_receipt": null,
"lifecycle_stage": null,
"prepared_action_types": null,
"review_required_action_types": null
},
"answer": null,
"assistant_message": "string",
"audit_trace": [],
"context": {
"hydrated_entities": null,
"hydrated_rules": null,
"hydrated_triples": null,
"request_facts": null,
"request_rules": null,
"skipped_rule_names": null,
"skipped_rules": null
},
"cost": {
"api_surface": null,
"billable_outcome": null,
"billing_tier": null,
"elapsed_ms": null,
"estimated_cost_units": null,
"iterations": null,
"max_depth_reached": null,
"neural_steps": null,
"outcome_cost_microdollars": null,
"planner_steps": null,
"symbolic_steps": null
},
"explanation": "string",
"facts": [],
"goal": "string",
"mode": "fast",
"org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"proof": {
"cited_rules": null,
"completed_tasks": null,
"neural_steps": null,
"planner_steps": null,
"symbolic_steps": null
},
"session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"success": true,
"suggested_actions": [],
"tool_calls": [],
"trace": [],
"trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"uncertainty": {
"aleatoric": null,
"epistemic": null,
"mandatory_review": null,
"requires_human_review": null,
"total": null
},
"validation": {
"action_execution_eligible": null,
"action_execution_reason": null,
"cited_rule_count": null,
"grounded_entity_count": null,
"grounded_target_count": null,
"grounding_status": null,
"llm_backend_live": null,
"llm_provider": null,
"proof_score": null,
"proof_status": null,
"symbolic_step_count": null,
"validation_level": null
}
}
},
"evidence": {
"because": "string",
"cited_rules": [
"string"
],
"decision_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"grounding": "string",
"policy_hash": "string",
"replayable": true
},
"gaps": [
{
"fact": "string",
"needed_by_rule": "string"
}
],
"reply": {
"auto_send": true,
"macro_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"macro_name": "string",
"missing_slots": [
"string"
],
"rendered": "string",
"rule_name": "string"
},
"requires_human": [
"string"
],
"subject": "Replacement tent pole set",
"tool_call": null,
"verdict": "string"
}
Required scope:
write
Request body
AnswerRequest
object
Merge-field values for the macro and its tool call.
object
What your systems know about the subject.
true asserts predicate(subject); any other scalar asserts predicate(subject, value) so thresholds work ({'order_amount': 620} -> order_amount(T-1, 620)); false and null assert nothing, which is what produces an honest refusal rather than a negative claim the engine never verified.boolean
Return the full decision envelope alongside the summary.
string
Reasoning profile:
fast | accurate | safe. Defaults to safe.string
The customer’s message. Optional: facts decide the outcome, so a ticket with no prose still answers.
RecursiveChatRuleInput[]
Inline policy. Omit to use the rules stored for this org.
string
required
What this decision is ABOUT — a ticket id, order id, or case id. First class because the engine binds authorization to it.
Response
AnswerResponse
boolean
required
True when this can ship untouched. False means read
requires_human.object
Show decision
Show decision
object
number (double)
required
string
required
approved | denied | refused.string
required
string[]
Org rules the engine fired during hydration that were dropped from
proof.cited_rules as unrelated to this decision. Persistently non-empty values mean a standing rule with permanently satisfied premises fires on every hydrated decision — scope or prune it.string
Exact predicate evaluated as the permit target. Absent for legacy requests that relied on action/query inference.
DecisionGrounding
required
GssMachineGroundingSnapshot
required
Show GssMachineGroundingSnapshot
Show GssMachineGroundingSnapshot
string
required
string[]
required
number (double)
required
Confidence of the GSS perception/classification stage.
string[]
required
boolean
required
string
string
Best-aligned canonical symbol under the variance-aware alignment.
object
string[]
required
string[]
required
string[]
required
number (double)
required
Confidence that NSRMachine recognized and executed the supplied grounded symbols. This is not an end-to-end decision confidence.
string
integer (int64)
Chat-mutation version of the org’s NSRMachine this decision inferred against, alongside
request_policy_hash in spirit: two runs of the same request stamped with the same version had the same machine view; differing stamps make cross-run drift auditable rather than silent (FINDING-nondeterministic-outcome, option 3).boolean
required
boolean
required
string
required
number (double)
Variance-aware (isotropic Mahalanobis) alignment of the message composite to that symbol’s centroid, in (0,1]:
exp(−d²/2σ²) with σ² the symbol’s learned seed variance. Use this to assess grounding uncertainty — unlike the classification mixture score, it reflects the symbol’s observed spread, not lexical overlap.string
required
Deterministic, proof-derived, business-readable ‘why’ — distinct from
rationale (engine narration): ‘Approved to issue a refund for order 9412: the return for order 9412 was received and order 9412 passed inspection.’ Always present.DecisionProof
required
Show DecisionProof
Show DecisionProof
string[]
required
Org rules cited in the derivation (the audit trail).
object
integer
required
integer
required
number (double)
required
0–1 proof strength from the engine’s validation pass.
string
required
string
sha256:<hex> over the canonicalized request-scoped facts and rules — pins this decision to the exact policy inputs it was evaluated against. Absent when the request carried no inline policy.integer
required
string
required
object
Show refusal
Show refusal
MissingFact[]
Request-scoped premises that would unblock an authorization proof: body atoms on the dependency path to a positive policy conclusion that neither the supplied facts nor any derivable conclusion satisfies. Empty for safety-gated refusals, which must not invite resubmission.
string
required
boolean
required
RecursiveChatTraceStep[]
DecisionUsage
required
object
A self-contained, INDEPENDENTLY-VERIFIABLE proof bundle for an approved decision: the exact facts and rules plus a
RuleEngine::backward_chain derivation of the authorization goal, in the knowledge::ProofBundle wire format. POST it verbatim to /v1/proofs/verify (or check it offline with the dependency-light proof_check) to confirm the verdict without trusting this server. Present only when the caller declared an authorization_goal AND the rule engine reproduces the proof; absent otherwise (the verdict still stands on its own derivation).string[]
Non-fatal advisories about how the verdict was derived (e.g. the outcome rested on predicate-name inference rather than declared rule effects). Omitted when empty.
object
Show x_nsr
Show x_nsr
ActionExecutionResult[]
required
RecursiveChatActionRuntime
required
object
string
required
RecursiveChatTraceStep[]
RecursiveChatContextSummary
required
RecursiveChatCost
required
string
required
RecursiveChatFactView[]
string
required
RecursiveChatMode
required
string
required
RecursiveChatProof
required
string
boolean
required
SuggestedAction[]
required
ToolCall[]
required
RecursiveChatTraceStep[]
string
required
RecursiveChatUncertainty
required
RecursiveChatValidation
AnswerEvidence
required
AnswerGap[]
object
Show reply
Show reply
boolean
required
True only when the macro is approved, fully filled, its tool call fully bound, and the macro itself armed for auto-send. Anything less is a draft for a human.
string
required
string
required
string[]
required
Merge fields with no value supplied. Non-empty blocks sending.
string
required
string
required
string[]
Why a human is needed. Empty means none is.
string
required
object
Emitted, NOT executed — the engine never holds your credentials. Run it against your own systems.
string
required
approved | denied | refused.Status codes
| Code | Meaning |
|---|---|
200 | The answer, its evidence, and any tool call |
401 | Unauthorized — missing or invalid credentials |
402 | Quota exhausted |
403 | Forbidden — the key/token lacks the required scope |
422 | Malformed request |
429 | Rate limited — see Retry-After / X-RateLimit-Reset |
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/answer' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"context": {},
"facts": {},
"include_decision": true,
"mode": "string",
"question": "string",
"rules": [
{
"category": "standard",
"constraints": [],
"description": "Two-person tent, green — replacement for damaged pole set.",
"effect": {
"0": "p",
"1": "e",
"2": "r",
"3": "m",
"4": "i",
"5": "t"
},
"enabled": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"if": [],
"name": "Two-Person Tent",
"priority": 1,
"then": []
}
],
"subject": "Replacement tent pole set"
}'
{
"auto_send": true,
"decision": {
"action": {
"confidence": 7.5,
"name": "Two-Person Tent",
"ready": true,
"reason": "Two-person tent, green — replacement for damaged pole set.",
"rule_conclusion": "string",
"rule_name": "string"
},
"confidence": 7.5,
"decision": "string",
"decision_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"dropped_citations": [
"string"
],
"evaluated_goal": "string",
"grounding": {
"cited_rule_count": 1,
"grounded_entity_count": 1,
"grounded_target_count": 1,
"status": "pending"
},
"gss_machine": {
"authority": "string",
"categories": [],
"classification_confidence": 7.5,
"domains": [],
"escalation_triggered": true,
"explanation": "string",
"grounded_symbol": "string",
"gss_v3_shadow": {
"candidate_rules": null,
"matched_predicates": null,
"matched_symbols": null,
"org_scoped": null
},
"horn_clauses_fired": [],
"inferred_symbols": [],
"intents": [],
"machine_confidence": 7.5,
"machine_output": "string",
"machine_state_version": 1,
"safety_gate_triggered": true,
"seed_grounded": true,
"seed_source": "string",
"symbol_alignment": 1.5
},
"plain_explanation": "string",
"proof": {
"cited_rules": [],
"derivation": {
"authorizing_predicate": null,
"cited_org_rules": null,
"org_facts_used": null,
"replayable": null,
"steps": null
},
"neural_steps": 1,
"planner_steps": 1,
"proof_score": 7.5,
"proof_status": "string",
"request_policy_hash": "string",
"symbolic_steps": 1
},
"rationale": "string",
"refusal": {
"missing_facts": [],
"reason": "Two-person tent, green — replacement for damaged pole set.",
"requires_human_review": true
},
"trace": [
{
"description": null,
"duration_ms": null,
"input": null,
"output": null,
"step_type": null,
"task_id": null
}
],
"usage": {
"billable": true,
"billing_tier": "string",
"elapsed_ms": 250,
"iterations": 8,
"max_depth_reached": 1,
"outcome_cost_microdollars": 1
},
"verifiable_bundle": null,
"warnings": [
"string"
],
"x_nsr": {
"action_results": [],
"action_runtime": {
"approved_action_types": null,
"blocked_action_types": null,
"executed_action_types": null,
"execution_receipt": null,
"lifecycle_stage": null,
"prepared_action_types": null,
"review_required_action_types": null
},
"answer": null,
"assistant_message": "string",
"audit_trace": [],
"context": {
"hydrated_entities": null,
"hydrated_rules": null,
"hydrated_triples": null,
"request_facts": null,
"request_rules": null,
"skipped_rule_names": null,
"skipped_rules": null
},
"cost": {
"api_surface": null,
"billable_outcome": null,
"billing_tier": null,
"elapsed_ms": null,
"estimated_cost_units": null,
"iterations": null,
"max_depth_reached": null,
"neural_steps": null,
"outcome_cost_microdollars": null,
"planner_steps": null,
"symbolic_steps": null
},
"explanation": "string",
"facts": [],
"goal": "string",
"mode": "fast",
"org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"proof": {
"cited_rules": null,
"completed_tasks": null,
"neural_steps": null,
"planner_steps": null,
"symbolic_steps": null
},
"session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"success": true,
"suggested_actions": [],
"tool_calls": [],
"trace": [],
"trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"uncertainty": {
"aleatoric": null,
"epistemic": null,
"mandatory_review": null,
"requires_human_review": null,
"total": null
},
"validation": {
"action_execution_eligible": null,
"action_execution_reason": null,
"cited_rule_count": null,
"grounded_entity_count": null,
"grounded_target_count": null,
"grounding_status": null,
"llm_backend_live": null,
"llm_provider": null,
"proof_score": null,
"proof_status": null,
"symbolic_step_count": null,
"validation_level": null
}
}
},
"evidence": {
"because": "string",
"cited_rules": [
"string"
],
"decision_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"grounding": "string",
"policy_hash": "string",
"replayable": true
},
"gaps": [
{
"fact": "string",
"needed_by_rule": "string"
}
],
"reply": {
"auto_send": true,
"macro_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"macro_name": "string",
"missing_slots": [
"string"
],
"rendered": "string",
"rule_name": "string"
},
"requires_human": [
"string"
],
"subject": "Replacement tent pole set",
"tool_call": null,
"verdict": "string"
}
Last modified on August 31, 2026