---
title: Create Eval Dataset
description: "Create a dataset, optionally with rows. Columns are taken from the row cells; rows may record the production trace they came from."
product: general
lang: en
token_estimate: 1398
---
# Create Eval Dataset

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Create Eval Dataset

**POST** `/console/v1/eval_datasets`

Full URL: `https://statsigapi.net/console/v1/eval_datasets`

Create Eval Dataset

Create a dataset, optionally with rows. Columns are taken from the row cells; rows may record the production trace they came from.

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| name | string | Yes | — | Dataset name, unique in the project. Constraints: min length: 1 |
| description | string | No | — | — |
| rows | object[] | No | — | — |
| rows.columns | object[] | Yes | — | Cell values by column name. A column name not yet on the dataset is added to it. |
| rows.columns.name | string | Yes | — | Constraints: min length: 1 |
| rows.columns.value | string | Yes | — | — |
| rows.groups | string[] | No | — | Group names for the row, created when new. |
| rows.sourceTraceID | string | No | — | Trace the row was taken from, when it came from production. |
| rows.sourceSpanID | string | No | — | — |
| outputFields | string[] | No | — | Column names that hold outputs to grade instead of generating completions. |

## Response (application/json)

**201** — Create Eval Dataset

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.id | string | Yes | — | — |
| data.name | string | Yes | — | — |
| data.description | string | Yes | — | — |
| data.isGlobal | boolean | Yes | — | — |
| data.version | number | Yes | — | Counter bumped on every edit to the dataset rows or columns. Constraints: format: double |
| data.columns | object[] | Yes | — | — |
| data.columns.id | string | Yes | — | — |
| data.columns.name | string | Yes | — | — |
| data.groups | object[] | Yes | — | — |
| data.groups.id | string | Yes | — | — |
| data.groups.name | string | Yes | — | — |
| data.outputFields | string[] | Yes | — | — |
| data.imageFields | string[] | Yes | — | — |
| data.createdTime | number | Yes | — | Constraints: format: double |
| data.lastModifiedTime | number | Yes | — | Constraints: format: double |

```json
{
  "message": "string",
  "data": {
    "id": "string",
    "name": "string",
    "description": "string",
    "isGlobal": true,
    "version": 0,
    "columns": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "groups": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "outputFields": [
      "string"
    ],
    "imageFields": [
      "string"
    ],
    "createdTime": 0,
    "lastModifiedTime": 0
  }
}
```

**400** — Invalid request. Please check the request input and try again.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 400 |
| message | string | Yes | — | — |

```json
{
  "status": 400,
  "message": "Invalid request. Please check the request input and try again."
}
```

## Code samples

### cURL

```bash
curl -X POST "https://statsigapi.net/console/v1/eval_datasets" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.post(
    "https://statsigapi.net/console/v1/eval_datasets",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/eval_datasets", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/eval_datasets");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("POST", "https://statsigapi.net/console/v1/eval_datasets", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/eval_datasets"))
      .method("POST", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/eval_datasets")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

