# Trigger a suite run

Trigger a suite run. Schedules scenario executions for all active scenarios x targets x repeatCount. When the id names a test suite, the targets, the repeat count and the models are read from the body. Deprecated: use /api/v1/run-plans and /api/v1/test-suites.

> Page: https://langwatch.ai/docs/api-reference/suites/action-run
> Source: https://github.com/langwatch/langwatch/blob/main/docs/api-reference/suites/action-run.mdx
> Index of all pages: https://langwatch.ai/docs/llms.txt

## Endpoint

`POST https://app.langwatch.ai/api/v1/suites/{id}/run`

This operation is deprecated.

## Authentication

### project_api_key

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.

```json
{"id":"project_api_key","type":"apiKey","in":"header","name":"X-Auth-Token"}
```

## Parameters

### id (path, required)

```json
{"type":"string","minLength":1}
```

## Request body (optional)

#### application/json

Schema:

```json
{
  "type": "object",
  "properties": {
    "idempotencyKey": {"type":"string"},
    "name": {
      "description": "The run plan this run joins or creates. Used only when the id names a test suite; derived from the suite name and the targets when absent.",
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "targets": {
      "description": "The prompts, agents or workflows the run goes against. Read only when the id names a test suite, which stores no target of its own; a run plan already holds its own and refuses these.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["prompt","http","code","workflow","connected","voice"]
          },
          "referenceId": {"type":"string","minLength":1},
          "scenarioMappings": {
            "type": "object",
            "propertyNames": {"type":"string"},
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {"type":"string","const":"source"},
                    "sourceId": {"type":"string","minLength":1},
                    "path": {"type":"array","items":{"type":"string"}}
                  },
                  "required": ["type","sourceId","path"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {"type":"string","const":"value"},
                    "value": {"type":"string"}
                  },
                  "required": ["type","value"],
                  "additionalProperties": false
                }
              ]
            }
          },
          "runParameters": {
            "type": "object",
            "propertyNames": {"type":"string"},
            "additionalProperties": {
              "anyOf": [
                {"type":"string","maxLength":4096},
                {"type":"number"},
                {"type":"boolean"}
              ]
            }
          },
          "runSecretParameterNames": {
            "maxItems": 50,
            "type": "array",
            "items": {"type":"string","maxLength":64}
          }
        },
        "required": ["type","referenceId"],
        "additionalProperties": false
      }
    },
    "repeatCount": {
      "description": "How many times each scenario and target pairing runs, between 1 and 5. Used only when the id names a test suite.",
      "type": "integer",
      "minimum": 1,
      "maximum": 5
    },
    "simulatorModel": {
      "description": "The model that plays the user for every scenario in the run. Used only when the id names a test suite.",
      "type": ["string","null"]
    },
    "judgeModel": {
      "description": "The model that judges every scenario in the run. Used only when the id names a test suite.",
      "type": ["string","null"]
    },
    "traceQuietPeriodMs": {
      "description": "Milliseconds (0 to 60000) the agent's trace must stay unchanged before the judge reads it, for every scenario in the run. Used only when the id names a test suite.",
      "anyOf": [{"type":"integer","minimum":0,"maximum":60000},{"type":"null"}]
    },
    "traceWaitTimeoutMs": {
      "description": "Milliseconds (1000 to 300000) the judge waits for the agent's trace before a verdict, for every scenario in the run. Used only when the id names a test suite.",
      "anyOf": [{"type":"integer","minimum":1000,"maximum":300000},{"type":"null"}]
    },
    "parameters": {
      "description": "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.",
      "type": "object",
      "propertyNames": {"type":"string"},
      "additionalProperties": {
        "anyOf": [
          {"type":"string","maxLength":4096},
          {"type":"number"},
          {"type":"boolean"}
        ]
      }
    },
    "note": {
      "description": "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.",
      "type": "string",
      "maxLength": 200
    }
  }
}
```

## Request example

```bash
curl --request POST \
  --url 'https://app.langwatch.ai/api/v1/suites/<id>/run' \
  --header "X-Auth-Token: $LANGWATCH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"idempotencyKey":"string","name":"string","targets":[{"type":"prompt","referenceId":"string","scenarioMappings":{},"runParameters":{},"runSecretParameterNames":["string"]}],"repeatCount":1,"simulatorModel":"string","judgeModel":"string","traceQuietPeriodMs":0,"traceWaitTimeoutMs":1000,"parameters":{},"note":"string"}'
```

## Responses

### 200

Success

#### application/json

Schema:

```json
{
  "type": "object",
  "properties": {
    "scheduled": {"type":"boolean"},
    "batchRunId": {"type":"string"},
    "setId": {"type":"string"},
    "jobCount": {"type":"number"},
    "skippedArchived": {
      "type": "object",
      "properties": {
        "scenarios": {"type":"array","items":{"type":"string"}},
        "targets": {"type":"array","items":{"type":"string"}}
      },
      "required": ["scenarios","targets"],
      "additionalProperties": false
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "scenarioRunId": {"type":"string"},
          "scenarioId": {"type":"string"},
          "target": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["prompt","http","code","workflow","connected","voice"]
              },
              "referenceId": {"type":"string","minLength":1},
              "scenarioMappings": {
                "type": "object",
                "propertyNames": {"type":"string"},
                "additionalProperties": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {"type":"string","const":"source"},
                        "sourceId": {"type":"string","minLength":1},
                        "path": {"type":"array","items":{"type":"string"}}
                      },
                      "required": ["type","sourceId","path"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {"type":"string","const":"value"},
                        "value": {"type":"string"}
                      },
                      "required": ["type","value"],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "runParameters": {
                "type": "object",
                "propertyNames": {"type":"string"},
                "additionalProperties": {
                  "anyOf": [
                    {"type":"string","maxLength":4096},
                    {"type":"number"},
                    {"type":"boolean"}
                  ]
                }
              },
              "runSecretParameterNames": {
                "maxItems": 50,
                "type": "array",
                "items": {"type":"string","maxLength":64}
              }
            },
            "required": ["type","referenceId"],
            "additionalProperties": false
          },
          "name": {"type":["string","null"]}
        },
        "required": ["scenarioRunId","scenarioId","target","name"],
        "additionalProperties": false
      }
    },
    "planName": {"type":"string"},
    "created": {"type":"boolean"},
    "planSlug": {"type":"string"}
  },
  "required": [
    "scheduled",
    "batchRunId",
    "setId",
    "jobCount",
    "skippedArchived",
    "items",
    "planSlug"
  ],
  "additionalProperties": false
}
```

### 404

Not Found

#### application/json

Schema:

```json
{
  "type": "object",
  "properties": {"error":{"type":"string"},"message":{"type":"string"}},
  "required": ["error"],
  "additionalProperties": false
}
```

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.
