> ## 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.

# Policy impact handler

> decisions. Dry-run: bills nothing, logs nothing, persists nothing. **Required scope:** write

decisions. Dry-run: bills nothing, logs nothing, persists nothing.

**Required scope:** `write`

### Request body

`PolicyImpactRequest`

**add\_rules** `RecursiveChatRuleInput[]`

Rules to ADD to the org policy for the candidate replay. Evaluated org-side (target-binding and declared-effect semantics identical to a stored org rule). Each rule must have exactly one conclusion.

**limit** `integer`

Max logged decisions to replay, newest first (default 100, cap 500).

**remove\_rules** `string[]`

Names of existing org rules to REMOVE for the candidate replay.

### Response

`PolicyImpactResponse`

**candidate\_outcomes** `object` *required*

Verdict counts under the candidate policy, flipped or not.

**evaluated** `integer` *required*

Records replayed (had a request snapshot).

**flips** `PolicyImpactFlip[]` *required*

**PolicyImpactFlip**

**baseline** `PolicyVerdict` *required*

**PolicyVerdict**

**cited\_rules** `string[]` *required*

**outcome** `string` *required*

`approved | denied | refused` — from the same outcome gate as live.

**reason** `string` *required*

**candidate** `PolicyVerdict` *required*

**PolicyVerdict**

**cited\_rules** `string[]` *required*

**outcome** `string` *required*

`approved | denied | refused` — from the same outcome gate as live.

**reason** `string` *required*

**decision\_id** `string` *required*

**original\_outcome** `string` *required*

The outcome the platform originally returned (includes neural context; shown for reference, not the comparison baseline).

**query** `string` *required*

**scope** `string` *required*

What this replay does and does not evaluate.

**skipped\_no\_snapshot** `integer` *required*

Records skipped because they carried no request snapshot.

### Status codes

| Code | Meaning |
| - | - |
| `200` | Counterfactual replay report: outcome flips under the candidate policy |
| `400` | A candidate rule cannot be represented as a stored org rule (multiple conclusions or a declared effect) |
| `401` | Unauthorized — missing or invalid credentials |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

```bash cURL theme={null}
curl --request POST \
  --url 'https://api.nsr.stateset.com/v1/decisions/impact' \
  --header "X-API-Key: $STATESET_NSR_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "add_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": []
    }
  ],
  "limit": 20,
  "remove_rules": [
    "string"
  ]
}'
```

```json 200 theme={null}
{
  "candidate_outcomes": {},
  "evaluated": 1,
  "flips": [
    {
      "baseline": {
        "cited_rules": null,
        "outcome": null,
        "reason": null
      },
      "candidate": {
        "cited_rules": null,
        "outcome": null,
        "reason": null
      },
      "decision_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "original_outcome": "string",
      "query": "string"
    }
  ],
  "scope": "string",
  "skipped_no_snapshot": 1
}
```


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