Docs Guides Using Storage & KV Store Weavz includes two built-in workspace integrations for persistent data: Storage for files and KV Store for key-value data. Both are accessed through the standard action execution API, can be configured as workspace integrations, and require no additional connections.
For the broader first-party setup flow, see Using Built-In Workspace Integrations .
The examples below assume you configured the built-in integrations with workspace-scoped persistence:
curl -X POST https://api.weavz.io/api/v1/workspaces/YOUR_WORKSPACE_ID/integrations \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "storage",
"alias": "storage",
"settings": { "persistence": { "scope": "workspace" } }
}'
curl -X POST https://api.weavz.io/api/v1/workspaces/YOUR_WORKSPACE_ID/integrations \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "kv-store",
"alias": "kv-store",
"settings": { "persistence": { "scope": "workspace" } }
}'
For private per-user files or state, keep the default end_user scope and pass endUserId when executing actions.
The Storage integration provides file CRUD operations in Weavz-managed persistent 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
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, KV Store, Agent Memory, Agent Scratchpad, and Sequential Thinking read persistence policy from workspace integration settings. The action caller does not pass scope or externalId in input.
Scope Value Description Current end user end_user (default)Private to the end user for the current request. Requires endUserId when running actions. Shared workspace workspaceShared by all users and agents in the workspace. Custom namespace externalScoped to one namespace key in the workspace. Configure the key as settings.persistence.externalId.
Connection strategy still controls which credentials an action uses; persistence scope controls who can read and write the stored state.
When you pass endUserId in the request, data is isolated per end user. This is the default persistence policy for stateful tools.
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\"}"
}
}' await client.actions. execute ( 'storage' , 'write_file' , {
workspaceId: 'YOUR_WORKSPACE_ID' ,
endUserId: 'user_12345' ,
input: {
path: 'preferences.json' ,
content: JSON . stringify ({ theme: 'dark' }),
},
}) 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" }),
},
) 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' }),
},
}),
}) 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" }),
},
},
)
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.
Use external for state isolated by a tenant, session, project, or entity. Configure the namespace on the workspace integration:
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/workspaces/YOUR_WORKSPACE_ID/integrations \
-H "Authorization: Bearer wvz_your_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "storage",
"alias": "tenant_storage",
"settings": {
"persistence": { "scope": "external", "externalId": "tenant_456" }
}
}' await client.workspaces. addIntegration ( 'YOUR_WORKSPACE_ID' , {
integrationName: 'storage' ,
alias: 'tenant_storage' ,
settings: {
persistence: { scope: 'external' , externalId: 'tenant_456' },
},
}) client.workspaces.add_integration(
workspace_id = "YOUR_WORKSPACE_ID" ,
integration_name = "storage" ,
integration_alias = "tenant_storage" ,
settings = { "persistence" : { "scope" : "external" , "externalId" : "tenant_456" }},
) await fetch ( 'https://api.weavz.io/api/v1/workspaces/YOUR_WORKSPACE_ID/integrations' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'storage' ,
alias: 'tenant_storage' ,
settings: { persistence: { scope: 'external' , externalId: 'tenant_456' } },
}),
}) import httpx
import json
httpx.post(
"https://api.weavz.io/api/v1/workspaces/YOUR_WORKSPACE_ID/integrations" ,
headers = { "Authorization" : "Bearer wvz_your_key" },
json = {
"integrationName" : "storage" ,
"alias" : "tenant_storage" ,
"settings" : { "persistence" : { "scope" : "external" , "externalId" : "tenant_456" }},
},
)
Calls through tenant_storage read and write the tenant_456 namespace. The same namespace key in different workspaces is 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 },
}) PreviousUsing Built-In Workspace Integrations Next Managing End Users