---
title: Trigger an Agent Analytics eval run
description: "Starts an asynchronous eval run and returns it immediately with a pending status. Poll the run by id, or read results through the Agent Analytics read surfac…"
product: general
lang: en
last_updated: 2026-10-21
token_estimate: 1714
---
# Trigger an Agent Analytics eval run

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

## Trigger an Agent Analytics eval run

**POST** `/v1/projects/{project_id}/agent-analytics/eval-runs`

Full URL: `https://developer-api.amplitude.com/v1/projects/{project_id}/agent-analytics/eval-runs`

**Servers:**
- Production (US): `https://developer-api.amplitude.com/v1/projects/{project_id}/agent-analytics/eval-runs`
- Production (EU): `https://developer-api.eu.amplitude.com/v1/projects/{project_id}/agent-analytics/eval-runs`

Trigger an Agent Analytics eval run

Starts an asynchronous eval run and returns it immediately with a pending
status. Poll the run by id, or read results through the Agent Analytics read
surface once it completes.

Target the run either at a dataset or at a session list, not both. Caps are
enforced server-side: 10 evaluators, 100 sessions, and a sample size of 100.

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| Authorization | string | Yes | — | http |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| project_id (path) | string | Yes | 12345 | Amplitude project identifier, backed by the canonical app ID. Constraints: pattern: ^[0-9]+$ |

## Header parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| Idempotency-Key (header) | string | Yes | — | Unique idempotency key used to safely retry write operations. Constraints: min length: 8, max length: 255 |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| evaluator_ids | string[] | Yes | — | Evaluators to run. Stable evaluator identifiers. |
| dataset_id | string | No | — | Evaluate the sessions in this dataset. Mutually exclusive with `session_ids`; exactly one of the two is required. |
| session_ids | string[] | No | — | Evaluate these sessions. Mutually exclusive with `dataset_id`; exactly one of the two is required. |
| sample_size | integer | No | 100 | Maximum sessions to evaluate from the target. Defaults to the 100-session cap, so omitting it evaluates as much of the target as the cap allows. The API always sends an explicit value upstream. The upstream default of 1 is deliberately never relied on, because omitting the field would otherwise evaluate a single session while appearing to evaluate the whole target. Constraints: min: 1, max: 100 |

## Response (application/json)

**201** — Eval run accepted and queued.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| data | object | Yes | — | — |
| data.id | string | Yes | — | Stable eval run identifier. |
| data.object | string | Yes | — | — |
| data.project_id | string | Yes | — | — |
| data.evaluator_ids | string[] | Yes | — | — |
| data.run_type | string | Yes | — | — |
| data.status | string | Yes | — | Lifecycle state of the run. |
| data.target_mode | string | Yes | — | How the run selected its sessions, such as by dataset or by filter. |
| data.total_sessions | integer | Yes | — | — |
| data.completed_sessions | integer | Yes | — | — |
| data.failed_sessions | integer | Yes | — | — |
| data.total_cost_usd | number | No | — | Constraints: nullable |
| data.avg_latency_ms | integer | No | — | Constraints: nullable |
| data.warnings | string[] | Yes | — | — |
| data.error | string | No | — | Constraints: nullable |
| data.created_by | string | No | — | Constraints: nullable |
| data.started_at | string | No | — | Constraints: format: date-time, nullable |
| data.completed_at | string | No | — | Constraints: format: date-time, nullable |

```json
{
  "data": {
    "id": "string",
    "object": "agent_analytics_eval_run",
    "project_id": "string",
    "evaluator_ids": [
      "string"
    ],
    "run_type": "string",
    "status": "string",
    "target_mode": "string",
    "total_sessions": 0,
    "completed_sessions": 0,
    "failed_sessions": 0,
    "total_cost_usd": 0,
    "avg_latency_ms": 0,
    "warnings": [
      "string"
    ],
    "error": "string",
    "created_by": "string",
    "started_at": "2024-01-01T00:00:00Z",
    "completed_at": "2024-01-01T00:00:00Z"
  }
}
```

**400**

**401**

**403**

**404**

**422**

**429**

**502**

## Code samples

### cURL

```bash
curl -X POST "https://developer-api.amplitude.com/v1/projects/12345/agent-analytics/eval-runs" \
  -H "Content-Type: application/json" \
  -H "Authorization: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.post(
    "https://developer-api.amplitude.com/v1/projects/12345/agent-analytics/eval-runs",
    headers={
        "Content-Type": "application/json",
        "Authorization": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://developer-api.amplitude.com/v1/projects/12345/agent-analytics/eval-runs", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://developer-api.amplitude.com/v1/projects/12345/agent-analytics/eval-runs");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "Authorization: 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://developer-api.amplitude.com/v1/projects/12345/agent-analytics/eval-runs", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "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://developer-api.amplitude.com/v1/projects/12345/agent-analytics/eval-runs"))
      .method("POST", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

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

uri = URI("https://developer-api.amplitude.com/v1/projects/12345/agent-analytics/eval-runs")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

