Topolo Docs Topolo Platform
Open workspace

Export Inventory organization data

Export all six local Inventory stores across every workspace of the authenticated organization, with raw SQL column names. A workspace header does not narrow the scope and free-text/customer fields are not redacted.

Outcome

Export all six local Inventory stores across every workspace of the authenticated organization, with raw SQL column names. A workspace header does not narrow the scope and free-text/customer fields are not redacted.

Before you start

  • Verify the authenticated identity, exact environment and pinned approved organization context before preparing an action.
  • The published application permission is privacy:read. This is organization-wide and is not restricted by a workspace header; obtain the specific privacy purpose and authorization.
  • Authorize the documented inventory, review, import, notification, metering, privacy or archival effects before CLI --confirm or MCP confirm:true.

Discover the target

topolo whoami --json
topolo actions get app_topolo_inventory.organizations.data.export --detail --json
  • Use the exact authenticated organization id. A workspace resource header does not narrow this action.

Request

GET /api/organizations/{organizationId}/data

Save action input as payload.json. Inspect the plan for the exact path, query and body.

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

Input fields

FieldRequiredTypeConstraints
organizationIdRequiredstringExact authenticated organization id; this action spans all its local Inventory workspaces.; {"minLength":1}

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

Effects

  • Reads five core tables and the stock-movement table across the verified organization. No workspace resolution or local mirror insertion is performed.
  • Exports raw row columns including user IDs, creator email, notes, descriptions and failure reasons; it is not a sanitized public document or credentials-safe generic text extract.
  • The result explicitly excludes Auth organization/workspace identity. It does not contain delivered Notify data or establish backup erasure/retention enforcement.

Interpret the response

Use response path $.organizationId for organization. An empty list does not discover a target.

Match organizationId and schemaVersion 1; inspect all five core arrays and the one movements array. Empty data still returns the metadata/retention envelope. Handle the full organization export only for its authorized privacy purpose. Do not treat one workspace binding as export authorization for a narrower subset.

The success schema was checked against captured handler responses. Delegated Auth profile and canonical widget context fields can vary; exact Inventory projections and all six raw SQL export stores are source-reviewed. Error examples retain their actual refusal shapes.

View the complete success schema in the action console. The worked examples below retain complete captured responses; action discovery supplies the exact schema.

Worked examples

Captured exported Worker responses use both real local SQLite D1 databases with all six committed migrations, synthetic Auth/workspace grants and simulated Notify/Nexus/archive transport. They prove local handler shapes and scoped behavior, not live authorization, notification delivery, metering acceptance or environment deployment. Large 100-row list/capped-dashboard captures are retained in local evidence; committed tests verify those limits while worked guides use smaller complete responses. Refused examples demonstrate boundaries and must not be executed as successful workflows.

Successful request

Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: all organization workspaces exported despite one workspace header.

Input · payload.json:

{
  "organizationId": "org_inventory_fixture"
}

CLI:

topolo actions validate app_topolo_inventory.organizations.data.export --data @payload.json --json
topolo actions plan app_topolo_inventory.organizations.data.export --data @payload.json --json
topolo actions call app_topolo_inventory.organizations.data.export --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_inventory.organizations.data.export",
    "input": {
      "organizationId": "org_inventory_fixture"
    },
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "schemaVersion": 1,
  "application": "topolo-inventory",
  "organizationId": "org_inventory_fixture",
  "exportedAt": "2026-10-04T05:46:38.216Z",
  "stores": {
    "core": {
      "inventory_workspaces": [
        {
          "id": "ws_inventory_fixture",
          "organization_id": "org_inventory_fixture",
          "status": "active",
          "created_at": "2026-10-04T05:46:38.114Z",
          "updated_at": "2026-10-04T05:46:38.114Z"
        },
        {
          "id": "ws_inventory_second",
          "organization_id": "org_inventory_fixture",
          "status": "active",
          "created_at": "2026-10-04",
          "updated_at": "2026-10-04"
        }
      ],
      "inventory_items": [
        {
          "id": "invitem_d69d6494-b1f0-472a-8ce6-c2e8e5ddb02d",
          "organization_id": "org_inventory_fixture",
          "workspace_id": "ws_inventory_fixture",
          "sku": "WIDGET-BLUE",
          "name": "Blue widget",
          "description": "",
          "unit": "unit",
          "status": "active",
          "low_stock_threshold": 5,
          "created_by_user_id": "usr_inventory_fixture",
          "created_by_email": "operator@example.test",
          "created_at": "2026-10-04T05:46:38.112Z",
          "updated_at": "2026-10-04T05:46:38.112Z"
        }
      ],
      "inventory_locations": [
        {
          "id": "invloc_13fa047c-b024-4c44-99b8-75abe7cff675",
          "organization_id": "org_inventory_fixture",
          "workspace_id": "ws_inventory_fixture",
          "name": "Main warehouse",
          "code": "main",
          "is_default": 1,
          "created_at": "2026-10-04T05:46:38.132Z",
          "updated_at": "2026-10-04T05:46:38.132Z"
        }
      ],
      "inventory_import_jobs": [],
      "inventory_workspace_settings": [
        {
          "organization_id": "org_inventory_fixture",
          "workspace_id": "ws_inventory_fixture",
          "movement_review_threshold": 1,
          "updated_by_user_id": "usr_inventory_fixture",
          "updated_at": "2026-10-04T05:46:38.156Z"
        }
      ]
    },
    "movements": {
      "inventory_stock_movements": [
        {
          "id": "invmove_9515c62a-e304-4bf5-84c1-d5ec3b020789",
          "organization_id": "org_inventory_fixture",
          "workspace_id": "ws_inventory_fixture",
          "item_id": "invitem_d69d6494-b1f0-472a-8ce6-c2e8e5ddb02d",
          "location_id": "invloc_13fa047c-b024-4c44-99b8-75abe7cff675",
          "movement_type": "adjustment",
          "quantity_delta": 5,
          "note": "",
          "created_by_user_id": "usr_inventory_fixture",
          "created_by_email": "operator@example.test",
          "created_at": "2026-10-04T05:46:38.173Z",
          "review_status": "pending",
          "review_reason": "Absolute quantity delta 5 met the configured threshold 1.",
          "reviewed_by_user_id": null,
          "reviewed_at": null
        }
      ]
    }
  },
  "retention": {
    "policy": "Inventory records are retained until an authorized organization erasure succeeds.",
    "exclusions": [
      "Topolo Auth organization and workspace identity are platform-owned and are not erased by Inventory."
    ]
  }
}

