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

# Record what the agent should have said

> Stores a preference pair. When response_id is given, the customer message and the actual reply are read from the stored response rather than taken from the…

Stores a preference pair. When response\_id is given, the customer message and the actual reply are read from the stored response rather than taken from the request, so the recorded pair is authentic.

### Headers

**Idempotency-Key** `string`

Optional client-generated key that makes the POST safe to retry: a repeat with the same key and body replays the original response instead of creating a duplicate.

### Request body

`CreateEval`

**response\_id** `string (uuid)`

**preferred\_output** `string` *required*

Minimum length: `1`. Maximum length: `50000`.

**user\_message** `string`

Maximum length: `50000`.

**non\_preferred\_output** `string`

Maximum length: `50000`.

**agent\_id** `string (uuid)`

**name** `string`

Maximum length: `200`.

**description** `string`

Maximum length: `10000`.

**reason\_type** `string`

Maximum length: `100`.

**customer\_impact** `string`

Maximum length: `100`.

### Response

`object`

**object** `string` *required*

Allowed values: `'eval'`.

**id** `string (uuid)` *required*

**name** `string,null` *required*

From the stored `eval_name`.

**type** `string,null` *required*

Defaults to `preference` on create.

**status** `string,null` *required*

Defaults to `pending` on create.

**description** `string,null` *required*

**user\_message** `string,null` *required*

The customer message to replay. Copied from the source response when `response_id` was supplied.

**preferred\_output** `string,null` *required*

The reply the agent should have given.

**non\_preferred\_output** `string,null` *required*

The reply that was actually given. Copied from the source response when `response_id` was supplied.

**reason\_type** `string,null` *required*

**customer\_impact** `string,null` *required*

**response\_id** `string,null (uuid)` *required*

**agent\_id** `string,null (uuid)` *required*

**ticket\_id** `string,null` *required*

Stored as a string; derived from the source response when not supplied.

**created\_at** `string,null (date-time)` *required*

**updated\_at** `string,null (date-time)` *required*

### Status codes

| Code | Meaning |
| - | - |
| `201` | The created eval. When `response_id` was supplied, `user_message`, `non_preferred_output` and `ticket_id` come from the stored response, not the request. |
| `400` | Invalid request. `issues` names the offending field(s). |
| `401` | Missing, invalid, or expired API key. |
| `403` | The key lacks a required scope. |
| `404` | Not found, or not in the organization that owns the key. |
| `409` | Conflict — either the creation ceiling was reached for this organization (`agent_limit_reached`), or a request with the same Idempotency-Key is still in flight (`idempotency_in_progress`); retry the latter after the first attempt settles. |
| `422` | The Idempotency-Key was already used with a DIFFERENT request body (`idempotency_key_reused`). Reuse a key only to retry the identical request. |
| `429` | Rate limit exceeded. |

### Access

| | |
| - | - |
| Required scope | `responses:write` |
| Rate limit | 30 requests per minute |

### Using this contract

Read the [source OpenAPI document](https://docs.stateset.com/spec/responsecx.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://response.stateset.com/api/v1/evals' \
  --header "Authorization: Bearer $RESPONSECX_API_KEY" \
  --header "Idempotency-Key: ${IDEMPOTENCY_KEY:?Set a unique key for this operation; preserve it on retries}" \
  --header 'Content-Type: application/json' \
  --data '{
  "response_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "preferred_output": "string",
  "user_message": "string",
  "non_preferred_output": "string",
  "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "Two-Person Tent",
  "description": "Two-person tent, green — replacement for damaged pole set.",
  "reason_type": "string",
  "customer_impact": "string"
}'
```

```json 201 theme={null}
{
  "object": "eval",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "Two-Person Tent",
  "type": "standard",
  "status": "pending",
  "description": "Two-person tent, green — replacement for damaged pole set.",
  "user_message": "string",
  "preferred_output": "string",
  "non_preferred_output": "string",
  "reason_type": "string",
  "customer_impact": "string",
  "response_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "ticket_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_at": "2026-08-31T14:22:05Z",
  "updated_at": "2026-08-31T14:22:05Z"
}
```


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