Webhooks
A webhook is a content resource, prefixed WHK_, that sends an outbound
HTTP request when a platform event fires, with its URL, headers, and body
rendered from LiquidJS templates against the event payload.
Each webhook binds to one event name (CaseCreated, ThreatReportCreated, and
the rest listed below), and sends the request with the configured HTTP method. A
{{ credential.<name> }} reference in any template resolves against a stored
credential, so secrets never sit in the template text.
Webhooks route cases, threat reports, and usage alerts to external systems such
as Slack, Jira, and PagerDuty.
Trigger events
eventName takes one of the following values. Each event delivers a payload
whose top-level key names the object below, plus a type field equal to the
event name. Templates read the payload directly, so a ThreatReportCreated body
references {{ threatReport.name }}.
| Event | Payload key | Fires when |
|---|---|---|
CaseCreated | case | A case is opened. |
CaseClosed | case | A case is closed. |
CaseStatusChanged | case | The status of a case changes, from a user, an agent, or the automatic hold of inactive cases. case.status is the new status. The payload also carries previousStatus and reason (StaleCaseAutoHold for the automatic hold, otherwise null). A close fires both CaseClosed and CaseStatusChanged. |
CaseInitialAnalysisCompleted | case | The agent finishes initial analysis on a case. |
ContentWorkItemCreated | contentWorkItem | A content work item is created. |
ThreatReportCreated | threatReport | A threat report is created. |
CircuitBreakerTripped | circuitBreaker | A platform circuit breaker trips. |
SimbaUsageAlert | alert | Agent usage crosses a configured quota threshold. |
AlertQueued | alert | An alert enters the triage queue. |
AlertInitialScoreCompleted | alert | Triage assigns an alert its first priority score. |
AlertPromoted | alert | An alert is promoted to a case. The payload also carries caseId and promotedByUserId. |
AlertExpired | alert | An alert leaves the queue without promotion. |
AlertTriageFailure | alert | Triage cannot finish an alert. The payload also carries reason. |
CaseNewAlertEvidenceAttached | case | An alert is attached to an existing case as new evidence. The payload also carries alert and promotedByUserId. |
TriagePromotionThresholdChanged | threshold | The dynamic promotion threshold of a Space changes value. See Promotion threshold changes. |
Space-scoped events also carry organization (id, name) and space (id,
name, catalogName) objects, and fire only webhooks in that Space.
Promotion threshold changes
TriagePromotionThresholdChanged fires when the triage promotion cycle of a
Space with a weekly budget stores a new threshold value. A low remaining budget
raises the threshold, so alerts that score below it stay in triage instead of
becoming cases. Use this event to review the triage queue or raise the budget
of the Space.
| Field | Type | Description |
|---|---|---|
threshold.spaceId | string | The Space whose threshold changed. |
threshold.previous | integer or null | The stored threshold before this change. On the first computation for the Space, this is the cold-start value. null only when no threshold was stored. |
threshold.current | integer | The new threshold, from 1 to 10. Alerts with a priority below it stay in triage. |
threshold.previousComputedAt | string or null | ISO 8601 time of the previous computation. null when previous is the cold-start value set at creation or after a budget edit. |
threshold.computedAt | string | ISO 8601 time of this computation. |
threshold.weeklyBudgetUsd | number | The weekly budget of the Space, in USD. |
threshold.remainingWeeklyBudgetUsd | number | Weekly budget minus this week's Triage and Cases spend, in USD. Never below 0. When automatic case analysis is off, Cases spend is not subtracted. |
threshold.remainingCaseCapacityUsd | number | The budget left for automatic case analysis after the triage reserve, in USD. 0 when automatic case analysis is off. The threshold uses this value minus the expected cost of the cases in analysis, so the threshold can rise while this value stays high. |
The threshold depends on the remaining budget, the number of cases in analysis, and the fraction of the week left, so the event can fire often when the budget is tight. Each change fires a separate event: a move from 7 to 8 and then from 8 to 9 sends two. Delivery is best effort, and an event may be delivered more than once. Recipients should handle duplicate events. A budget edit resets the stored threshold without firing the event.
Use triggerExpression to fire only on the changes that matter. Liquid
evaluates the expression with these rules:
- A
nullthreshold.previouscompares like 0, sothreshold.previous < 7is true andthreshold.previous > 7is false. Test for it withthreshold.previous == nil. - To find the first computation for a Space, test
threshold.previousComputedAt == nil. On the first computation,previousholds the cold-start value, notnull. - Liquid has no parentheses, and
andandorevaluate from right to left.
To fire when the threshold rises above 7:
threshold.current > 7 and threshold.previous <= 7
To link to the triage queue, build the URL from the identity fields:
https://<your Perpetual host>/{{ organization.id }}/{{ space.id }}/triage.
Templating
The url, headers values, and body are LiquidJS
templates. Two kinds of reference resolve at send time.
| Reference | Resolves to |
|---|---|
{{ <field> }} | A field of the event payload, e.g. {{ case.name }} or {{ type }}. Any Liquid filter applies, so {{ case.summary | json }} escapes a value for a JSON body. |
{{ credential.<name> }} | A stored credential by name. Use bracket notation ({{ credential["my-key"] }}) when the name is not a valid identifier. Text and OAuth2 credentials substitute their value string. For an AwsRole or HmacSignature credential, Perpetual computes a signed request header over the final request. |
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Required | Webhook name. |
eventName | enum | Required | The platform event that fires this webhook. See Trigger events for the values and their payloads. |
url | string | Required | The request URL, a Liquid template. Renders against the event payload and any credential.* references. |
method | enum | Required | HTTP method for the request: GET, POST, PUT, PATCH, DELETE. |
headers | object | Required | Request headers as a string-to-string map. Each value is a Liquid template. An empty object sends no headers. |
body | string | Optional | The request body, a Liquid template. Absent sends no body. |
triggerExpression | string | Optional | A Liquid expression evaluated against the event payload. The webhook fires only when it is true. Absent always fires. |
folderPath | string | Optional | Folder location within the Space, e.g. Webhooks/Slack. |
Outputs
A webhook returns no fields of its own.
Plus the common resource fields.
Related
- Credentials, the secrets a
credential.*reference injects. - Cases, the resource behind the
CaseCreated,CaseClosed,CaseStatusChanged, andCaseInitialAnalysisCompletedevents. - Changesets, how webhook edits are staged and committed.
- Route signals to Slack, Jira, or PagerDuty, how to author, preview, and validate a webhook.