New version of a scenario
SDK platic.evals.scenarios.addVersion()
Edit a scenario by saving a new version. Send the complete content in scenario, including profileId, and specify scenarioId in the URL. Previous versions are preserved.
Suites with a pinned version keep using it; other suites use the new version in their next run. Editing a platform scenario creates a copy in your workspace.
Example
curl -X POST "https://api.platic.ai/v1/evals/scenarios/$SCENARIO_ID/versions" \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scenario": {
"scenarioId": "greets",
"profileId": "general",
"title": "Greets the customer by name",
"type": "script",
"user": { "steps": ["Hola, soy Ana"] },
"expect": { "checks": [{ "kind": "message_contains", "text": "Ana", "role": "agent" }] }
}
}' await platic.evals.scenarios.addVersion("greets", {
scenario: {
scenarioId: "greets",
profileId: "general",
title: "Greets the customer by name",
type: "script",
user: { steps: ["Hola, soy Ana"] },
expect: { checks: [{ kind: "message_contains", text: "Ana", role: "agent" }] },
},
}); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
scenarioId | string | The scenario you add the version to | ✓ |
Request body
{
"scenario": {
"title": "Books an appointment",
"profileId": "general",
"type": "script",
"user": { "steps": ["Hi, I want to book an appointment", "Tuesday afternoon", "Under the name Ana López"] },
"expect": {
"outcome": "The agent asks only for the missing details and confirms the day and time.",
"checks": [{ "kind": "tool_called", "tool": "book_appointment" }]
},
"run": { "nTrials": 3 }
}
} | Field | Type | Description | Required |
|---|---|---|---|
scenario | object | The complete content of the new version, with the fields of Scenario format. scenarioId comes from the route. | ✓ |
scenario.profileId | string | Here it does not default to general: send it, normally the same as the previous version. | ✓ |
Response
201 with the new version:
{
"status": "success",
"data": {
"scenarioId": "books_tuesday_appointment",
"version": 3,
"scope": "workspace",
"status": "active",
"proposedBy": "user",
"contentHash": "sha256:0c7e…",
"scenario": {
"scenarioId": "books_tuesday_appointment",
"title": "Books an appointment",
"profileId": "general",
"type": "script",
"run": { "nTrials": 3, "maxTurns": 12 }
}
}
} The response includes the complete scenario; the example shows only part of it. Defaults are applied.
Response fields
The same as in List scenarios.
Errors
| Status | details.code | When |
|---|---|---|
400 | INVALID_REQUEST | The content is not valid. details.issues has the path of each problem. It includes setup with content and the state_equals check (see what is no longer accepted). |
404 | EVAL_NOT_FOUND | The scenario does not exist in your workspace. |
Notes
- Past runs do not change: each trial reports the version it tested in
scenarioVersion. - It requires permission to edit agents (any).