Triggers
Enable and manage event triggers for integrations.
Triggers
Triggers listen for events from third-party services and deliver them to your callback URL. Weavz supports three trigger types: webhook (real-time push), polling (periodic checks), and app-webhook (platform-managed webhooks).
List Triggers
/api/v1/triggersList all active trigger sources in your organization.
Response
{
"triggers": [
{
"id": "t1a2b3c4-d5e6-7890-abcd-ef1234567890",
"orgId": "550e8400-e29b-41d4-a716-446655440000",
"triggerType": "WEBHOOK",
"integrationName": "github",
"triggerName": "new_push",
"webhookUrl": "https://api.weavz.io/api/v1/webhooks/github/abc123",
"callbackUrl": "https://your-app.com/webhooks/github-push",
"simulate": false,
"createdAt": "2025-01-15T10:30:00.000Z"
}
],
"total": 1
}Example
curl https://api.weavz.io/api/v1/triggers \
-H "Authorization: Bearer wvz_your_api_key"Enable Trigger
/api/v1/triggers/enableEnable a trigger to start receiving events.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
integrationName | string | Yes | Integration name (e.g., github, slack) |
triggerName | string | Yes | Trigger name (e.g., new_push, new_message) |
callbackUrl | string (uri) | Yes | URL to receive trigger events |
callbackHeaders | object | No | Custom headers to include with callback requests |
callbackMetadata | object | No | Metadata passed through with each callback |
connectionExternalId | string | No | External ID of the connection to use |
workspaceId | string (uuid) | Yes | Workspace scope for connection resolution and partials |
endUserId | string | No | Your end-user's identifier for per-user connection resolution |
partialIds | string[] | No | Partial IDs to apply. If omitted, default partials auto-resolve. |
pollingIntervalMinutes | number | No | Polling interval in minutes (1-1440). Only applies to polling triggers. Minimum interval depends on your plan. |
simulate | boolean | No | Enable simulation mode for testing |
Response (201)
{
"triggerSource": {
"id": "t1a2b3c4-d5e6-7890-abcd-ef1234567890",
"orgId": "550e8400-e29b-41d4-a716-446655440000",
"triggerType": "WEBHOOK",
"integrationName": "github",
"triggerName": "new_push",
"webhookUrl": "https://api.weavz.io/api/v1/webhooks/github/abc123",
"callbackUrl": "https://your-app.com/webhooks/github-push",
"simulate": false,
"createdAt": "2025-01-15T10:30:00.000Z"
}
}Example
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",
"callbackUrl": "https://your-app.com/webhooks/github-push",
"connectionExternalId": "github-main",
"workspaceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}'For webhook triggers, the response includes a webhookUrl that you need to register in the third-party service. For polling triggers, Weavz automatically checks for new data at regular intervals.
Errors
| Status | Code | Description |
|---|---|---|
400 | VALIDATION_ERROR | Missing required fields |
403 | POLLING_INTERVAL_TOO_SHORT | Polling interval below plan minimum |
404 | TRIGGER_NOT_FOUND | Trigger not found on the integration |
Disable Trigger
/api/v1/triggers/disableDisable an active trigger and stop receiving events.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
triggerSourceId | string (uuid) | Yes | ID of the trigger source to disable |
Response
{
"disabled": true,
"triggerSourceId": "t1a2b3c4-d5e6-7890-abcd-ef1234567890"
}Example
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": "t1a2b3c4-d5e6-7890-abcd-ef1234567890"}'Errors
| Status | Code | Description |
|---|---|---|
400 | MISSING_ID | Missing trigger source ID |
404 | NOT_FOUND | Trigger source not found |
Test Trigger
/api/v1/triggers/testGet sample data for a trigger to understand its event payload format.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
integrationName | string | Yes | Integration name |
triggerName | string | Yes | Trigger name |
Response
{
"sampleData": {
"ref": "refs/heads/main",
"repository": {
"full_name": "owner/repo"
},
"commits": [
{
"id": "abc123",
"message": "Update README"
}
]
}
}Example
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"}'Errors
| Status | Code | Description |
|---|---|---|
400 | MISSING_FIELDS | Missing required fields |
404 | INTEGRATION_NOT_FOUND | Integration not found |
404 | TRIGGER_NOT_FOUND | Trigger not found |