Completion webhooks
Wake an editorial queue when a check submitted by API key reaches a terminal status.
Create an API key with webhooks:manage. Register one receiver per account with POST /v1/check-webhook and a JSON body such as {"url":"https://editor.example.org/silvertext/events"}. Use a public HTTPS hostname you control. Store the returned secret immediately. Publish the returned DNS TXT name and value, then call POST /v1/check-webhook/verify. Registration alone sends no events. Use polling for earlier checks and during receiver setup.
The worker posts a JSON body with id, type: "check.completed", version: 1, checkId, status, and occurredAt for API-key submissions reaching done, failed, cancelled, or rejected. Fetch a successful report using a key with checks:read. The event carries no document text.
Verify a delivery
Verify the signature using the exact request bytes before parsing JSON. Reject a timestamp outside five minutes of your clock. This example expects the headers as strings and the request body as a Node.js Buffer.
import { createHmac, timingSafeEqual } from 'node:crypto';
function validDelivery(secret: string, timestamp: string, signature: string, raw: Buffer) {
if (!/^\d{1,12}$/.test(timestamp) || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300)
return false;
if (!/^v1=[a-f0-9]{64}$/.test(signature)) return false;
const expected = createHmac('sha256', secret)
.update(timestamp + '.')
.update(raw)
.digest();
return timingSafeEqual(expected, Buffer.from(signature.slice(3), 'hex'));
}Read Silvertext-Timestamp and Silvertext-Signature. After verifying, persist the event ID and your work item atomically, then acknowledge with a 2xx status. A duplicate ID that you have already accepted should also receive 2xx. Delivery is at least once within a bounded retry window; order across checks is unspecified.
Operate the receiver
Use GET /v1/check-webhook to see the endpoint and its last 25 deliveries. By default, failed attempts retry with exponential backoff, starting at 30 seconds, capped at an hour, up to 12 attempts. Reconcile exhausted deliveries by polling the check ID. Redirect responses count as failures.
POST /v1/check-webhook/rotate returns a new signing secret. Retain the old secret briefly on the receiver for requests already in flight. DELETE /v1/check-webhook removes the endpoint and queued deliveries. A request already in flight can still arrive. Register and verify a fresh endpoint to change its destination.