Outbound webhooks
An outbound webhook makes Loha send a signed POST to a URL you control whenever
a build finishes. It's how you close the loop programmatically: start a build, then be
told when it's done and with what status. No polling.
These are the opposite direction from the webhook URL on a trigger. A trigger webhook is an endpoint Loha exposes so your git provider can start a build (inbound). An outbound webhook is an endpoint you expose so Loha can notify you when a build completes (outbound). This page is about the latter.
What you can do with them
- Notify a chat or incident tool: relay build results to Slack, Teams, or an on-call system when a deploy finishes.
- Alert on failures only: subscribe to
FAILED,TIMEOUT, andCANCELLEDand page someone when a pipeline breaks. - Chain downstream automation: kick off a smoke test, a cache warm, or a dependent service deploy when a specific pipeline succeeds.
- Close the trigger-then-done loop: fire a build with
POST /api/v1/triggers/{id}/runand let the webhook tell you the outcome, instead of pollingGET /api/v1/builds/{id}.
Events
Loha emits six event types:
| Event type | Fires when |
|---|---|
com.loha.build.completed.v1 | A build reaches a terminal status: SUCCESS, FAILED, TIMEOUT, CANCELLED. |
com.loha.release.produced.v1 | A successful build pushed a container image. One event per run, listing every image and its digest. |
com.loha.usage.period.closed.v1 | A calendar month closed for your workspace and its usage snapshot was written. |
com.loha.security.issue.new_critical.v1 | A scan report found CRITICAL security issues that are new, reopened or newly raised to CRITICAL. One event per report. |
com.loha.security.issue.sla_breached.v1 | Security issues passed their fix deadline. One event per check, for the workspace. |
com.loha.security.issue.secret_detected.v1 | A push to a tracked branch found new or reopened secrets (secret scanning on push), at any severity. One event per push. |
New webhooks listen to build completion only unless you tick another event. Every addition is opt-in so an existing receiver never starts getting a second, differently shaped payload it wasn't written for.
Send ping delivers a com.loha.webhook.ping.v1 to your endpoint regardless of which
events the subscription lists — that is the point of a test, and it is the one type not
in the table above. If your receiver validates the incoming type against an allowlist
(a good habit, and one the signature advice encourages), add
com.loha.webhook.ping.v1 to it or your endpoint will reject its own test delivery and
report the wiring broken when it is fine.
Releases
com.loha.release.produced.v1 is the "an image shipped, go deploy it" hook. Its payload
carries sourceRunId, workspaceId, repositoryId, commitSha and an images array
of { imageUrl, imageDigest }: the bare repository ref and the full sha256: manifest
digest. Join them with @ for a deployable, immutable reference:
harbor.example.com/acme/api@sha256:…. A build that pushes two images produces one
event listing both.
It is a fact about images, not about a run, which is why it deliberately carries no build status and no trigger id (see the scoping note below). For what a release records and where to browse them, see Releases.
Usage periods
com.loha.usage.period.closed.v1 fires once per workspace when a calendar month is
closed and its immutable usage snapshot is written — the hook to reconcile a billing
period against your own systems. Its data carries workspaceId, period
(YYYY-MM), periodStart and periodEnd (ISO 8601), buildMinutes, buildCount
and planKey.
It fires once per period per workspace, on the snapshot being newly written, so a re-run of the close for an already-closed period sends nothing. Like a release it is a fact about a workspace, not about a run, so it carries no status and no trigger id.
Security issues
Three events report on security issues, and only for workspaces that have security issues enabled. The Webhooks page offers them only while security issues are enabled for the workspace.
com.loha.security.issue.new_critical.v1fires when a scan report finds CRITICAL issues that are new, reopened, or newly raised to CRITICAL. One event per report, however many issues it covers.com.loha.security.issue.sla_breached.v1fires when issues pass their fix deadline. One event per check, covering the issues that newly passed it. An issue is reported once per deadline: reopening it, revoking its triage or its accepted risk expiring starts a new deadline, which can be reported again.com.loha.security.issue.secret_detected.v1fires when a push to the default branch or a protected ref finds secrets that are new or reopened, at any severity. One event per push. Its secrets never also appear innew_critical.
Their data carries workspaceId, workspaceSlug (can be null), total (how many
issues the event covers) and issues, which lists at most 20 of them (the most
severe and longest overdue first, for a breach). new_critical and secret_detected also carry
assessmentId, buildId and repositoryId (the last two can be null; the buildId of secret_detected is always null). Each entry in
issues has id, severity, category, ruleId, packageName, title, slaDueAt
and ownerUserId; the last five can be null, and packageName is always null for a
secret.
The payload never carries a file path, version, line number, fingerprint or matched text, so it does not carry a secret's value. Like a release, these events are facts about a workspace, not about a run, so they carry no status and no trigger id.
Scope a subscription
A build-completion subscription is scoped along two axes so you only receive what you care about:
- Source: whole workspace (every build) or a single trigger (only builds fired by that trigger).
- Status: all terminal statuses, or a subset (e.g. failures only).
com.loha.release.produced.v1, com.loha.usage.period.closed.v1 and the three
com.loha.security.issue.* events carry no status and no trigger id, so a subscription
with a status filter or a specific trigger set will never receive any of them.
Keep those subscriptions whole-workspace with all statuses, or put them on their own
webhook.
Notification channels (Microsoft Teams) can render build completion and the security issue events, and nothing else, so they cannot subscribe to release or usage events. The API rejects the combination rather than accepting a channel that would silently post nothing. To post security issue alerts to Teams, create a channel subscribed to the security issue events and leave its scope on the whole workspace with all statuses.