---
title: Send eval results
description: "Create a run on an existing eval from results scored outside Statsig. Each result carries its input, output, optional expected value and categories, and one…"
product: general
lang: en
token_estimate: 2028
---
# Send eval results

## Send eval results

**POST** `/console/v1/evals/send_results/{name}`

Full URL: `https://statsigapi.net/console/v1/evals/send_results/{name}`

> 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`.

Send eval results

Create a run on an existing eval from results scored outside Statsig. Each result carries its input, output, optional expected value and categories, and one or more named scores from 0 to 1.

## Authorizations

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

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| name (path) | string | Yes | — | name |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| name | string | No | My Eval Run | The name of the eval run Constraints: nullable |
| results | object[] | Yes | [{"input":"Foo","expected":"Hi Foo","output":"Hi Foo","category":["greeting"],"scores":{"correctness":{"score":1,"metadata":{"justification":"friendly"}},"tone":{"score":1}}}] | Results with input, expected, output and score fields, up to 10,000 per request. Statsig stores `latencyMs`, `inputTokens` and `outputTokens` without scoring them, and List Eval Run Result Rows returns them. |
| results.input | string | Yes | — | — |
| results.expected | string | No | — | — |
| results.output | string | Yes | — | — |
| results.category | oneOf | No | — | Constraints: string[], string |
| results.rowID | string | No | — | Stable id of the case this result belongs to, so runs line up row by row. With dataset, required and one of its row ids. Otherwise defaults to the position in results. |
| results.traceID | string | No | — | Trace that produced the output, when known. |
| results.spanID | string | No | — | — |
| results.latencyMs | number | No | — | Milliseconds the output took to generate. Constraints: min: 0 |
| results.inputTokens | number | No | — | Input tokens used to generate the output. When you send only one of `inputTokens` and `outputTokens`, Statsig stores the other as 0. Constraints: min: 0 |
| results.outputTokens | number | No | — | Tokens in the output. Constraints: min: 0 |
| results.scores | object | Yes | — | — |
| dataset | string | No | dataset1 | Name or id of the eval dataset the results were produced from. Runs on the same dataset are compared row by row. Constraints: min length: 1 |
| parameters | object | No | {"parameter_name":"parameter_value"} | Parameters |
| summaryScores | object | No | {"summary_score_name":100} | Summary scores |
| primaryGrader | string | No | — | Score name shown as the primary result. Defaults to the first score. |
| criticalGraders | string[] | No | — | Score names treated as release gates: a mean of 0 fails the whole run. |

## Response (application/json)

**200** — Send eval results

| 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.evalID | string | Yes | — | — |
| data.status | string | Yes | — | running until the run finishes, then completed, or failed when the run recorded an error. Allowed values: running, completed, failed |
| data.createdTime | number | Yes | — | Constraints: format: double |
| data.finishTime | number | Yes | — | Constraints: format: double, nullable |
| data.runTime | number | Yes | — | Constraints: format: double, nullable |
| data.datasetID | string | Yes | — | Dataset the run scored. Null for runs posted from code through send_results. Constraints: nullable |
| data.datasetItemCount | number | Yes | — | Constraints: format: double |
| data.graderIDs | string[] | Yes | — | — |
| data.primaryEvalGraderID | string | Yes | — | Constraints: nullable |
| data.parameters | object | Yes | — | Constraints: nullable |
| data.errorReason | string | Yes | — | Constraints: nullable |

```json
{
  "message": "string",
  "data": {
    "id": "string",
    "name": "string",
    "evalID": "string",
    "status": "running",
    "createdTime": 0,
    "finishTime": 0,
    "runTime": 0,
    "datasetID": "string",
    "datasetItemCount": 0,
    "graderIDs": [
      "string"
    ],
    "primaryEvalGraderID": "string",
    "parameters": {},
    "errorReason": "string"
  }
}
```

**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."
}
```

**403** — Forbidden. The request was valid, but the server is refusing action. You might not have the necessary permissions to access the resource.

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

```json
{
  "status": 403,
  "message": "Forbidden. The request was valid, but the server is refusing action. You might not have the necessary permissions to access the resource."
}
```

**404** — Not Found. The requested resource could not be found.

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

```json
{
  "status": 404,
  "message": "Not Found. The requested resource could not be found."
}
```

## Code samples

### cURL

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

### Python

```python
import requests

response = requests.post(
    "https://statsigapi.net/console/v1/evals/send_results/{name}",
    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/evals/send_results/{name}", {
  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/evals/send_results/{name}");
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/evals/send_results/{name}", 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/evals/send_results/{name}"))
      .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/evals/send_results/{name}")
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
```

