Docs Guides Using Storage & KV Store Weavz includes two built-in integrations for persistent data: Storage for files and KV Store for key-value data. Both are accessed through the standard action execution API — no additional connections required.
The Storage integration provides file CRUD operations backed by S3-compatible object storage.
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "storage",
"actionName": "write_file",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"path": "reports/monthly.json",
"content": "{\"revenue\": 50000, \"month\": \"January\"}"
}
}' await client.actions. execute ( 'storage' , 'write_file' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: {
path: 'reports/monthly.json' ,
content: JSON . stringify ({ revenue: 50000 , month: 'January' }),
},
}) import json
client.actions.execute( "storage" , "write_file" ,
workspace_id = "YOUR_WORKSPACE_ID" ,
input = {
"path" : "reports/monthly.json" ,
"content" : json.dumps({ "revenue" : 50000 , "month" : "January" }),
},
) await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'storage' ,
actionName: 'write_file' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: {
path: 'reports/monthly.json' ,
content: JSON . stringify ({ revenue: 50000 , month: 'January' }),
},
}),
}) import httpx
import json
httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "storage" ,
"actionName" : "write_file" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : {
"path" : "reports/monthly.json" ,
"content" : json.dumps({ "revenue" : 50000 , "month" : "January" }),
},
},
)
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "storage",
"actionName": "read_file",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"path": "reports/monthly.json"
}
}' const { output } = await client.actions. execute ( 'storage' , 'read_file' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { path: 'reports/monthly.json' },
}) result = client.actions.execute( "storage" , "read_file" ,
workspace_id = "YOUR_WORKSPACE_ID" ,
input = {
"path" : "reports/monthly.json" ,
},
) const res = await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'storage' ,
actionName: 'read_file' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { path: 'reports/monthly.json' },
}),
})
const { output } = await res. json () import httpx
res = httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "storage" ,
"actionName" : "read_file" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : { "path" : "reports/monthly.json" },
},
)
output = res.json()[ "output" ]
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "storage",
"actionName": "list_files",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"prefix": "reports/"
}
}' const { output } = await client.actions. execute ( 'storage' , 'list_files' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { prefix: 'reports/' },
}) result = client.actions.execute( "storage" , "list_files" ,
workspace_id = "YOUR_WORKSPACE_ID" ,
input = {
"prefix" : "reports/" ,
},
) const res = await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'storage' ,
actionName: 'list_files' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { prefix: 'reports/' },
}),
})
const { output } = await res. json () import httpx
res = httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "storage" ,
"actionName" : "list_files" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : { "prefix" : "reports/" },
},
)
output = res.json()[ "output" ]
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "storage",
"actionName": "delete_file",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"path": "reports/monthly.json"
}
}' await client.actions. execute ( 'storage' , 'delete_file' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { path: 'reports/monthly.json' },
}) client.actions.execute( "storage" , "delete_file" ,
workspace_id = "YOUR_WORKSPACE_ID" ,
input = {
"path" : "reports/monthly.json" ,
},
) await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'storage' ,
actionName: 'delete_file' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { path: 'reports/monthly.json' },
}),
}) import httpx
httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "storage" ,
"actionName" : "delete_file" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : { "path" : "reports/monthly.json" },
},
)
Action Input Description write_filepath, contentWrite or overwrite a file read_filepathRead file contents list_filesprefixList files matching a prefix delete_filepathDelete a file
The KV Store integration provides key-value operations for storing structured data.
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "kv-store",
"actionName": "put",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"key": "user:settings:123",
"value": "{\"theme\": \"dark\", \"notifications\": true}"
}
}' await client.actions. execute ( 'kv-store' , 'put' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: {
key: 'user:settings:123' ,
value: JSON . stringify ({ theme: 'dark' , notifications: true }),
},
}) import json
client.actions.execute( "kv-store" , "put" ,
workspace_id = "YOUR_WORKSPACE_ID" ,
input = {
"key" : "user:settings:123" ,
"value" : json.dumps({ "theme" : "dark" , "notifications" : True }),
},
) await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'kv-store' ,
actionName: 'put' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: {
key: 'user:settings:123' ,
value: JSON . stringify ({ theme: 'dark' , notifications: true }),
},
}),
}) import httpx
import json
httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "kv-store" ,
"actionName" : "put" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : {
"key" : "user:settings:123" ,
"value" : json.dumps({ "theme" : "dark" , "notifications" : True }),
},
},
)
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "kv-store",
"actionName": "get",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"key": "user:settings:123"
}
}' const { output } = await client.actions. execute ( 'kv-store' , 'get' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'user:settings:123' },
}) result = client.actions.execute( "kv-store" , "get" , input = {
"key" : "user:settings:123" ,
}) const res = await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'kv-store' ,
actionName: 'get' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'user:settings:123' },
}),
})
const { output } = await res. json () import httpx
res = httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "kv-store" ,
"actionName" : "get" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : { "key" : "user:settings:123" },
},
)
output = res.json()[ "output" ]
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "kv-store",
"actionName": "delete",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"key": "user:settings:123"
}
}' await client.actions. execute ( 'kv-store' , 'delete' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'user:settings:123' },
}) client.actions.execute( "kv-store" , "delete" , input = {
"key" : "user:settings:123" ,
}) await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'kv-store' ,
actionName: 'delete' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'user:settings:123' },
}),
}) import httpx
httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "kv-store" ,
"actionName" : "delete" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : { "key" : "user:settings:123" },
},
)
The KV Store supports list-based operations on a single key:
curl TypeScript SDK Python SDK TypeScript Python
# Add to a list
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "kv-store",
"actionName": "add_to_list",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"key": "processed:emails",
"value": "msg_abc123"
}
}'
# Remove from a list
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "kv-store",
"actionName": "remove_from_list",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"key": "processed:emails",
"value": "msg_abc123"
}
}' // Add to a list
await client.actions. execute ( 'kv-store' , 'add_to_list' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'processed:emails' , value: 'msg_abc123' },
})
// Remove from a list
await client.actions. execute ( 'kv-store' , 'remove_from_list' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'processed:emails' , value: 'msg_abc123' },
}) # Add to a list
client.actions.execute( "kv-store" , "add_to_list" , input = {
"key" : "processed:emails" ,
"value" : "msg_abc123" ,
})
# Remove from a list
client.actions.execute( "kv-store" , "remove_from_list" , input = {
"key" : "processed:emails" ,
"value" : "msg_abc123" ,
}) const headers = {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
}
// Add to a list
await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers,
body: JSON . stringify ({
integrationName: 'kv-store' ,
actionName: 'add_to_list' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'processed:emails' , value: 'msg_abc123' },
}),
})
// Remove from a list
await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers,
body: JSON . stringify ({
integrationName: 'kv-store' ,
actionName: 'remove_from_list' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'processed:emails' , value: 'msg_abc123' },
}),
}) import httpx
headers = { "Authorization" : "Bearer wvz_your_key" }
# Add to a list
httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = headers,
json = {
"integrationName" : "kv-store" ,
"actionName" : "add_to_list" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : { "key" : "processed:emails" , "value" : "msg_abc123" },
},
)
# Remove from a list
httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = headers,
json = {
"integrationName" : "kv-store" ,
"actionName" : "remove_from_list" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : { "key" : "processed:emails" , "value" : "msg_abc123" },
},
)
Action Input Description putkey, valueStore a value getkeyRetrieve a value deletekeyDelete a key add_to_listkey, valueAppend a value to a list remove_from_listkey, valueRemove a value from a list
Storage and KV Store actions include a scope input property that controls data isolation. The default scope is end_user, which isolates data per end user within the workspace when endUserId is provided.
Scope Value Description End User Bound end_user (default)Isolated per end user. Requires endUserId in the request. Workspace Bound workspaceShared across the entire workspace. External ID Bound externalScoped to a custom externalId value within the workspace.
When you pass endUserId in the request, data is isolated per end user. You can omit scope — it defaults to end_user.
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "storage",
"actionName": "write_file",
"workspaceId": "YOUR_WORKSPACE_ID",
"endUserId": "user_12345",
"input": {
"path": "preferences.json",
"content": "{\"theme\": \"dark\"}",
"scope": "end_user"
}
}' await client.actions. execute ( 'storage' , 'write_file' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
endUserId: 'user_12345' ,
input: {
path: 'preferences.json' ,
content: JSON . stringify ({ theme: 'dark' }),
scope: 'end_user' ,
},
}) client.actions.execute( "storage" , "write_file" ,
workspace_id = "YOUR_WORKSPACE_ID" ,
end_user_id = "user_12345" ,
input = {
"path" : "preferences.json" ,
"content" : json.dumps({ "theme" : "dark" }),
"scope" : "end_user" ,
},
) await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'storage' ,
actionName: 'write_file' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
endUserId: 'user_12345' ,
input: {
path: 'preferences.json' ,
content: JSON . stringify ({ theme: 'dark' }),
scope: 'end_user' ,
},
}),
}) import httpx
import json
httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "storage" ,
"actionName" : "write_file" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"endUserId" : "user_12345" ,
"input" : {
"path" : "preferences.json" ,
"content" : json.dumps({ "theme" : "dark" }),
"scope" : "end_user" ,
},
},
)
Files written by user_12345 are fully isolated from files written by user_67890. This is the recommended approach for multi-tenant applications where each end user should have their own storage namespace.
Set scope to "external" and provide an externalId to create custom scopes — useful for isolating data per tenant, session, or entity:
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "storage",
"actionName": "write_file",
"workspaceId": "YOUR_WORKSPACE_ID",
"input": {
"path": "config.json",
"content": "{\"setting\": \"value\"}",
"scope": "external",
"externalId": "tenant_456"
}
}' await client.actions. execute ( 'storage' , 'write_file' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: {
path: 'config.json' ,
content: JSON . stringify ({ setting: 'value' }),
scope: 'external' ,
externalId: 'tenant_456' ,
},
}) client.actions.execute( "storage" , "write_file" ,
workspace_id = "YOUR_WORKSPACE_ID" ,
input = {
"path" : "config.json" ,
"content" : json.dumps({ "setting" : "value" }),
"scope" : "external" ,
"externalId" : "tenant_456" ,
},
) await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'storage' ,
actionName: 'write_file' ,
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: {
path: 'config.json' ,
content: JSON . stringify ({ setting: 'value' }),
scope: 'external' ,
externalId: 'tenant_456' ,
},
}),
}) import httpx
import json
httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "storage" ,
"actionName" : "write_file" ,
"workspaceId" : "YOUR_WORKSPACE_ID" ,
"input" : {
"path" : "config.json" ,
"content" : json.dumps({ "setting" : "value" }),
"scope" : "external" ,
"externalId" : "tenant_456" ,
},
},
)
With external ID scoping, files from different tenants are fully isolated within the workspace — tenant_456/config.json and tenant_789/config.json are completely separate, and the same externalId in different workspaces is also isolated.
const cacheKey = `cache:weather:${ city }`
// Check cache
const cached = await client.actions. execute ( 'kv-store' , 'get' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: cacheKey },
})
if (cached.output.value) {
const data = JSON . parse (cached.output.value)
const age = Date. now () - new Date (data.cachedAt). getTime ()
// Use cache if less than 5 minutes old
if (age < 300_000 ) return data.weather
}
// Fetch fresh data and cache it
const weather = await fetchWeatherApi (city)
await client.actions. execute ( 'kv-store' , 'put' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: {
key: cacheKey,
value: JSON . stringify ({ weather, cachedAt: new Date (). toISOString () }),
},
})
// Check if already processed
const processed = await client.actions. execute ( 'kv-store' , 'get' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'processed:webhooks' },
})
const list = JSON . parse (processed.output.value || '[]' )
if (list. includes (webhookId)) return // Skip duplicate
// Process the webhook
await handleWebhook (payload)
// Mark as processed
await client.actions. execute ( 'kv-store' , 'add_to_list' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
input: { key: 'processed:webhooks' , value: webhookId },
}) PreviousCustom OAuth Apps Next Managing End Users