Webhooks
Standard Webhooks signing, the eight events, retries, and how to verify a signature in Node, Go and Python.
A webhook is a message our server sends to yours when something changes. You give us a URL; we
POST a small JSON document to it, signed so you know it came from us. Typical uses: post an
alert to Slack or Teams, fail a deploy when the CDN stops keeping labels, open a ticket in Jira or
Linear. No code to write? The email and Slack alerts in the dashboard need no webhook, and they
are the better choice when nobody watches the logs your handler writes.
Events
An event fires only when something produces it. Subscribing to monitor.regression without a
monitor gives you silence, not a clean bill of health.
| Event | Fires when | Produced by |
|---|---|---|
verification.completed |
A verification finishes, including a failed one | POST /verifications calls |
monitor.run.completed |
A monitor run finishes | a monitor |
monitor.regression |
One or more checkpoints regressed | a monitor |
usage.threshold |
The organization crossed 50 %, 80 % or 100 % of a quota (metric assets for assets under management) |
any usage |
asset.lost |
A tracked location is served without the credential it had, or an unsigned copy of a signed asset appears | a verified domain or registered assets |
asset.stripped_copy_seen |
A file without a credential, checked by anyone, matches one of your registered assets | registered assets |
digest.ready |
The weekly inventory digest is ready | a domain or registered assets |
evidence_pack.ready |
The monthly Article 50 evidence pack is ready, on the 1st | a plan with evidence_pack |
Every delivery has the same envelope:
{ "id": "0199b1f2-6c1e-7a3b-9d4e-5f6a7b8c9d0e", "type": "asset.lost", "created_at": "2026-10-07T06:00:00Z", "data": { } }
| Event | data |
|---|---|
verification.completed |
verification id, project id, status, credential status, error code, decision when the project has a policy, your metadata |
monitor.run.completed |
monitor id, run id, counts |
monitor.regression |
monitor id, run id, regressed lines |
usage.threshold |
metric, threshold |
asset.lost |
asset id, event id, location, from and to status, detail (for example "kept at …", the location that still carries the credential), signer, project |
asset.stripped_copy_seen |
the same fields as asset.lost |
digest.ready |
assets, signed, coverage_pct, added, lost, regained, removed, stripped_copies_seen |
evidence_pack.ready |
month, locations, signed, csv_url, html_url |
Creating an endpoint
curl -s https://api.c2pa.design/v1/webhooks \
-H "authorization: Bearer $C2PA_API_KEY" \
-H "content-type: application/json" \
-d '{"url":"https://hooks.example.com/c2pa","events":["monitor.regression"]}'
The response contains secret (prefix whsec_). It is shown once.
Signature
We follow Standard Webhooks. Three headers:
webhook-id: 0199b1f3-0a4d-7c2e-8b1f-2d3e4f5a6b7c
webhook-timestamp: 1757000000
webhook-signature: v1,base64(HMAC-SHA256(id.timestamp.body))
The signed string is {id}.{timestamp}.{body} with the raw body bytes — verify before parsing
the JSON, and compare in constant time. Reject anything more than five minutes old.
Node
import { createHmac, timingSafeEqual } from 'node:crypto'
export function verify(secret, headers, rawBody) {
const id = headers['webhook-id']
const ts = headers['webhook-timestamp']
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false
const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64')
const expected = 'v1,' + createHmac('sha256', key)
.update(`${id}.${ts}.`).update(rawBody).digest('base64')
return headers['webhook-signature'].split(' ').some((candidate) => {
const a = Buffer.from(candidate)
const b = Buffer.from(expected)
return a.length === b.length && timingSafeEqual(a, b)
})
}
Go
mac := hmac.New(sha256.New, key)
mac.Write([]byte(id + "." + ts + "."))
mac.Write(body)
expected := "v1," + base64.StdEncoding.EncodeToString(mac.Sum(nil))
Python
import base64, hashlib, hmac
mac = hmac.new(key, f"{id}.{ts}.".encode() + body, hashlib.sha256)
expected = "v1," + base64.b64encode(mac.digest()).decode()
Delivery
Ten-second timeout. Retries with exponential backoff, six attempts spread over roughly six hours. Twenty consecutive failures disable the endpoint and email the organization's notification addresses — a dead URL should stop consuming the queue, and you should hear about it.
Respond 2xx quickly and do the work asynchronously; we do not care what is in the body.
Testing
A new endpoint is sent a signed ping when it is created, and POST /v1/webhooks/{id}/test (or
c2pa-check apply --ping) sends another. Treat setup as done only when GET /v1/webhooks shows
last_delivery.status: delivered: the first real alert should not be the first delivery.