Archive a scenario

SDK platic.evals.scenarios.archive()

Stop using a scenario in new tests. First remove it from suites that use it or archive those suites, then send its scenarioId to archive it. All versions become archived, and past runs keep their conversations.

Example

await platic.evals.scenarios.archive("greets");

Path parameters

ParameterTypeDescriptionRequired
scenarioIdstringThe scenario you archive✓

The request has no body.

Response

200 with the scenario's newest version, already archived:

{
  "status": "success",
  "data": {
    "scenarioId": "books_tuesday_appointment",
    "version": 3,
    "scope": "workspace",
    "status": "archived",
    "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.

Response fields

The same as in List scenarios.

Errors

Statusdetails.codeWhen
404EVAL_NOT_FOUNDThe scenario does not exist in your workspace.
409EVAL_SCENARIO_IN_USEA suite that is not archived still uses it. details.suiteIds says which.
409EVAL_SCENARIO_READONLYIt is a platform scenario (scope: "platform"): it cannot be archived.

With a scenario that a suite still uses:

{
  "code": 409,
  "error": "Conflict - The resource state conflicts with this request",
  "details": {
    "code": "EVAL_SCENARIO_IN_USE",
    "message": "Scenario books_tuesday_appointment is listed by suites that are not archived",
    "suiteIds": ["s8Kd2LmQ"]
  }
}

Remove it from those suites with Replace a suite, or archive them, and try again.

Notes

  • Archiving it again returns it unchanged.
  • It requires permission to edit agents (any).