eavz

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

GET/api/v1/triggers

List all active trigger sources in your organization.

Response

json
{
  "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

bash
curl https://api.weavz.io/api/v1/triggers \
  -H "Authorization: Bearer wvz_your_api_key"

Enable Trigger

POST/api/v1/triggers/enable

Enable a trigger to start receiving events.

Request Body

FieldTypeRequiredDescription
integrationNamestringYesIntegration name (e.g., github, slack)
triggerNamestringYesTrigger name (e.g., new_push, new_message)
callbackUrlstring (uri)YesURL to receive trigger events
callbackHeadersobjectNoCustom headers to include with callback requests
callbackMetadataobjectNoMetadata passed through with each callback
connectionExternalIdstringNoExternal ID of the connection to use
workspaceIdstring (uuid)YesWorkspace scope for connection resolution and partials
endUserIdstringNoYour end-user's identifier for per-user connection resolution
partialIdsstring[]NoPartial IDs to apply. If omitted, default partials auto-resolve.
pollingIntervalMinutesnumberNoPolling interval in minutes (1-1440). Only applies to polling triggers. Minimum interval depends on your plan.
simulatebooleanNoEnable simulation mode for testing

Response (201)

json
{
  "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

bash
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

StatusCodeDescription
400VALIDATION_ERRORMissing required fields
403POLLING_INTERVAL_TOO_SHORTPolling interval below plan minimum
404TRIGGER_NOT_FOUNDTrigger not found on the integration

Disable Trigger

POST/api/v1/triggers/disable

Disable an active trigger and stop receiving events.

Request Body

FieldTypeRequiredDescription
triggerSourceIdstring (uuid)YesID of the trigger source to disable

Response

json
{
  "disabled": true,
  "triggerSourceId": "t1a2b3c4-d5e6-7890-abcd-ef1234567890"
}

Example

bash
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

StatusCodeDescription
400MISSING_IDMissing trigger source ID
404NOT_FOUNDTrigger source not found

Test Trigger

POST/api/v1/triggers/test

Get sample data for a trigger to understand its event payload format.

Request Body

FieldTypeRequiredDescription
integrationNamestringYesIntegration name
triggerNamestringYesTrigger name

Response

json
{
  "sampleData": {
    "ref": "refs/heads/main",
    "repository": {
      "full_name": "owner/repo"
    },
    "commits": [
      {
        "id": "abc123",
        "message": "Update README"
      }
    ]
  }
}

Example

bash
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

StatusCodeDescription
400MISSING_FIELDSMissing required fields
404INTEGRATION_NOT_FOUNDIntegration not found
404TRIGGER_NOT_FOUNDTrigger not found