---
title: "Add a dataset item"
method: POST
path: "/v1/projects/{project_id}/datasets/{dataset_id}/items"
tags: ["Evaluations"]
---

# Add a dataset item

`POST /v1/projects/{project_id}/datasets/{dataset_id}/items`

## Request

- Base URL: `https://api.naturali.ai`
- URL: `https://api.naturali.ai/v1/projects/{project_id}/datasets/{dataset_id}/items`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.naturali.ai/authorize`, token URL `https://api.naturali.ai/token`, scopes: `mcp:access`)

Adds one test case. `input` is replayed verbatim as the generation's messages, so it must be a non-empty array of `{ role, content }`.

## Path parameters

- `dataset_id` string, required

## Request body

- object
  - `input` object[], required: Messages replayed verbatim as the generation's input
    - `role` string, required
    - `content` string, required: Message content — a string, or AI SDK content parts
  - `expected_output` string, nullable: Reference answer for exact_match / embedding_similarity / llm_judge scorers
  - `metadata` NullableMetadataBag, nullable: A `MetadataBag` on a request field where `null` is meaningful: a full-replacement update that clears the bag. A record whose bag is unset leaves the field out.

## Response `201`

Dataset item created successfully

- DatasetItem
  - `id` string
  - `dataset_id` string
  - `input` object[]: Messages replayed verbatim as the generation's input
    - `role` string, required
    - `content` string, required: Message content — a string, or AI SDK content parts
  - `expected_output` string, nullable
  - `metadata` MetadataBag: Caller-owned annotations on a resource, stored as the object they were written as: the types a value was written with are the types a read returns, so a filter can ask an ordering question about a number. Unlike other body fields, keys are stored and returned verbatim in the casing supplied — they are not converted between snake_case and camelCase. No key is reserved, and that is the point: every piece of state the platform owns lives in its own typed column, so nothing written here reaches platform state. The platform never reads the bag — it is not an IAM context, not a policy input and not part of a prompt — which is what separates it from a tag bag.
  - `source_generation_id` string, nullable: The generation this item was curated from. A curated item is a deliberate fixture: erasing the source generation neither deletes nor mutates it.
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400`: Bad request (input is not message-shaped)
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Dataset not found
- `409`: The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). A fixture is a corpus write like a document, so it is bounded by the same cap; delete stored content or raise the quota — no `Retry-After` is sent, since no window reset clears a stored total.

---

[API](https://skmtc.dev/naturali/apis/naturali-ai-api.md) · [All operations](https://skmtc.dev/naturali/apis/naturali-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/naturali/apis/naturali-ai-api/revisions/e4905b78f422?raw)
