Docs Guides Setting Up Triggers Triggers let you receive real-time events from third-party services. When something happens — like a new Slack message, a GitHub push, or a form submission — Weavz delivers the event data to your callback URL.
Weavz supports two trigger types:
WEBHOOK — the third-party service pushes events to a Weavz-managed URL, which forwards them to your callback
POLLING — Weavz periodically checks the service for new data and delivers any changes to your callback
Both types deliver events in the same format to your callbackUrl.
Trigger enablement always runs inside a workspace. Include workspaceId so Weavz can scope access, resolve the connection or workspace integration, and apply trigger settings consistently. The code examples assume the workspace has a configured GitHub integration with alias github_prod.
Dashboard Code
Navigate to Triggers Open the dashboard and go to Triggers in the sidebar.
Enable a new trigger Click Enable Trigger . Select an integration (e.g. GitHub, Slack) and pick the trigger event you want to listen for.
Select a connection Choose the connection that has access to the service you want to monitor.
Set your callback URL Enter the HTTPS URL where Weavz should deliver events. Optionally add callback headers and metadata.
Save Click Enable . For webhook triggers, the webhook is automatically registered with the third-party service.
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/triggers/enable \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "github",
"triggerName": "new_push",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"callbackUrl": "https://yourapp.com/webhooks/github-push",
"integrationAlias": "github_prod"
}' import { WeavzClient } from '@weavz/sdk'
const client = new WeavzClient ({ apiKey: 'wvz_your_api_key' })
const { triggerSource } = await client.triggers. enable ({
integrationName: 'github' ,
triggerName: 'new_push' ,
workspaceId: '550e8400-e29b-41d4-a716-446655440000' ,
callbackUrl: 'https://yourapp.com/webhooks/github-push' ,
integrationAlias: 'github_prod' ,
})
console. log ( 'Trigger enabled:' , triggerSource.id) from weavz_sdk import WeavzClient
client = WeavzClient( api_key = "wvz_your_api_key" )
result = client.triggers.enable(
integration_name = "github" ,
trigger_name = "new_push" ,
workspace_id = "550e8400-e29b-41d4-a716-446655440000" ,
callback_url = "https://yourapp.com/webhooks/github-push" ,
integration_alias = "github_prod" ,
)
print ( "Trigger enabled:" , result[ "triggerSource" ][ "id" ]) const res = await fetch ( 'https://api.weavz.io/api/v1/triggers/enable' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_api_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'github' ,
triggerName: 'new_push' ,
workspaceId: '550e8400-e29b-41d4-a716-446655440000' ,
callbackUrl: 'https://yourapp.com/webhooks/github-push' ,
integrationAlias: 'github_prod' ,
}),
})
const { triggerSource } = await res. json ()
console. log ( 'Trigger enabled:' , triggerSource.id) import httpx
res = httpx.post(
"https://api.weavz.io/api/v1/triggers/enable" ,
headers = { "Authorization" : "Bearer wvz_your_api_key" },
json = {
"integrationName" : "github" ,
"triggerName" : "new_push" ,
"workspaceId" : "550e8400-e29b-41d4-a716-446655440000" ,
"callbackUrl" : "https://yourapp.com/webhooks/github-push" ,
"integrationAlias" : "github_prod" ,
},
)
trigger_source = res.json()[ "triggerSource" ]
print ( "Trigger enabled:" , trigger_source[ "id" ]) Response:
{
"triggerSource" : {
"id" : "ts_abc123" ,
"integrationName" : "github" ,
"triggerName" : "new_push" ,
"callbackUrl" : "https://yourapp.com/webhooks/github-push" ,
"status" : "ACTIVE" ,
"createdAt" : "2025-01-15T10:30:00Z"
}
}
Get sample event data for a trigger to verify your callback handler before going live.
Dashboard Code
Go to Triggers , find the trigger you want to test, and click Test . Weavz will show a sample payload for that trigger type.
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/triggers/test \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "github",
"triggerName": "new_push"
}' const { sampleData } = await client.triggers. test ( 'github' , 'new_push' )
console. log ( 'Sample payload:' , sampleData) result = client.triggers.test(
integration_name = "github" ,
trigger_name = "new_push" ,
)
print ( "Sample payload:" , result[ "sampleData" ]) const res = await fetch ( 'https://api.weavz.io/api/v1/triggers/test' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_api_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'github' ,
triggerName: 'new_push' ,
}),
})
const { sampleData } = await res. json ()
console. log ( 'Sample payload:' , sampleData) import httpx
res = httpx.post(
"https://api.weavz.io/api/v1/triggers/test" ,
headers = { "Authorization" : "Bearer wvz_your_api_key" },
json = {
"integrationName" : "github" ,
"triggerName" : "new_push" ,
},
)
print ( "Sample payload:" , res.json()[ "sampleData" ]) Response:
{
"sampleData" : {
"ref" : "refs/heads/main" ,
"repository" : {
"full_name" : "example/repo"
},
"commits" : [
{
"message" : "Sample commit" ,
"author" : { "name" : "Example User" }
}
]
}
}
When a trigger fires, Weavz sends a POST request to your callbackUrl:
POST https://yourapp.com/webhooks/github-push
Content-Type : application/json
{
"triggerSourceId" : "ts_abc123" ,
"integrationName" : "github" ,
"triggerName" : "new_push" ,
"data" : {
"ref" : "refs/heads/main" ,
"repository" : { "full_name" : "my-org/my-repo" },
"commits" : [ ... ]
},
"metadata" : {},
"timestamp" : "2025-01-15T10:35:00Z"
}
Return a 200 status from your callback endpoint within a few seconds. Events may be delivered more than once — design your handler to be idempotent.
Custom callback headers and metadata You can include custom headers and metadata when enabling a trigger. Headers are sent with every callback delivery, useful for authentication:
curl -X POST https://api.weavz.io/api/v1/triggers/enable \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "slack",
"triggerName": "new_message",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"callbackUrl": "https://yourapp.com/webhooks/slack",
"integrationAlias": "slack_bot",
"callbackHeaders": {
"X-Webhook-Secret": "your_secret_value",
"X-Tenant-ID": "tenant_123"
},
"callbackMetadata": {
"tenantId": "tenant_123",
"environment": "production"
}
}' Metadata is included in the metadata field of every callback delivery.
Stop receiving events by disabling the trigger source.
Dashboard Code
Go to Triggers , find the active trigger, and click Disable . The webhook is automatically deregistered from the third-party service.
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/triggers/disable \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{"triggerSourceId": "ts_abc123"}' await client.triggers. disable ( 'ts_abc123' ) client.triggers.disable( "ts_abc123" ) await fetch ( 'https://api.weavz.io/api/v1/triggers/disable' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_api_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({ triggerSourceId: 'ts_abc123' }),
}) import httpx
httpx.post(
"https://api.weavz.io/api/v1/triggers/disable" ,
headers = { "Authorization" : "Bearer wvz_your_api_key" },
json = { "triggerSourceId" : "ts_abc123" },
)
curl TypeScript SDK Python SDK TypeScript Python
curl https://api.weavz.io/api/v1/triggers \
-H "Authorization: Bearer wvz_your_api_key" const { triggers , total } = await client.triggers. list ()
for ( const trigger of triggers) {
console. log ( `${ trigger . integrationName }.${ trigger . triggerName } → ${ trigger . callbackUrl }` )
} result = client.triggers.list()
for trigger in result[ "triggers" ]:
print ( f " { trigger[ 'integrationName' ] } . { trigger[ 'triggerName' ] } → { trigger[ 'callbackUrl' ] } " ) const res = await fetch ( 'https://api.weavz.io/api/v1/triggers' , {
headers: { 'Authorization' : 'Bearer wvz_your_api_key' },
})
const { triggers } = await res. json ()
for ( const trigger of triggers) {
console. log ( `${ trigger . integrationName }.${ trigger . triggerName } → ${ trigger . callbackUrl }` )
} import httpx
res = httpx.get(
"https://api.weavz.io/api/v1/triggers" ,
headers = { "Authorization" : "Bearer wvz_your_api_key" },
)
for trigger in res.json()[ "triggers" ]:
print ( f " { trigger[ 'integrationName' ] } . { trigger[ 'triggerName' ] } → { trigger[ 'callbackUrl' ] } " )
Use HTTPS callback URLs — ensure your endpoint is accessible over HTTPS
Verify callbacks — use callbackHeaders with a secret to verify requests are from Weavz
Respond quickly — return a 200 status within a few seconds
Handle duplicates — events may be delivered more than once; make your handler idempotent
Monitor active triggers — regularly review and disable triggers you no longer need
PreviousUsing the Playground Next MCP Code Mode