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

# Record a Routing Correction

> Submit a playground 'Reroute' to teach Theo where the global classifier went wrong.

Records a single routing correction — a turn where the developer disagreed with the resolved mode and supplied the mode they expected. Theo keeps the last 30 days of corrections per caller and clusters them by `expected_mode`; once a cluster crosses the threshold, the playground surfaces an "I noticed a pattern" toast and the developer can ask Theo to [suggest a rule](/api-reference/routing-preferences/suggest-rule) derived from the cluster.

Corrections are personal-or-team scoped (matching the caller's active org context) so a personal correction never triggers a team-level suggestion banner.

## Authentication

Requires a Bearer token with the `billing` API key scope. Idempotent — the same `Idempotency-Key` header replays the same response.

## Body

<ParamField body="prompt" type="string" required>
  The prompt that produced the unexpected mode. 1–4096 chars. Vendor-name scrubbed at the service layer.
</ParamField>

<ParamField body="expected_mode" type="string" required>
  The Theo mode the developer expected (e.g. `"think"`, `"image"`, `"insurance_quote"`).
</ParamField>

<ParamField body="source_message_id" type="string">
  Optional message id of the turn the correction is attached to. ≤128 chars.
</ParamField>

## Request Examples

```bash curl theme={null}
curl -X POST https://www.hitheo.ai/api/v1/routing-preferences/corrections \
  -H "Authorization: Bearer $THEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Look at this indemnity clause",
    "expected_mode": "think"
  }'
```

## Response

```json theme={null}
{
  "id": "corr_abc123",
  "ok": true,
  "cluster_threshold": 3,
  "pattern_suggestion_available": true,
  "pattern_expected_mode": "think",
  "pattern_count": 3
}
```

When `pattern_suggestion_available` is `true`, call [POST /api/v1/routing-preferences/suggest-rule](/api-reference/routing-preferences/suggest-rule) with the matching `expected_mode` to receive a deterministic regex derived from the cluster.

## Errors

* `400 routing_correction_invalid` — Generic shape failure.
* `400 routing_correction_vendor_name` — Prompt mentions an upstream provider name (Claude, OpenAI, etc.).
* `400 routing_correction_invalid_mode` — `expected_mode` isn't a known Theo mode.
