---
docId: doc_225bb89d372e4ac2ab2710b7f664bec9
title: Archive a scenario
description: Remove a scenario from your workspace. All its versions are archived and no run uses it again.
api:
  group: agentes/evals/escenarios
  auth: bearer
  operations:
    - operationId: archiveEvalScenario
      method: POST
      path: '/v1/evals/scenarios/{scenarioId}/archive'
      postmanName: Archive a scenario
---

<script>
  import { Ways } from '$lib/components';
</script>

# Archive a scenario

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

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST "https://api.platic.ai/v1/evals/scenarios/$SCENARIO_ID/archive" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

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

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `scenarioId` | string | The scenario you archive | ✓ |

The request has no body.

## Response

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

```json
{
  "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](/api-reference/evals/scenarios/list#response-fields).

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `404` | `EVAL_NOT_FOUND` | The scenario does not exist in your workspace. |
| `409` | `EVAL_SCENARIO_IN_USE` | A suite that is not archived still uses it. `details.suiteIds` says which. |
| `409` | `EVAL_SCENARIO_READONLY` | It is a platform scenario (`scope: "platform"`): it cannot be archived. |

With a scenario that a suite still uses:

```json
{
  "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](/api-reference/evals/suites/replace), or archive them, and try again.

## Notes

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