Outcome
Read the 25 newest saved snapshots of an accessible document. This read can initialize the local workspace mirror and exposes no continuation cursor.
Before you start
- Verify the authenticated identity, environment and pinned organization before preparing an action.
- The published application permission is workspace:read. Discover and select a granted Compose workspace separately from action input. A supplied identifier does not grant access.
- Document reads require a read workspace grant; mirror initialization does not confer new access.
- Authorize the documented effects or private-data export before CLI --confirm or MCP confirm:true. HTTP method alone does not establish a read-only operation.
Discover the target
topolo whoami --json
topolo actions get app_topolo_compose.documents.versions.list --detail --json
topolo resources topolo-compose --json
topolo workspaces list topolo-compose --json
- Select the granted workspace id as COMPOSE_WORKSPACE_ID. Use document and version ids returned by accessible reads; fixture ids confer no live access.
Request
GET /api/documents/{documentId}/versions
Save action input as payload.json. Inspect the plan for the exact path, query and body. Set COMPOSE_WORKSPACE_ID from granted resource discovery.
Inspect and test this action in the signed action console, then perform the verification below.
Input fields
| Field | Required | Type | Constraints |
|---|---|---|---|
documentId | Required | string | {"minLength":1} |
Exact input schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1
}
},
"required": [
"documentId"
],
"additionalProperties": false
}
Effects
- Ensures the authorized workspace mirror exists.
- Reads up to 25 versions newest first for this document and workspace.
- Snapshots store text and provenance; they do not include the full current review/approval state.
Interpret the response
Use response path $.versions[].id for compose_document_version. An empty list does not discover a target.
Inspect versions[].id, documentId, reason and markdown. Use a returned versionId with documents.versions.restore; do not assume this bounded list contains all historical versions.
The success schema below was checked against captured handler responses. Optional structured generation metadata and integration-dependent values can vary. Error examples retain their actual refusal shapes.
Success schema:
{
"type": "object",
"required": [
"versions"
],
"properties": {
"versions": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"documentId",
"title",
"type",
"style",
"audience",
"markdown",
"sourceMaterial",
"generationContract",
"provider",
"model",
"reason",
"createdByUserId",
"createdByEmail",
"createdAt",
"wordCount"
],
"properties": {
"id": {
"type": "string"
},
"documentId": {
"type": "string"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
},
"style": {
"type": "null"
},
"audience": {
"type": "string",
"maxLength": 0
},
"markdown": {
"type": "string"
},
"sourceMaterial": {
"type": "null"
},
"generationContract": {
"type": "null"
},
"provider": {
"type": "null"
},
"model": {
"type": "null"
},
"reason": {
"type": "string"
},
"createdByUserId": {
"type": "string"
},
"createdByEmail": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"wordCount": {
"type": "number"
}
}
}
}
}
}
Worked examples
Responses were captured from the actual Compose Worker using synthetic users, organizations, content and identifiers. Tests simulate Auth, Nexus, Notify, metering and platform workspace transport and use an in-memory D1 adapter or local SQLite. They prove local handler behavior, not live model correctness, provider cost, notification delivery, real workspace grants or cross-store atomicity. HTTP 204 responses are exactly empty strings in the SDK transport. Replace fixture identifiers through credential-scoped discovery. Refused examples demonstrate boundaries and must not be executed as successful workflows.
Successful request
Actual Compose Worker response. Auth, Nexus, notifications, metering and platform workspace transport are simulated. D1 is an in-memory adapter or local SQLite as stated by the test. This does not prove a live model completion or notification delivery. No request credentials are captured. Captured scenario: document versions > list, create, and restore versions.
Input · payload.json:
{
"documentId": "97885e26-f7b9-41b9-8970-905f765115bb"
}
CLI:
topolo actions validate app_topolo_compose.documents.versions.list --data @payload.json --json
topolo actions plan app_topolo_compose.documents.versions.list --resource-type workspace --resource-id "$COMPOSE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_compose.documents.versions.list --resource-type workspace --resource-id "$COMPOSE_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_compose.documents.versions.list",
"input": {
"documentId": "97885e26-f7b9-41b9-8970-905f765115bb"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by granted resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 200:
{
"versions": [
{
"id": "c0d381b1-c1b7-44ed-b8dc-0c036c7d40a4",
"documentId": "97885e26-f7b9-41b9-8970-905f765115bb",
"title": "V2",
"type": "general",
"style": null,
"audience": "",
"markdown": "# V2 longer body here",
"sourceMaterial": null,
"generationContract": null,
"provider": null,
"model": null,
"reason": "manual",
"createdByUserId": "user_test_1",
"createdByEmail": "writer@stg.topolo.us",
"createdAt": "2026-10-04T02:26:27.275Z",
"wordCount": 5
},
{
"id": "9f427280-2d4a-4b08-8644-8f4929aed1be",
"documentId": "97885e26-f7b9-41b9-8970-905f765115bb",
"title": "V1",
"type": "general",
"style": null,
"audience": "",
"markdown": "# V1",
"sourceMaterial": null,
"generationContract": null,
"provider": null,
"model": null,
"reason": "created",
"createdByUserId": "user_test_1",
"createdByEmail": "writer@stg.topolo.us",
"createdAt": "2026-10-04T02:26:27.274Z",
"wordCount": 2
}
]
}
HTTP 200. Inspect versions[].id, documentId, reason and markdown. Use a returned versionId with documents.versions.restore; do not assume this bounded list contains all historical versions.
Another supported request
Actual Compose Worker response. Auth, Nexus, notifications, metering and platform workspace transport are simulated. D1 is an in-memory adapter or local SQLite as stated by the test. This does not prove a live model completion or notification delivery. No request credentials are captured. Captured scenario: compose workspace data isolation > version history is isolated per workspace and a cross-workspace version list 404s the parent.
Input · payload.json:
{
"documentId": "1bfbad18-68b1-4469-af84-c40d7ac169eb"
}
CLI:
topolo actions validate app_topolo_compose.documents.versions.list --data @payload.json --json
topolo actions plan app_topolo_compose.documents.versions.list --resource-type workspace --resource-id "$COMPOSE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_compose.documents.versions.list --resource-type workspace --resource-id "$COMPOSE_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_compose.documents.versions.list",
"input": {
"documentId": "1bfbad18-68b1-4469-af84-c40d7ac169eb"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by granted resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 200:
{
"versions": [
{
"id": "32aa28b3-148c-4ad4-a2f6-e378dfd042dd",
"documentId": "1bfbad18-68b1-4469-af84-c40d7ac169eb",
"title": "Alpha Brief",
"type": "general",
"style": null,
"audience": "",
"markdown": "# Alpha Brief",
"sourceMaterial": null,
"generationContract": null,
"provider": null,
"model": null,
"reason": "created",
"createdByUserId": "user_test_1",
"createdByEmail": "writer@stg.topolo.us",
"createdAt": "2026-10-04T02:26:27.247Z",
"wordCount": 3
}
]
}
HTTP 200. Inspect versions[].id, documentId, reason and markdown. Use a returned versionId with documents.versions.restore; do not assume this bounded list contains all historical versions.
Refused request · HTTP 404
Actual Compose Worker response. Auth, Nexus, notifications, metering and platform workspace transport are simulated. D1 is an in-memory adapter or local SQLite as stated by the test. This does not prove a live model completion or notification delivery. No request credentials are captured. Captured scenario: compose workspace data isolation > version history is isolated per workspace and a cross-workspace version list 404s the parent.
Input · payload.json:
{
"documentId": "1bfbad18-68b1-4469-af84-c40d7ac169eb"
}
CLI:
topolo actions validate app_topolo_compose.documents.versions.list --data @payload.json --json
topolo actions plan app_topolo_compose.documents.versions.list --resource-type workspace --resource-id "$COMPOSE_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 404:
{
"error": "not_found"
}
HTTP 404. The handler refused this request. Resolve its exact cause before retrying; input validation can reject an invalid fixture before it reaches the handler.
Verify the result
- Inspect versions[].id, documentId, reason and markdown.
- Use a returned versionId with documents.versions.restore; do not assume this bounded list contains all historical versions.
Errors and recovery
not_found(HTTP 404): Discover the accessible document and version in the selected workspace. A missing or inaccessible id is not permission to create a replacement.
Auth, action-input validation and platform resource resolution can refuse a request before its handler. Retain the exact error, request id and context; requesting another context is not a legitimate way to bypass a refusal.
Recovery boundary
Listing changes no version or text. A 404 means the parent document is missing or inaccessible in this context.
Related actions
- Get Compose document: Read one document in the authorized organization and workspace, including current markdown, provenance, approval metadata and archival state. This read can initialize the local workspace mirror.
- Restore saved Compose document text: Replace current text and provenance with an accessible saved version, first saving pre_restore text and then a restore snapshot. Approval metadata resets to draft.
Evidence
Responses were captured from the actual Compose Worker using synthetic users, organizations, content and identifiers. Tests simulate Auth, Nexus, Notify, metering and platform workspace transport and use an in-memory D1 adapter or local SQLite. They prove local handler behavior, not live model correctness, provider cost, notification delivery, real workspace grants or cross-store atomicity. HTTP 204 responses are exactly empty strings in the SDK transport. Replace fixture identifiers through credential-scoped discovery. Capture digests and test scenarios are retained in the source fixture records.