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).

Operation: mutation CreateWebhook($input: CreateWebhookInput!) { createWebhook(input: $input) { webhook { id url alertTypes webhookTemplateType createdAt } } }Variables: { "input": { "testSuiteId": "TjAxMVRlc3RTdWl0ZTEyMw", "url": "https://example.com/api/lumar-webhook", "alertTypes": ["Pass", "Warning", "Fail"], "webhookTemplateType": "MSTeams" } }Response Example: { "data": { "createWebhook": { "webhook": { "id": "TjAzN1dlYmhvb2sx", "url": "https://example.com/api/lumar-webhook", "alertTypes": ["Pass", "Warning", "Fail"], "webhookTemplateType": "MSTeams", "createdAt": "2025-01-15T10:00:00.000Z" } } } }
CreateWebhookTry in Explorer
GraphQL
mutation CreateWebhook($input: CreateWebhookInput!) {
createWebhook(input: $input) {
webhook {
id
url
alertTypes
webhookTemplateType
createdAt
}
}
}

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.

Operation: mutation CreateSlackWebhook($input: CreateSlackWebhookInput!) { createAutomatorSlackWebhook(input: $input) { slackWebhook { id url alertTypes createdAt } } }Variables: { "input": { "testSuiteId": "TjAxMVRlc3RTdWl0ZTEyMw", "url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX", "alertTypes": ["Pass", "Warning", "Fail"] } }Response Example: { "data": { "createAutomatorSlackWebhook": { "slackWebhook": { "id": "TjAzN1NsYWNrV2ViaG9vazE", "url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX", "alertTypes": ["Pass", "Warning", "Fail"], "createdAt": "2025-01-15T10:00:00.000Z" } } } }
CreateSlackWebhookTry in Explorer
GraphQL
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:

Operation: 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 } } } }Variables: { "testSuiteId": "TjAxMVRlc3RTdWl0ZTEyMw" }Response Example: { "data": { "node": { "id": "TjAxMVRlc3RTdWl0ZTEyMw", "name": "Production SEO Suite", "webhooks": { "nodes": [ { "id": "TjAzN1dlYmhvb2sx", "url": "https://example.com/api/webhook-callback", "alertTypes": ["Pass", "Warning", "Fail"], "webhookTemplateType": "MSTeams", "createdAt": "2025-01-10T08:00:00.000Z" } ], "totalCount": 1 }, "slackWebhooks": { "nodes": [ { "id": "TjAzN1NsYWNrV2ViaG9vazE", "url": "https://hooks.slack.com/services/T00/B00/xxxx", "alertTypes": ["Pass", "Warning", "Fail"], "createdAt": "2025-01-10T08:00:00.000Z" } ], "totalCount": 1 } } } }
GetWebhooksTry in Explorer
GraphQL
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

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.