# Update eval

```http
PATCH /projects/{project_reference}/evals/{eval_id}
```

Change fields of a structured eval, such as its name, target, dataset or metrics, where an omitted field keeps its value; returns the updated eval source document. Requires project.evals.write.

## Parameters

| Name                 | In    | Required | Description                                                     |
| -------------------- | ----- | -------- | --------------------------------------------------------------- |
| `project_reference`  | path  | Yes      | Project slug, UUID, or domain that identifies the project.      |
| `eval_id`            | path  | Yes      |                                                                 |
| `source_target_kind` | query |          | Source to use: project or preview\_branch. Defaults to project. |
| `target_branch_id`   | query |          | Preview branch to use when the target kind is preview\_branch.  |

## Request body

| Field         | Type    | Required | Description                                            |
| ------------- | ------- | -------- | ------------------------------------------------------ |
| `name`        | string  |          | Updated eval name. Omit it to keep the name.           |
| `description` | string  |          | Updated description. Omit it to keep the description.  |
| `target`      | string  |          | Updated agent identifier. Omit it to keep the target.  |
| `dataset`     | object  |          | Updated dataset. Omit it to keep the dataset.          |
| `metrics`     | array   |          | Updated metrics. Omit them to keep the metrics.        |
| `repetitions` | integer |          | Updated repetitions. Omit them to keep the value.      |
| `tags`        | array   |          | Updated tags. Omit them to keep the tags.              |
| `metadata`    | object  |          | Updated metadata object. Omit it to keep the metadata. |

## Responses

| Status | Description                                                                                                 |
| ------ | ----------------------------------------------------------------------------------------------------------- |
| 200    | The updated eval source document.                                                                           |
| 400    | Bad request                                                                                                 |
| 401    | Unauthorized                                                                                                |
| 403    | Forbidden                                                                                                   |
| 404    | Not found                                                                                                   |
| 409    | Conflict                                                                                                    |
| 500    | Server error                                                                                                |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly. |
