---
title: "Restore workspace"
method: POST
path: "/api/v1/agent/persistent/scheduler/restore_workspace"
tags: ["agent"]
---

# Restore workspace

`POST /api/v1/agent/persistent/scheduler/restore_workspace`

## Request

- Base URL: `https://composal.com` (the document declares no server; this is the origin it was published from)
- URL: `https://composal.com/api/v1/agent/persistent/scheduler/restore_workspace`
- Auth: HTTP bearer

Restore the saved specification and capsule under the current original Workflow chain, task generation, lifecycle and repository grants.

## Request body

- object
  - `organization_id` string, required
  - `agent_id` string, required
  - `task_id` string, required
  - `first_execution_run_id` string, required
  - `scope` PersistentAgentWorkerScope, required
    - `task_id` string, required
    - `segment_id` string, required
    - `generation` integer, required
    - `claim_id` string, required

## Response `200`

No-store trusted Activity response

- PersistentAgentWorkspaceRestore: Private no-store Activity response. Sequence zero has null snapshot; positive sequence restores its exact canonical capsule. Keep private data outside Temporal Workflow history.
  - `scope` PersistentAgentWorkerScope, required
    - `task_id` string, required
    - `segment_id` string, required
    - `generation` integer, required
    - `claim_id` string, required
  - `spec` PersistentAgentWorkspaceSpec, required
    - `task_id` string, required
    - `configuration_commit` string, required
    - `image` string, required: Explicit nonmoving provider image version; the trusted runtime independently verifies the applied image.
    - `setup_digest` string, required
    - `durable_paths` string[], required: Sorted relative regular-file paths; no overlaps, credentials or reserved paths.
  - `snapshot` PersistentAgentWorkspaceSnapshot, required: Bounded portable snapshot: exact declared file order, at most 512 KiB decoded total and 1 MiB canonical JSON. No image/runtime authority or provider allocation is stored.
    - `schema` 1, required
    - `spec` PersistentAgentWorkspaceSpec, required
      - `task_id` string, required
      - `configuration_commit` string, required
      - `image` string, required: Explicit nonmoving provider image version; the trusted runtime independently verifies the applied image.
      - `setup_digest` string, required
      - `durable_paths` string[], required: Sorted relative regular-file paths; no overlaps, credentials or reserved paths.
    - `files` PersistentAgentWorkspaceFile[], required
      - `path` string, required
      - `mode` 384 | 448, required
      - `size` integer, required
      - `sha256` string, required
      - `content` string, required: Canonical strict base64; decoded bytes must match size and sha256.
  - `sequence` integer, required
  - `version` string, required

## Other responses

- `401`: Invalid platform scheduler credential
- `403`: Current task authority unavailable
- `404`: Task or organization unavailable
- `409`: Canonical state or generation requires reconciliation
- `422`: Invalid or oversized request
- `502`: Bad gateway
- `503`: Canonical state or scheduler unavailable

---

[API](https://skmtc.dev/composal/apis/vex-api.md) - [All operations](https://skmtc.dev/composal/apis/vex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/composal/apis/vex-api/revisions/74298a24e040?raw)
