> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat execute actions handler

> **Required scope:** sandbox:execute

**Required scope:** `sandbox:execute`

### Path parameters

**receipt\_id** `string` *required*

Execution receipt issued by the chat endpoint

### Request body

`ChatActionExecutionRequest`

**action\_types\_to\_execute** `string[]` *required*

### Response

`ChatResponse`

**analysis** `SymbolicAnalysis` *required*

**SymbolicAnalysis**

**categories** `CategoryMatch[]` *required*

Canonical categories that fired (ranked by score).

**CategoryMatch**

**category** `string` *required*

**domain** `string` *required*

**intent** `string` *required*

**matching\_rules** `integer` *required*

**score** `number (double)` *required*

**composite\_symbol** `number (double)[]` *required*

The GSS composite symbol for this message (24-field vector).

**confidence** `number (double)` *required*

Overall confidence score.

**domains** `string[]` *required*

Active domains.

**escalation\_triggered** `boolean` *required*

Whether escalation was triggered.

**horn\_clauses\_fired** `string[]` *required*

Horn clauses that fired.

**intents** `string[]` *required*

Active intents.

**matching\_rule\_count** `integer` *required*

Number of matching rules.

**safety\_gate\_triggered** `boolean` *required*

Whether a safety gate was triggered.

**supporting\_seed\_rules** `SupportingSeedRule[]` *required*

Top supporting seed rules that matched this message.

**SupportingSeedRule**

**category** `string` *required*

**domain** `string` *required*

**id** `string` *required*

**intent** `string` *required*

**name** `string` *required*

**score** `number (double)` *required*

**completion** `ChatCompletion` *required*

**ChatCompletion**

**action\_results** `ActionExecutionResult[]` *required*

Results from executing ready actions against available adapters.

**ActionExecutionResult**

**action\_type** `string` *required*

**details** `string[]` *required*

**matched\_entity\_ids** `string[]` *required*

**status** `string` *required*

**summary** `string` *required*

**tool\_name** `string` *required*

**clarifying\_question** `string`

Optional clarifying question when confidence is limited.

**evidence** `GroundingEvidence` *required*

**GroundingEvidence**

**kb\_entities** `GroundingEntityEvidence[]` *required*

**kb\_facts** `GroundingFactEvidence[]` *required*

**kb\_rules** `SupportingKbRule[]` *required*

**seed\_rules** `SupportingSeedRule[]` *required*

**execution\_receipt** `object`

**execution\_receipt**

**available\_action\_types** `string[]` *required*

**expires\_at** `string` *required*

**receipt\_id** `string` *required*

**generation** `CompletionGeneration` *required*

**CompletionGeneration**

**fallback\_reason** `string`

Populated when the model path failed and the endpoint fell back.

**mode** `string` *required*

`deterministic`, `llm_refined`, or `deterministic_fallback`.

**model** `string`

Configured model name when LLM refinement was attempted.

**token\_usage** `object`

**grounded** `boolean` *required*

Whether the reply is grounded in matched rules/context rather than pure guesswork.

**grounding** `GroundingSnapshot` *required*

**GroundingSnapshot**

**advanced\_reasoning** `object`

**history\_turns\_used** `integer` *required*

**kb\_entity\_count** `integer` *required*

**kb\_rule\_count** `integer` *required*

**org\_id** `string` *required*

**seed\_rule\_count** `integer` *required*

**strategy** `string` *required*

**strategy\_reason** `string` *required*

**needs\_human\_review** `boolean` *required*

Whether a human review or warm handoff is recommended.

**recursion\_trace** `RecursiveTraceStep[]` *required*

Recursive perceive/plan/respond/critique trace.

**RecursiveTraceStep**

**confidence** `number (double)` *required*

**focus** `string` *required*

**output** `string` *required*

**stage** `string` *required*

**step** `integer` *required*

**reply** `string` *required*

Final customer-facing reply.

**suggested\_actions** `SuggestedAction[]` *required*

Structured next actions for downstream tooling/UI.

**SuggestedAction**

**action\_type** `string` *required*

**can\_auto\_execute** `boolean` *required*

**execution\_status** `string` *required*

**label** `string` *required*

**missing\_inputs** `string[]` *required*

**reason** `string` *required*

**required\_inputs** `string[]` *required*

**tool\_name** `string`

**summary** `string` *required*

Short summary of what the recursive model inferred.

**tool\_calls** `ToolCall[]` *required*

Structured tool calls derived from org rules and detected context. Each tool call has a function name, arguments, and the policy justification.

**ToolCall**

**arguments** `object` *required*

Structured arguments extracted from the message and KB context.

**function** `string` *required*

Function name to invoke (e.g., 'issue\_refund', 'create\_return', 'escalate').

**id** `string` *required*

Unique ID for this tool call.

**policy** `ToolCallPolicy` *required*

**status** `string` *required*

Whether this call is ready to execute or needs more context.

