eavz

Storage & KV Store

Built-in file storage and key-value persistence for your integrations.

Storage & KV Store

Weavz includes two built-in integrations for persistent data storage. Both are available without external authentication and work alongside your other integrations.

Storage Integration

The Storage integration provides file CRUD operations backed by object storage. Use it to store files, documents, and binary data.

Available Actions

ActionDescription
read_fileRead a file's contents by path
write_fileWrite content to a file (creates or overwrites)
delete_fileDelete a file by path
list_filesList files in a directory with optional prefix filter

Examples

Write a file:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "actionName": "write_file",
    "workspaceId": "proj_abc123",
    "input": {
      "path": "reports/monthly.json",
      "content": "{\"month\": \"January\", \"total\": 1500}"
    }
  }'

Read a file:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "actionName": "read_file",
    "workspaceId": "proj_abc123",
    "input": {
      "path": "reports/monthly.json"
    }
  }'

List files:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "actionName": "list_files",
    "workspaceId": "proj_abc123",
    "input": {
      "prefix": "reports/"
    }
  }'

KV Store Integration

The KV Store integration provides key-value persistence. Use it for caching, state management, counters, and simple data structures.

Available Actions

ActionDescription
putSet a key-value pair (string value)
getRetrieve the value for a key
deleteDelete a key-value pair
add_to_listAppend a value to a list stored at a key
remove_from_listRemove a value from a list stored at a key

Examples

Store a value:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "put",
    "workspaceId": "proj_abc123",
    "input": {
      "key": "last_sync_timestamp",
      "value": "2025-01-15T10:00:00Z"
    }
  }'

Retrieve a value:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "get",
    "workspaceId": "proj_abc123",
    "input": {
      "key": "last_sync_timestamp"
    }
  }'

Manage lists:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "add_to_list",
    "workspaceId": "proj_abc123",
    "input": {
      "key": "processed_orders",
      "value": "order_123"
    }
  }'

Persistence Scoping

Storage and KV Store actions include a scope input property that controls data isolation. Three scoping modes are available:

ScopeValueDescription
End User Boundend_user (default)Data is isolated per end user within the workspace. Requires endUserId in the request. Falls back to workspace scope if endUserId is not provided.
Workspace BoundworkspaceData is shared across the entire workspace. Different workspaces cannot access each other's data.
External ID BoundexternalData is scoped to a custom identifier via the externalId input property within the workspace. Useful for tenant, session, or entity-level isolation.

End-user-bound (default)

The default scope is end_user. When you pass endUserId in the action execution request, data is isolated per end user within the workspace. You can omit the scope field — it defaults to end_user.

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "put",
    "workspaceId": "proj_abc123",
    "endUserId": "user_12345",
    "input": {
      "key": "preferences",
      "value": {"theme": "dark"},
      "scope": "end_user"
    }
  }'

Data stored with endUserId: "user_12345" is isolated from data stored with endUserId: "user_67890" or workspace-scoped data. This is the recommended approach for multi-tenant applications.

Workspace-bound

Set scope to "workspace" to share data across all end users in a workspace. Different workspaces cannot access each other's data.

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "actionName": "write_file",
    "workspaceId": "proj_abc123",
    "input": {
      "path": "config.json",
      "content": "...",
      "scope": "workspace"
    }
  }'

External-ID-bound

Set scope to "external" and provide an externalId to create a custom scope tied to an external identifier. Useful when you need scoping tied to a specific tenant, session, or entity that doesn't map to an end user.

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "put",
    "workspaceId": "proj_abc123",
    "input": {
      "key": "preferences",
      "value": {"theme": "dark"},
      "scope": "external",
      "externalId": "tenant_123"
    }
  }'

Data stored with externalId: "tenant_123" is isolated from data stored with externalId: "tenant_456" or workspace-scoped data. The same externalId in different workspaces is also fully isolated.

Use Cases

Caching

Cache API responses to reduce calls to rate-limited services:

bash
# Check cache
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "get",
    "workspaceId": "proj_abc123",
    "input": { "key": "cache:slack:channels:W123" }
  }'

State Management

Track workflow state across multiple integration actions:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "put",
    "workspaceId": "proj_abc123",
    "input": {
      "key": "sync:cust_123:status",
      "value": "in_progress"
    }
  }'

File Storage

Store generated reports, exports, or media:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "actionName": "write_file",
    "workspaceId": "proj_abc123",
    "input": {
      "path": "exports/cust_123/report-2025-01.csv",
      "content": "name,amount\nAlice,100\nBob,200"
    }
  }'

Next Steps

Start using storage in the Playground or follow the Storage & KV guide.