> This page is for version v2025-04-21.
> For other versions, use one of these documentation indexes:
> - v2026-02-09 (default): https://docs.extend.ai/2026-02-09/llms.txt
> - v2025-04-21: https://docs.extend.ai/2025-04-21/llms.txt
> - v2024-12-23: https://docs.extend.ai/2024-12-23/llms.txt

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extend.ai/llms.txt
> Use this file to discover all available pages before exploring further.
>
> ## API version
> The current API version is `2026-02-09`, served at the site root (no version prefix in URLs).
> If this page URL contains `/2025-04-21/` or `/2024-12-23/`, you are reading an older API version.
> Prefer the current docs at https://docs.extend.ai/llms.txt unless the user explicitly needs that older version.
> Do not treat older-version pages as the source of truth for new integrations.

# Create Evaluation Set Item

POST https://api.extend.ai/evaluation_set_items
Content-Type: application/json

Evaluation set items are the individual files and expected outputs that are used to evaluate the performance of a given processor in Extend. This endpoint will create a new evaluation set item in Extend, which will be used during an evaluation run.

Best Practices for Outputs in Evaluation Sets:
- **Configure First, Output Later**
  - Always create and finalize your processor configuration before creating evaluation sets
  - Field IDs in outputs must match those defined in your processor configuration
- **Type Consistency**
  - Ensure output types exactly match your processor configuration
  - For example, if a field is configured as "currency", don't submit a simple number value
- **Field IDs**
  - Use the exact field IDs from your processor configuration
  - Create your own semantic IDs instead in the configs for each field/type instead of using the generated ones
- **Value**
  - Remember that all results are inside the value key of a result object, except the values within nested structures.


Reference: https://docs.extend.ai/2025-04-21/developers/api-reference/evaluation-set-endpoints/create-evaluation-set-item

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Headers

- `x-extend-api-version` ("2025-04-21", optional, default: 2025-04-21) — API version to use for the request. If you do not specify a version, you will either receive a `400 Bad Request` or be set to a previous legacy version. See [API Versioning](https://docs.extend.ai/2025-04-21/developers/api-versioning) for more details.

### Body (application/json)

This endpoint expects an object.

- `evaluationSetId` (string, required) — The ID of the evaluation set to add the item to. Example: `"ev_Xj8mK2pL9nR4vT7qY5wZ"`
- `fileId` (string, required) — Extend's internal ID for the file. It will always start with "file_". Example: `"file_xK9mLPqRtN3vS8wF5hB2cQ"`
- `expectedOutput` (ProvidedProcessorOutput, required) — The expected output that will be used to evaluate the processor's performance.

## Response

### 200

Successfully created evaluation set item

- `success` (boolean, required)
- `evaluationSetItem` (EvaluationSetItem, required) — The EvaluationSetItem object represents an item in an evaluation set in Extend. Items are the individual files and expected outputs that are used to evaluate the performance of a given processor in Extend.

## Errors

### 400 Bad Request Error

Bad Request

- `success` (boolean, optional)
- `error` (string, optional) — Error message

### 401 Unauthorized Error

Unauthorized

- `success` (boolean, optional)
- `error` (string, optional) — Error message

## Types

### ProvidedProcessorOutput

- ProvidedExtractionOutput: ProvidedExtractionOutput
- ProvidedClassifierOutput: ProvidedClassifierOutput
- ProvidedSplitterOutput: ProvidedSplitterOutput

### EvaluationSetItem

The EvaluationSetItem object represents an item in an evaluation set in Extend. Items are the individual files and expected outputs that are used to evaluate the performance of a given processor in Extend.

- `object` (string, required) — The type of response. In this case, it will always be `"evaluation_set_item"`.
- `id` (string, required) — The ID of the evaluation set item. Example: `"evi_kR9mNP12Qw4yTv8BdR3H"`
- `evaluationSetId` (string, required) — The ID of the evaluation set that this item belongs to. Example: `"ev_2LcgeY_mp2T5yPaEuq5Lw"`
- `fileId` (string, required) — Extend's internal ID for the file. It will always start with "file_". Example: `"file_xK9mLPqRtN3vS8wF5hB2cQ"`
- `expectedOutput` (ProvidedProcessorOutput, required) — The expected output that will be used to evaluate the processor's performance. This will confirm to the output type schema of the processor.

### ProvidedExtractionOutput

- ProvidedJsonOutput: ProvidedJsonOutput
- ProvidedFieldsArrayOutput: map from string to ProvidedExtractionFieldResult

### ProvidedClassifierOutput

- `id` (string, required) — The unique identifier for this classification
- `type` (string, required) — The type of classification
- `confidence` (double, optional, default: 1) — A value between 0 and 1 indicating the model's confidence in the classification, where 1 represents maximum confidence

### ProvidedSplitterOutput

- `splits` (list of ProvidedSplitterOutputSplitsItems, required)

### ProvidedJsonOutput

The output from a JSON Schema processor

- `value` (map from string to any, required)

### ProvidedExtractionFieldResult

- `id` (string, required) — The unique identifier for this field
- `value` (any, required) — The extracted value. More details can be found [here](https://docs.extend.ai/2025-04-21/product/legacy/output-type-legacy#extraction-output-type-fields-array).
- `type` (enum, optional) — The type of the extraction field result
  - Allowed values: `string`, `number`, `currency`, `boolean`, `date`, `array`, `enum`, `object`, `signature`
- `confidence` (double, optional, default: 1) — A value between 0 and 1 indicating confidence in the extraction. Will be set to 1 if not provided.
- `page` (double, optional, nullable) — The page number where this field was extracted from

### ProvidedSplitterOutputSplitsItems

- `id` (string, required) — Unique ID for this split
- `classificationId` (string, required) — ID of the classification type (set in the processor config)
- `type` (string, required) — The type of the split document (set in the processor config), corresponds to the classificationId
- `startPage` (integer, required) — The start page of the split document
- `endPage` (integer, required) — The end page of the split document
- `observation` (string, optional) — Explanation of the results
- `identifier` (string, optional) — Identifier for the split document (e.g. invoice number)

## Examples

**Request**

```json
{
  "evaluationSetId": "evaluation_set_id_here",
  "fileId": "file_id_here",
  "expectedOutput": {
    "value": {}
  }
}
```

**Response**

```json
{
  "success": true,
  "evaluationSetItem": {
    "object": "evaluation_set_item",
    "id": "evi_kR9mNP12Qw4yTv8BdR3H",
    "evaluationSetId": "ev_2LcgeY_mp2T5yPaEuq5Lw",
    "fileId": "file_xK9mLPqRtN3vS8wF5hB2cQ",
    "expectedOutput": {
      "value": {}
    }
  }
}
```