---
title: "Record script eval runs"
method: POST
path: "/api/scripts/{handle}/{host}/{slug}/evals/runs"
---

# Record script eval runs

`POST /api/scripts/{handle}/{host}/{slug}/evals/runs`

## Request

- Base URL: `https://reduck.ai`
- URL: `https://reduck.ai/api/scripts/{handle}/{host}/{slug}/evals/runs`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Link runs to the evals they executed, with each verdict once the run has ended, so they count for a promote. Each run must be your own run of this script, on the eval's browser. The first verdict recorded for a run stays.

## Path parameters

- `handle` string, required: The owner a resource is addressed under: "@username" for a personal scope, or a bare slug for a project.
- `host` string, required: The site the script automates, as a hostname.
- `slug` string, required: The script's unique identifier within its host, unique per owner.

## Request body

- object
  - `batch_id` string, uuid: The batch the runs were started in, when there is one.
  - `runs` object[], required
    - `eval_id` string, uuid, required
    - `run_id` string, uuid, required
    - `outcome` 'infra' | 'pass' | 'script' | 'validation': The verdict, once the run has ended. Omit it while the run is going.
    - `detail` string, nullable: Why it is not `pass`.

## Response `200`

OK

- object
  - `data` ScriptEval[], required
    - `id` string, required
    - `args` Recordstringunknown, required
    - `browser` 'extension' | 'managed', required
    - `region` string, required
    - `country` string, required
    - `validation_code` string, nullable, required
    - `note` string, nullable, required
    - `active` boolean, required: An inactive eval is kept but not run, and does not gate a promote.
    - `created_at` string, required
    - `latest` EvalVerdict, required
      - `run_id` string, required
      - `version_id` string, nullable, required: The version the run executed; null once that version was deleted.
      - `status` union, required
        - 'infra' | 'pass' | 'script' | 'validation'
        - 'pending'
      - `detail` string, nullable, required: Why the status is not `pass`.
      - `created_at` string, required
    - `args_error` string, nullable: Only when the list was asked for a `version_id` of this script: why the input schema of that version refuses the args of this eval, or null when it takes them. A version is not promoted while an active eval has one.

## Other responses

- `400`: Invalid request
- `401`: Not authenticated
- `403`: You may not edit this script.
- `404`: An id is not an eval of this script, or a run is not your run of it on the eval's browser.

---

[API](https://skmtc.dev/reduck/apis/reduck-api.md) · [All operations](https://skmtc.dev/reduck/apis/reduck-api/llms.txt) · [OpenAPI document](https://skmtc.dev/reduck/apis/reduck-api/revisions/a573b91206d6?raw)
