Topolo Docs Topolo Platform
Open workspace

Create space metadata export

Persist a JSON metadata snapshot for one space and return its downloadable artifact id.

Outcome

Persist a JSON metadata snapshot for one space and return its downloadable artifact id.

Before you start

  • Verify the authenticated identity, exact environment and pinned approved organization context before preparing an action.
  • The published application permission is workspace:write. Discover a granted Spaces workspace and bind that exact resource. Supplied identifiers do not grant access.
  • Authorize the documented storage, publication, invitation, notification, metering, privacy or archival effects before CLI --confirm or MCP confirm:true.

Discover the target

topolo whoami --json
topolo actions get app_topolo_spaces.exports.create --detail --json
topolo resources topolo-spaces --json
topolo workspaces list topolo-spaces --json
  • Select the exact granted workspace id as SPACES_WORKSPACE_ID. Fixture ids authorize no live operation.
  • Discover the exact spaceId from spaces.list or a retained creation response in this workspace.

Request

POST /api/spaces/{spaceId}/exports

Save action input as payload.json. Inspect the plan for the exact path, query and body. Set SPACES_WORKSPACE_ID from granted resource discovery.

Inspect and test this action in the signed action console, then perform the verification below.

Input fields

FieldRequiredTypeConstraints
spaceIdRequiredstringExact space id discovered from spaces.list or a creation response in this granted workspace.; {"minLength":1}

View the complete input schema in the action console. The same schema is available through CLI and MCP action discovery.

Effects

  • Writes exportedAt plus space, assets, annotations, publicLinks, jobs and runtimeAssetUrl to a new JSON object, then records artifact metadata and a pending export-ready notification together in core storage.
  • The artifact contains metadata and storage keys, not original asset bytes or a ZIP bundle. Every request creates a new id and snapshot.
  • If the core batch fails, the handler attempts to remove the new object. Successful local persistence does not prove recipient delivery.

Interpret the response

Use response path $.artifact.id for export_artifact. An empty list does not discover a target.

Save artifact.id and downloadUrl; call exports.download in the same workspace and verify the parsed snapshot and assetCount. Protect storage keys and unlisted slugs in the downloaded metadata. A snapshot is not a full capture backup.

The success schema was checked against captured handler responses. Delegated Auth identity and canonical widget context fields can vary; exact Spaces envelopes and all thirteen SQL export table sets are source-reviewed against the migrated local schema. Error responses can be plain text; the original refusal body is retained. Error examples retain their actual refusal shapes.

View the complete success schema in the action console. The worked examples below retain complete raw captured Worker responses. CLI responses have a transport envelope and can be bounded unless --detail is requested; action discovery supplies the exact schema.

Worked examples

Real isolated local D1/R2 and source handlers with synthetic Auth/workspace discovery, queue transport, notification delivery and metering. Arbitrary fixture SOG bytes demonstrate handler state only, not valid Gaussian data, renderer quality, deployed processing or live effects. Annotation rows are seeded directly into isolated fixture storage because no annotation mutation is published. Refused examples demonstrate boundaries and must not be executed as successful workflows.

Successful request

Actual local Worker response; all four migrated D1 databases and R2 are real. Auth identity/workspace discovery, queue transport, notification delivery and metering are simulated or disabled. Captured scenario: minimal.

Input · payload.json:

{
  "spaceId": "space_9338e6fc-cc93-421e-a783-6c8062088e0c"
}

CLI:

topolo actions validate app_topolo_spaces.exports.create --data @payload.json --json
topolo actions plan app_topolo_spaces.exports.create --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_spaces.exports.create --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --confirm --detail --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_spaces.exports.create",
    "input": {
      "spaceId": "space_9338e6fc-cc93-421e-a783-6c8062088e0c"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "artifact": {
    "id": "spaces_export_b529c4c4-3d5f-4f9d-bcf9-e9b602de07bf",
    "spaceId": "space_9338e6fc-cc93-421e-a783-6c8062088e0c",
    "format": "json",
    "assetCount": 1,
    "downloadUrl": "/api/exports/spaces_export_b529c4c4-3d5f-4f9d-bcf9-e9b602de07bf"
  }
}

