Skip to main content

Webhooks

Webhooks allow you to receive automated notifications when Protect builds complete. You can configure webhooks to alert on test passes, warnings, or failures.

Creating a webhook

Use the createWebhook mutation to set up an API callback or MS Teams webhook on a project. The mutation's testSuiteId parameter accepts your project ID (in Lumar's schema, projects and test suites are the same entity).

mutation CreateWebhook($input: CreateWebhookInput!) {
createWebhook(input: $input) {
webhook {
id
url
alertTypes
webhookTemplateType
createdAt
}
}
}

Try in explorer

Webhook template types

TypeDescription
MSTeamsSends a formatted message card to a Microsoft Teams channel via an incoming webhook URL.

For generic HTTP callbacks, use the project-level apiCallbackUrl and apiCallbackHeaders fields on the project configuration. See UpdateProjectInput for details.

Alert types

Each webhook can be configured to fire on specific alert types:

Alert TypeDescription
PassAll tests in the build passed.
WarningOne or more tests produced a warning.
FailOne or more tests failed.

Slack webhooks

Slack webhooks use a dedicated mutation and integrate directly with Slack incoming webhook URLs.

mutation CreateSlackWebhook($input: CreateSlackWebhookInput!) {
createAutomatorSlackWebhook(input: $input) {
slackWebhook {
id
url
alertTypes
createdAt
}
}
}

Try in explorer

Slack alert types mirror the standard alert types: Pass, Warning, and Fail.

Querying existing webhooks

Retrieve all webhooks and Slack webhooks configured on a project:

query GetWebhooks($testSuiteId: ObjectID!) {
node(id: $testSuiteId) {
... on TestSuite {
id
name
webhooks(first: 10) {
nodes {
id
url
alertTypes
webhookTemplateType
createdAt
}
totalCount
}
slackWebhooks(first: 10) {
nodes {
id
url
alertTypes
createdAt
}
totalCount
}
}
}
}

Try in explorer

Webhook event reference

EventTrigger
Build completed (pass)All tests in a build passed their thresholds.
Build completed (warning)At least one test produced a warning-level breach.
Build completed (fail)At least one test failed its threshold.

For full details on the webhook payload structure, see the Webhook Notifications documentation.