---
title: "Save To Dataset"
method: POST
path: "/spans/{span_id}/save_examples"
tags: ["spans"]
---

# Save To Dataset

`POST /spans/{span_id}/save_examples`

Save all generation spans to the dataset

## Path parameters

- `span_id` string, uuid, required

## Response `201`

Successful Response

- SaveToDatasetResponse
  - `dataset_id` string, uuid, required — The ID of the dataset
  - `dataset_entry_id` string, uuid, required — The ID of the dataset entry
  - `input` string, nullable — The input of the dataset entry
  - `output` string, nullable — The output of the dataset entry
  - `expected` string, nullable — The expected output of the dataset entry
  - `comment` string, nullable — The comment of the dataset entry

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `402` — Payment Required (out of credits)
- `404` — Not Found
- `422` — Request Validation Error

---

[API](https://skmtc.dev/opper/apis/opper-api-v2.md) · [All operations](https://skmtc.dev/opper/apis/opper-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/opper/opper-api-v2/revisions/d3ccdaa15678/schema)
