---
title: Update Prompt Eval Settings
description: "Set the graders attached to a prompt (replacing the current list), which one is primary or critical, which grade online traffic, the eval dataset, and the on…"
product: general
lang: en
token_estimate: 1734
---
# Update Prompt Eval Settings

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

## Update Prompt Eval Settings

**PATCH** `/console/v1/prompts/{id}/eval_settings`

Full URL: `https://statsigapi.net/console/v1/prompts/{id}/eval_settings`

Update Prompt Eval Settings

Set the graders attached to a prompt (replacing the current list), which one is primary or critical, which grade online traffic, the eval dataset, and the online sampling rate.

## Authorizations

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

## Path parameters

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

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| graders | object[] | No | — | Graders attached to the prompt, replacing the current list; a grader left out is detached. Omit to keep the current graders. Flags left out on a grader keep their current values. |
| graders.id | string | No | — | Grader ID. |
| graders.name | string | No | — | Grader name, used when id is omitted. |
| graders.isPrimary | boolean | No | — | Grader shown as the headline score. When none is set, the current primary stays if still attached, else the first grader. |
| graders.isCritical | boolean | No | — | A critical grader that scores 0 fails the whole run. Defaults to the current value for an attached grader. |
| graders.isOnline | boolean | No | — | Also grade sampled production traffic with this grader. |
| dataset | string | No | — | Eval dataset name or ID to score offline evals against. Null leaves the dataset unchanged. Constraints: nullable |
| onlineSamplingRate | number | No | — | Percent of production traffic graded online, 0 to 10. Constraints: format: double, min: 0, max: 10 |

## Response (application/json)

**200** — Update Prompt Eval Settings

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.id | string | Yes | — | ID |
| data.name | string | No | — | The gate display name Constraints: min length: 3, max length: 100, pattern: ^[a-zA-Z0-9_\-. ]*$ |
| data.idType | string | No | — | — |
| data.description | string | Yes | — | Constraints: max length: 1000 |
| data.lastModifierID | string | Yes | — | ID of the last modifier. Constraints: nullable |
| data.lastModifiedTime | number | Yes | — | Time of the last modification. Constraints: format: double, nullable |
| data.lastModifierEmail | string | Yes | — | Email of the last modifier. Constraints: nullable |
| data.lastModifierName | string | Yes | — | Name of the last modifier. Constraints: nullable |
| data.creatorID | string | No | — | Constraints: nullable |
| data.createdTime | number | Yes | — | Timestamp when the entity was created. Constraints: format: double |
| data.creatorName | string | Yes | — | Name of the creator. Constraints: nullable |
| data.creatorEmail | string | No | — | Constraints: nullable |
| data.tags | string[] | No | — | — |
| data.targetApps | string[] | No | — | List of target applications associated with this configuration. |
| data.holdoutIDs | string[] | No | — | Holdouts applied to this configuration. |
| data.team | string | No | — | Constraints: nullable |
| data.teamID | string | No | — | Constraints: nullable |
| data.version | number | No | — | Version number Constraints: format: double |

```json
{
  "message": "string",
  "data": {
    "id": "string",
    "name": "string",
    "idType": "string",
    "description": "string",
    "lastModifierID": "string",
    "lastModifiedTime": 0,
    "lastModifierEmail": "string",
    "lastModifierName": "string",
    "creatorID": "string",
    "createdTime": 0,
    "creatorName": "string",
    "creatorEmail": "string",
    "tags": [
      "string"
    ],
    "targetApps": [
      "string"
    ],
    "holdoutIDs": [
      "string"
    ],
    "team": "string",
    "teamID": "string",
    "version": 0
  }
}
```

**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 PATCH "https://statsigapi.net/console/v1/prompts/{id}/eval_settings" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.patch(
    "https://statsigapi.net/console/v1/prompts/{id}/eval_settings",
    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/prompts/{id}/eval_settings", {
  method: "PATCH",
  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/prompts/{id}/eval_settings");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
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("PATCH", "https://statsigapi.net/console/v1/prompts/{id}/eval_settings", 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/prompts/{id}/eval_settings"))
      .method("PATCH", 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/prompts/{id}/eval_settings")
request = Net::HTTP::Patch.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
```

