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
}
}
}
Webhook template types
| Type | Description |
|---|---|
MSTeams | Sends 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 Type | Description |
|---|---|
Pass | All tests in the build passed. |
Warning | One or more tests produced a warning. |
Fail | One 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
}
}
}
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
}
}
}
}
Webhook event reference
| Event | Trigger |
|---|---|
| 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.