HTTP 201. Save artifact.id and downloadUrl; call exports.download in the same workspace and verify the parsed snapshot and assetCount. Protect storage keys and unlisted slugs in the downloaded metadata. A snapshot is not a full capture backup.

Another supported request

Actual local Worker response; all four migrated D1 databases and R2 are real. Auth identity/workspace discovery, queue transport, notification delivery and metering are simulated or disabled. Captured scenario: workflow.

Input · payload.json:

{
  "spaceId": "space_bfe6af37-3588-406b-b103-7675eb527e82"
}

CLI:

topolo actions validate app_topolo_spaces.exports.create --data @payload.json --json
topolo actions plan app_topolo_spaces.exports.create --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_spaces.exports.create --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --confirm --detail --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_spaces.exports.create",
    "input": {
      "spaceId": "space_bfe6af37-3588-406b-b103-7675eb527e82"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "artifact": {
    "id": "spaces_export_a6ae238f-4bf5-4e06-b31d-f597ddca7376",
    "spaceId": "space_bfe6af37-3588-406b-b103-7675eb527e82",
    "format": "json",
    "assetCount": 1,
    "downloadUrl": "/api/exports/spaces_export_a6ae238f-4bf5-4e06-b31d-f597ddca7376"
  }
}

HTTP 201. Save artifact.id and downloadUrl; call exports.download in the same workspace and verify the parsed snapshot and assetCount. Protect storage keys and unlisted slugs in the downloaded metadata. A snapshot is not a full capture backup.

Another supported request

Actual local Worker response; all four migrated D1 databases and R2 are real. Auth identity/workspace discovery, queue transport, notification delivery and metering are simulated or disabled. Captured scenario: privacy.

Input · payload.json:

{
  "spaceId": "space_858bda7b-397a-4784-979e-609961a9a16e"
}

CLI:

topolo actions validate app_topolo_spaces.exports.create --data @payload.json --json
topolo actions plan app_topolo_spaces.exports.create --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_spaces.exports.create --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --confirm --detail --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_spaces.exports.create",
    "input": {
      "spaceId": "space_858bda7b-397a-4784-979e-609961a9a16e"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "artifact": {
    "id": "spaces_export_9541c95b-8e1b-4d2d-bca9-072ce77baa82",
    "spaceId": "space_858bda7b-397a-4784-979e-609961a9a16e",
    "format": "json",
    "assetCount": 1,
    "downloadUrl": "/api/exports/spaces_export_9541c95b-8e1b-4d2d-bca9-072ce77baa82"
  }
}

HTTP 201. Save artifact.id and downloadUrl; call exports.download in the same workspace and verify the parsed snapshot and assetCount. Protect storage keys and unlisted slugs in the downloaded metadata. A snapshot is not a full capture backup.

Verify the result

  • Save artifact.id and downloadUrl; call exports.download in the same workspace and verify the parsed snapshot and assetCount.
  • Protect storage keys and unlisted slugs in the downloaded metadata. A snapshot is not a full capture backup.

Errors and recovery

  • organization_context_required (HTTP 403): Stop and authenticate into the approved owning organization. Preserve the actual denial; a resource id does not grant organization access.
  • workspace_required (HTTP 400): Discover the exact granted canonical workspace through resource/workspace discovery; bootstrap does not return a workspace record.
  • space_not_found (HTTP 404): Rediscover the exact space id in this granted workspace through spaces.list or a saved creation response; deletion or another workspace can make it unavailable.

A plain-text server refusal is surfaced by CLI/MCP as http_error with its HTTP status and requestId; its text is not a structured service error.code. 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

There is no individual export deletion action. Space deletion removes artifact metadata while retaining object bytes; organization erasure removes currently tracked export objects. Downloaded copies need separate handling.

  • Download space metadata export: Download and parse a previously persisted JSON metadata snapshot in the selected workspace.
  • Get space: Read one space with its stored asset, annotation, public-link and processing-job records.

Evidence

Real isolated local D1/R2 and source handlers with synthetic Auth/workspace discovery, queue transport, notification delivery and metering. Arbitrary fixture SOG bytes demonstrate handler state only, not valid Gaussian data, renderer quality, deployed processing or live effects. Annotation rows are seeded directly into isolated fixture storage because no annotation mutation is published. Capture digests and test scenarios are retained in the source fixture records.