HTTP 200. Match organizationId and schemaVersion 1; inspect all five core arrays and the one movements array. Empty data still returns the metadata/retention envelope. Handle the full organization export only for its authorized privacy purpose. Do not treat one workspace binding as export authorization for a narrower subset.

Another supported request

Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: empty organization export.

Input · payload.json:

{
  "organizationId": "org_inventory_fixture"
}

CLI:

topolo actions validate app_topolo_inventory.organizations.data.export --data @payload.json --json
topolo actions plan app_topolo_inventory.organizations.data.export --data @payload.json --json
topolo actions call app_topolo_inventory.organizations.data.export --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_inventory.organizations.data.export",
    "input": {
      "organizationId": "org_inventory_fixture"
    },
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "schemaVersion": 1,
  "application": "topolo-inventory",
  "organizationId": "org_inventory_fixture",
  "exportedAt": "2026-10-04T05:46:38.111Z",
  "stores": {
    "core": {
      "inventory_workspaces": [],
      "inventory_items": [],
      "inventory_locations": [],
      "inventory_import_jobs": [],
      "inventory_workspace_settings": []
    },
    "movements": {
      "inventory_stock_movements": []
    }
  },
  "retention": {
    "policy": "Inventory records are retained until an authorized organization erasure succeeds.",
    "exclusions": [
      "Topolo Auth organization and workspace identity are platform-owned and are not erased by Inventory."
    ]
  }
}

HTTP 200. Match organizationId and schemaVersion 1; inspect all five core arrays and the one movements array. Empty data still returns the metadata/retention envelope. Handle the full organization export only for its authorized privacy purpose. Do not treat one workspace binding as export authorization for a narrower subset.

Another supported request

Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: post-erasure empty stores retain metadata.

Input · payload.json:

{
  "organizationId": "org_inventory_fixture"
}

CLI:

topolo actions validate app_topolo_inventory.organizations.data.export --data @payload.json --json
topolo actions plan app_topolo_inventory.organizations.data.export --data @payload.json --json
topolo actions call app_topolo_inventory.organizations.data.export --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_inventory.organizations.data.export",
    "input": {
      "organizationId": "org_inventory_fixture"
    },
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "schemaVersion": 1,
  "application": "topolo-inventory",
  "organizationId": "org_inventory_fixture",
  "exportedAt": "2026-10-04T05:46:38.337Z",
  "stores": {
    "core": {
      "inventory_workspaces": [],
      "inventory_items": [],
      "inventory_locations": [],
      "inventory_import_jobs": [],
      "inventory_workspace_settings": []
    },
    "movements": {
      "inventory_stock_movements": []
    }
  },
  "retention": {
    "policy": "Inventory records are retained until an authorized organization erasure succeeds.",
    "exclusions": [
      "Topolo Auth organization and workspace identity are platform-owned and are not erased by Inventory."
    ]
  }
}

HTTP 200. Match organizationId and schemaVersion 1; inspect all five core arrays and the one movements array. Empty data still returns the metadata/retention envelope. Handle the full organization export only for its authorized privacy purpose. Do not treat one workspace binding as export authorization for a narrower subset.

Refused request · HTTP 403

Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: foreign organization forbidden.

Input · payload.json:

{
  "organizationId": "org_foreign"
}

CLI:

topolo actions validate app_topolo_inventory.organizations.data.export --data @payload.json --json
topolo actions plan app_topolo_inventory.organizations.data.export --data @payload.json --json

Captured local response · HTTP 403:

{
  "error": "organization_forbidden"
}

HTTP 403. 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

  • Match organizationId and schemaVersion 1; inspect all five core arrays and the one movements array. Empty data still returns the metadata/retention envelope.
  • Handle the full organization export only for its authorized privacy purpose. Do not treat one workspace binding as export authorization for a narrower subset.

Errors and recovery

  • invalid_action_input (HTTP 400): Correct only the exact fields reported by the published schema validator. An invalid input can be refused before its handler.
  • action_permission_required (HTTP 403): Stop when the verified credential lacks the published action permission. Resource identifiers and organization ownership do not grant that permission.
  • organization_forbidden (HTTP 403): The path organizationId must exactly match the authenticated organization; do not widen credential context to bypass refusal.

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

The read does not change local inventory records. No local rollback is needed; do not perform a mutation merely to reverse a read.

  • Erase Inventory organization data: With exact ERASE confirmation, refuse pending movement reviews or processing imports, then delete all six local Inventory stores across the organization and verify zero residual rows. Auth identity and other-owner data remain.

Evidence

Captured exported Worker responses use both real local SQLite D1 databases with all six committed migrations, synthetic Auth/workspace grants and simulated Notify/Nexus/archive transport. They prove local handler shapes and scoped behavior, not live authorization, notification delivery, metering acceptance or environment deployment. Large 100-row list/capped-dashboard captures are retained in local evidence; committed tests verify those limits while worked guides use smaller complete responses. Capture digests and test scenarios are retained in the source fixture records.