## Get Evaluation Data Schema

**get** `/v5/evaluations/{evaluation_id}/schema`

Describe the data schema of an evaluation's items.

Inspects the item `data` and task-result fields and returns each discovered field with its
flattened key path, JSON type, source, and the number of items containing it, ordered
alphabetically by field name. For large evaluations the schema may be inferred from a sample of
items, in which case `is_sampled` is set and `sample_size` reports how many were analyzed. Set
`include_archived` to include archived items in the analysis.

### Path Parameters

- `evaluation_id: string`

### Query Parameters

- `include_archived: optional boolean`

  Include archived items in schema analysis

### Returns

- `EvaluationSchemaResponse object { evaluation_id, fields, total_items, 3 more }`

  Schema information for an evaluation's item data structure

  - `evaluation_id: string`

    The ID of the evaluation

  - `fields: array of object { data_type, field_name, item_count, 2 more }`

    List of all discovered fields, ordered alphabetically by field_name

    - `data_type: string`

      JSON type: 'string', 'number', 'boolean', 'object', 'array', or 'null'

    - `field_name: string`

      The flattened JSON key path (e.g., 'metadata.category')

    - `item_count: number`

      Number of evaluation items containing this field

    - `source: "data" or "task_result_cache"`

      The source of the field: 'data' or 'task_result_cache'

      - `"data"`

      - `"task_result_cache"`

    - `object: optional "field_schema"`

      - `"field_schema"`

  - `total_items: number`

    Total number of evaluation items

  - `is_sampled: optional boolean`

    Whether schema was computed from a sample of items (for large evaluations)

  - `object: optional "evaluation_schema"`

    - `"evaluation_schema"`

  - `sample_size: optional number`

    Number of items sampled for schema inference, if applicable

### Example

```http
curl https://api.egp.scale.com/v5/evaluations/$EVALUATION_ID/schema \
    -H "x-api-key: $SGP_API_KEY"
```

#### Response

```json
{
  "evaluation_id": "evaluation_id",
  "fields": [
    {
      "data_type": "data_type",
      "field_name": "field_name",
      "item_count": 0,
      "source": "data",
      "object": "field_schema"
    }
  ],
  "total_items": 0,
  "is_sampled": true,
  "object": "evaluation_schema",
  "sample_size": 0
}
```
