Skip to contentSkip to page list

Docs

Run a plan again

Run a run plan again, with the configuration it already holds. To run a different configuration, post it to /run under the plan's name.

POST/api/v1/run-plans/{id}/run
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/run-plans/<id>/run"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,}​response = requests.post(    origin + path,    headers=headers,)print(response.json())

Success

application/json · Generated from schema

{  "scheduled": false,  "batchRunId": "string",  "setId": "string",  "jobCount": 0,  "skippedArchived": {    "scenarios": [      "string"    ],    "targets": [      "string"    ]  },  "items": [    {      "scenarioRunId": "string",      "scenarioId": "string",      "target": {        "type": "prompt",        "referenceId": "string",        "scenarioMappings": {},        "runParameters": {},        "runSecretParameterNames": [          "string"        ]      },      "name": "string"    }  ],  "runPlanId": "string",  "planName": "string",  "created": false,  "platformUrl": "string"}
api-reference/run-plans/run-a-plan-again

Authorization

X-Auth-Tokenstringheaderrequired

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Path parameters

idstringrequired

The run plan id.

At least 1 character

Request body

application/json

idempotencyKeystring

Repeat the same key to make a retry join the batch the first call started instead of running everything again. Send the same request with it: the same key over a different configuration starts its own batch. Defaults to a new key per call.

parametersobject

Constant values applied to every scenario in the run, e.g. a fixture id or a tenant. A value supplied here overrides the scenario's own default for that name, and a target that names the same parameter in its runParameters overrides it for that target.

notestring

One short line describing why this batch was run, e.g. a commit hash or what you changed. It is stored on every run of the batch and shown beside the run in the platform. Up to 200 characters.

Up to 200 characters

Responses

200

Success

application/json

scheduledbooleanrequired

True once the runs are queued.

batchRunIdstringrequired

The id of this batch. Every run started here carries it.

setIdstringrequired

The result set the batch is filed under in the platform.

jobCountnumberrequired

How many runs were queued.

skippedArchivedobjectrequired

What the run left out, and why.

scenariosstring[]required

Scenarios left out because they are archived.

targetsstring[]required

Targets left out because they are archived.

itemsobject[]required

Every run this call queued.

scenarioRunIdstringrequired

The id of this single run.

scenarioIdstringrequired

The scenario that was run.

targetobjectrequired

What it was run against.

namestring | nullrequired

The scenario name, when known.

runPlanIdstringrequired

The run plan this run was filed under.

planNamestringrequired

The name that plan answers to.

createdbooleanrequired

True when this run created the plan, false when it joined a plan already there.

platformUrlstring (uri)required

Where to watch this run in the LangWatch platform.

404

Not Found

application/json

errorstringrequired
messagestring

Documentation