**validation** `ChatValidation` *required*

**ChatValidation**

**action\_execution\_eligible** `boolean` *required*

**action\_execution\_reason** `string` *required*

**cited\_rule\_count** `integer` *required*

**grounded\_entity\_count** `integer` *required*

**grounding\_status** `string` *required*

**llm\_backend\_live** `boolean` *required*

**llm\_provider** `string` *required*

**proof\_status** `string` *required*

**validation\_level** `string` *required*

**guidelines** `Guideline[]` *required*

Suggested response guidelines based on fired rules.

**Guideline**

**category** `string` *required*

**directive** `string` *required*

**polarity** `string` *required*

**priority** `string` *required*

**messages** `ChatMessage[]` *required*

Conversation history including the new user turn and assistant reply.

**ChatMessage**

**content** `string` *required*

**role** `string` *required*

**session\_id** `string`

Optional session ID used to ground or persist this exchange.

### Status codes

| Code | Meaning |
| - | - |
| `200` | Executed selected chat actions against stored chat context |
| `400` | Invalid request |
| `401` | Unauthorized — missing or invalid credentials |
| `403` | Receipt does not match authenticated org scope |
| `404` | Receipt not found or expired |
| `422` | Requested actions are not executable for this receipt |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

```bash cURL theme={null}
curl --request POST \
  --url 'https://api.nsr.stateset.com/api/v1/nsr/chat/executions/{receipt_id}' \
  --header "X-API-Key: $STATESET_NSR_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "action_types_to_execute": [
    "string"
  ]
}'
```

```json 200 theme={null}
{
  "analysis": {
    "categories": [
      {
        "category": null,
        "domain": null,
        "intent": null,
        "matching_rules": null,
        "score": null
      }
    ],
    "composite_symbol": [
      1.5
    ],
    "confidence": 7.5,
    "domains": [
      "string"
    ],
    "escalation_triggered": true,
    "horn_clauses_fired": [
      "string"
    ],
    "intents": [
      "string"
    ],
    "matching_rule_count": 1,
    "safety_gate_triggered": true,
    "supporting_seed_rules": [
      {
        "category": null,
        "domain": null,
        "id": null,
        "intent": null,
        "name": null,
        "score": null
      }
    ]
  },
  "completion": {
    "action_results": [
      {
        "action_type": null,
        "details": null,
        "matched_entity_ids": null,
        "status": null,
        "summary": null,
        "tool_name": null
      }
    ],
    "clarifying_question": "string",
    "evidence": {
      "kb_entities": [],
      "kb_facts": [],
      "kb_rules": [],
      "seed_rules": []
    },
    "execution_receipt": {
      "available_action_types": [],
      "expires_at": "2026-08-31T14:22:05Z",
      "receipt_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "generation": {
      "fallback_reason": "string",
      "mode": "string",
      "model": "string",
      "token_usage": {
        "completion_tokens": null,
        "prompt_tokens": null,
        "total_tokens": null
      }
    },
    "grounded": true,
    "grounding": {
      "advanced_reasoning": {
        "enabled_features": null,
        "explanation_summary": null,
        "grounded_categories": null,
        "grounded_domains": null,
        "grounded_entities": null,
        "grounded_intents": null,
        "inferred_symbols": null,
        "machine_confidence": null,
        "machine_inputs": null,
        "machine_output": null,
        "machine_state_version": null,
        "recommended_strategy": null,
        "thought_count": null,
        "uncertainty": null
      },
      "history_turns_used": 1,
      "kb_entity_count": 1,
      "kb_rule_count": 1,
      "org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "seed_rule_count": 1,
      "strategy": "string",
      "strategy_reason": "string"
    },
    "needs_human_review": true,
    "recursion_trace": [
      {
        "confidence": null,
        "focus": null,
        "output": null,
        "stage": null,
        "step": null
      }
    ],
    "reply": "string",
    "suggested_actions": [
      {
        "action_type": null,
        "can_auto_execute": null,
        "execution_status": null,
        "label": null,
        "missing_inputs": null,
        "reason": null,
        "required_inputs": null,
        "tool_name": null
      }
    ],
    "summary": "Two-person tent, green — replacement for damaged pole set.",
    "tool_calls": [
      {
        "arguments": null,
        "function": null,
        "id": null,
        "policy": null,
        "status": null
      }
    ],
    "validation": {
      "action_execution_eligible": true,
      "action_execution_reason": "string",
      "cited_rule_count": 1,
      "grounded_entity_count": 1,
      "grounding_status": "string",
      "llm_backend_live": true,
      "llm_provider": "string",
      "proof_status": "string",
      "validation_level": "string"
    }
  },
  "guidelines": [
    {
      "category": "standard",
      "directive": "string",
      "polarity": "string",
      "priority": "string"
    }
  ],
  "messages": [
    {
      "content": "Two-person tent, green — replacement for damaged pole set.",
      "role": "string"
    }
  ],
  "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.