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

# outcomes-reconcile

> POST /outcomes/reconcile — checks live state when a tool call returns an unknown outcome. Returns decision: do_not_retry, retry_allowed, or replan.

Call this endpoint when a tool call returns an unknown outcome — a timeout, a dropped connection, or an ambiguous response. Invoke checks the live state you provide and returns a decision on whether to retry.

## Endpoint

```text theme={null}
POST https://api.invokehq.run/outcomes/reconcile
```

## Authentication

```bash theme={null}
-H "X-API-Key: your_api_key"
```

## Request body

```json theme={null}
{
  "action": {
    "intent": "charge_customer",
    "tool": "stripe.charge_customer",
    "params": { "customer_id": "cust_123", "amount": 2400, "currency": "usd" }
  },
  "outcome": "UNKNOWN",
  "current_state": { "charged": true, "customer_id": "cust_123", "amount": 2400 },
  "conditions": { "charged": true }
}
```

### Fields

| Field           | Type   | Required | Description                                  |
| --------------- | ------ | -------- | -------------------------------------------- |
| `action.intent` | string | Yes      | Human-readable label for the action          |
| `action.tool`   | string | Yes      | The tool that was called                     |
| `action.params` | object | Yes      | The parameters passed to the tool            |
| `outcome`       | string | Yes      | Must be `"UNKNOWN"`                          |
| `current_state` | object | Yes      | Live state snapshot from the source of truth |
| `conditions`    | object | Yes      | Expected conditions if the action succeeded  |

## Response

```json theme={null}
{
  "decision": "do_not_retry",
  "reason": "charged condition satisfied in current state",
  "status": "reconciled"
}
```

### Decision values

| Decision        | Meaning                                                           |
| --------------- | ----------------------------------------------------------------- |
| `do_not_retry`  | Live state confirms action already succeeded. Block the retry.    |
| `retry_allowed` | Live state confirms action did not succeed. Retry is safe.        |
| `replan`        | Live state has drifted from assumed context. Agent should replan. |

## Full example

```bash theme={null}
curl -X POST https://api.invokehq.run/outcomes/reconcile \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "intent": "charge_customer",
      "tool": "stripe.charge_customer",
      "params": { "customer_id": "cust_123", "amount": 2400, "currency": "usd" }
    },
    "outcome": "UNKNOWN",
    "current_state": { "charged": true, "customer_id": "cust_123", "amount": 2400 },
    "conditions": { "charged": true }
  }'
```

## Next steps

* [Reconciliation](/concepts/reconciliation) — concept documentation
* [POST /state/verify](/api/state-verify) — verify state before writes
* [TypeScript SDK](/sdk/typescript) — reconciliation via `invoke.call()`
