---
title: "Create Testset"
method: POST
path: "/testsets"
tags: ["Testsets"]
---

# Create Testset

`POST /testsets`

Create a testset with given name, save the testset to Postgres.

Args:
name (str): name of the test set.
testset (Dict[str, str]): test set data.

Returns:
str: The id of the test set created.

## Request body

- NewTestset
  - `name` string, required
  - `csvdata` object[], required

## Response `200`

Successful Response

- TestSetSimpleResponse
  - `id` string, required
  - `name` string, required
  - `created_at` string, required

## Other responses

- `422` — Validation Error

## Changes

- **2025-06-27** `e3e84db47198` — 1 breaking, 1 info
  - api path removed without deprecation
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/testsets/post.md)

---

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