# Reply feedback

On this page you turn the replies your application already gets from a hosted text model, and what your
users say about them, into chats and preference pairs for a text project's dataset.

Your **server** reports a conversation, the reply the model gave and what the user did with it: a
rating, a corrected reply, a note. You review each report and either keep it as a chat, keep it as a
pair, or skip it. Nothing enters the dataset until you keep it. Reply feedback is the text twin of
[Search feedback](./search-feedback.md).

**A kept pair can train a preference run.** A pair you keep is stored and checked, and a preference run
(`training_method: "dpo"`) learns from its chosen and rejected replies; a supervised run trains on the chat and
does not read the rejected reply. See [Preference pairs](../training/preference-pairs.md). A kept chat trains like
any other chat.

**What users write is customer content.** The conversation, the reply, the correction and the note are
stored as you send them, in your dataset, until you erase them. They are covered by the same deletion
and erasure rules as your chats and Search feedback, and ReOpenly does not train its own models on them.
See [Your data and your model](../getting-started/concepts.md#your-data-and-your-model). Send only what
your users have agreed to share.

Reporting and reviewing are **never billed**: no route here runs a model or charges your balance.

## Check availability {#availability}

Reply feedback belongs to a **text project's chat dataset**. The project lists the
`dataset.reply_feedback` capability (`GET /api/v1/projects/{owner_slug}/{project_number}` →
`project.capabilities`). An embedding dataset, a dataset that is not yours and one that does not exist
all answer the same `404 reply_dataset_not_found`.

## Report a reply {#report-a-reply}

```text
POST /api/v1/projects/{owner_slug}/{project_number}/datasets/{dataset_number}/reply-events
POST /api/v1/projects/{owner_slug}/{project_number}/datasets/{dataset_number}/reply-events/batch
```

Authenticate with an API key that has `data:write`, or a signed-in session. **Call this only from your
server**: never put an API key in browser code.

```bash
curl -X POST "https://reopenly.com/api/v1/projects/acme/12/datasets/42/reply-events" \
  -H "Authorization: Bearer $REOPENLY_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "event_id": "reply-2026-11-17-000123",
    "model": "support-assistant",
    "messages": [{"role": "user", "content": "Can I return this after 30 days?"}],
    "reply": {"text": "No."},
    "rating": 0,
    "corrected_reply": "Returns are free within 30 days. After that, contact support and we will look at it.",
    "note": "Too curt."
  }'
```

| Field | Rule |
| :-- | :-- |
| `event_id` | Your identifier, also the replay key |
| `model` | The slug of a hosted **text** model of this project, or a catalog base by its id, such as `ReOpenly/Qwen3.5-9B`. |
| `messages` | 1 to 64 messages, each `{role, content}` with `role` `system`, `user`, `assistant` or `tool`, up to 32 KiB each |
| `reply` | `{text}`: the reply the model gave |
| `rating` | Optional, a finite number from 0 to 1. A rating of 0.5 or more counts as thumbs up |
| `corrected_reply` | Optional, the reply the user wanted |
| `note` | Optional, 1 to 2,000 bytes |
| `metadata` | Optional: `occurred_at`, `model_revision`, `request_id` |

More on the longer rows above:

- **`model`**: A base has no revision, so `metadata.model_revision` is `422 invalid_event` with it. An unknown or foreign model, a retired or embedding base are all `404 model_not_found`.

One of `rating` and `corrected_reply` is required (`422 invalid_event`). Leave out members you do not
have; a `null` is refused. **Unknown fields are refused at every level**, unlike Search feedback.

A new event answers `201`; sending the same body with the same `event_id` again answers `200`; another
body under the same `event_id` is `409 idempotency_conflict`. A batch takes up to 50 events and 1 MiB,
all or nothing. Limits: 128 KiB per event; 10,000 retained events and 256 MiB of text per dataset
(`429 reply_dataset_quota_exceeded`); 60 requests and 500 events per UTC minute (`429 rate_limited`).
No refusal contains your users' text.

`GET .../datasets/{dataset_number}/snippets?purpose=reply_feedback` returns this call ready to run in Python,
cURL and JavaScript (text datasets only; an embedding dataset answers `422 validation_error` with `param`
`purpose`). It carries the placeholder `<your model slug>`, never your key or your chats. The answer's
`template` is the same call in cURL with every value a placeholder; the Reply feedback page shows it under
**Template** and the cURL call under **Example**, and **Copy for agent** copies both with the endpoint, the
fields and the `data:write` scope the key needs (never a key).

## Review in the inbox {#review}

The dataset's **Reply feedback** page has three tabs: **To review** (corrections waiting),
**Thumbs-down** (ratings with no correction) and **History** (replies you kept or skipped). The text
project's overview shows a **Review** stage and the newest replies waiting while any wait. Through the
API:

```text
# List replies. Optional query: view=inbox|history|labels,
# model, rating_max, has_note, received_after, received_before,
# limit, cursor
GET .../reply-events

POST .../reply-events/search
{"view":"inbox","q":"refund","limit":25}

GET .../reply-events/{event_id}

PATCH .../reply-events/{event_id}
{"expected_revision":1,"state":"skipped"}

POST .../reply-events/{event_id}/promote
{"expected_revision":1,"keep_as":"chat"}

GET .../reply-settings
GET .../reply-readiness
```

Search text goes in the body of `.../search`, never in a URL, and matches the reply, the correction and
the note. Pages are keyset-paginated; `total_count` counts what the filters match and `waiting_count` the
corrections waiting in the whole dataset (on the first page of the inbox). A stale `expected_revision` is
`409 revision_conflict`.

`GET .../reply-settings` also returns `models`: the models that reported at least one retained reply of this
dataset, sorted, by the id you send (a hosted model's slug or a catalog base such as `ReOpenly/Qwen3.5-9B`). They
are the values `model` can narrow the list to, and the options of the screen's model filter; a model that
reported nothing is not listed. The screen draws the filter only when two or more models are listed: with one model
the list simply shows that model's feedback.

**Skip** (`state: "skipped"`, and back to `unreviewed` to undo) creates nothing. A rating with no
correction cannot be skipped.

**Keep as a chat** (`keep_as: "chat"`) creates a chat in the dataset: the conversation with the user's
corrected reply as its last assistant message. Send `chosen_text` to replace the correction with your own
words; a rating with no correction needs it (`422 chosen_text_required`).

**Keep as a pair** (`keep_as: "pair"`) creates the same chat with the reply the model gave, word for word,
as its rejected reply, and runs the same checks as any [preference pair](../training/preference-pairs.md#pair-checks)
(for example `422 rejected_equals_chosen`).

Either keep is one step: the chat, the link to the report and the counters change together, or nothing
changes. If keeping would pass the dataset's capacity it answers `409 dataset_capacity_*` and writes
nothing. A `note` of yours may travel with the decision.

A chat kept this way has the source `editor` (`api` when a key kept it), so the source does not say where
it came from. Read it from the item: its read carries `feedback_origin` with the report's `event_id` and the
user's note, read-only, and its history says it was kept from Reply feedback. A row of the item list
(`POST .../items/search`) carries the same `feedback_origin` on a chat kept this way, so a list can mark it
without reading each chat; the key is absent on every other chat.

## Check readiness {#readiness}

`GET .../reply-settings` returns the workflow counts (waiting, kept, skipped, ratings, thumbs up and down,
ratings with a note, retained), storage use, the ingest limits and when the last reply arrived.
`GET .../reply-readiness` returns the dataset's `chats`, how many have a rejected reply, how many came from
Reply feedback, `usable_pairs`, the check `enough_usable_pairs` (at least 10 usable pairs) and the warning
`corrections_to_review`. These count what is in the dataset. They say nothing about how a run would
perform.

`GET /api/v1/projects` counts the corrections waiting in its `counts.reviews`, and `status=to_review`
lists projects that have some. The dataset read and the dataset list carry the same count as
`feedback_waiting` (ratings with no correction are not counted).

## Not covered {#not-covered}

- A catalog base is reported by its public id and shown by it; only the current text bases are accepted.
- Embedding Playground and Search requests are not Reply feedback; use
  [Search feedback](./search-feedback.md).
