Skip to content

Preview: Model Atlas is in development and not yet available.

Receiving webhooks

When a merge finds changes that match one of your subscriptions, Model Atlas POSTs them to your endpoint, signed with the endpoint’s secret. This page covers what arrives, how to check it really came from us, and how to answer.

An HTTPS POST to your endpoint’s URL, with these headers:

Header Value
Content-Type application/json
User-Agent ModelAtlas-Webhooks/1
Model-Atlas-Delivery The delivery’s ID (a ULID): the same as the body’s id, and the same on every retry. Not signed: see Duplicates.
Model-Atlas-Signature t=<unix seconds>,v1=<hex>, with a second v1= during a secret rotation

The body is one model’s changes from one merge: id (the delivery’s ID), type (events), created_at, model (slug, name), summary (counts by type and materiality, for a notification’s title), part and parts, and events, oldest first. Each event is the same JSON that GET /v1/events returns. New fields can appear at any time, so ignore the ones you don’t know.

A delivery body (indented here; it arrives on one line)
{
"created_at": "2026-12-01T06:00:40Z",
"events": [
{
"correction": false,
"correction_reason": null,
"data": {
"detail": {
"retires_on_kind": "exact"
},
"effective_on": "2027-05-15",
"field": "retires_on",
"new": "2027-05-15",
"old": "2027-04-08",
"region": null
},
"detected_at": "2026-12-01T06:00:12Z",
"entity": {
"slug": "bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0",
"type": "offering"
},
"id": "01KB5Z6T8QY0M7J3V2C9W4D1EN",
"materiality": "high",
"provenance": {
"source": "bedrock-lifecycle-page",
"source_run_id": "3f1c2b9e-8d47-4a6e-9b1f-0c2d5e7a8b10"
},
"type": "lifecycle.retirement_date_changed",
"version": 1
}
],
"id": "01KB5Z7A2M4N6P8R0S2T4V6W8X",
"model": {
"name": "Claude Sonnet 4.5",
"slug": "claude-sonnet-4-5"
},
"part": 1,
"parts": 1,
"summary": "1 lifecycle.retirement_date_changed (high)",
"type": "events"
}

Check every delivery before you act on it:

  1. Read the raw request body, as bytes, before any JSON parsing. The signature covers those exact bytes: parsing and re-serializing changes them (spacing, key order, escaping), and the check fails.
  2. Split Model-Atlas-Signature on ,. Each part is key=value: one t, and one or more v1. Ignore keys you don’t know.
  3. Reject the delivery if t is more than 5 minutes from your clock, either way. This stops a captured delivery from being replayed later. Keep your server’s clock in sync (NTP).
  4. Compute HMAC-SHA256 over <t>.<raw body>: the t value exactly as received, a ., then the body bytes. The key is the whole secret string, whsec_ included, as UTF-8 bytes. Don’t base64-decode it.
  5. Hex-encode the result and compare it with each v1 value in constant time (crypto.timingSafeEqual, hmac.compare_digest, hmac.Equal). Accept the delivery if any one matches.

If the check fails, answer 400 and don’t process the body.

Complete receivers, standard library only. Each verifies the signature, checks that Model-Atlas-Delivery matches the body’s id, answers 204 at once, then processes the delivery off the request path, skipping any delivery ID it has already processed. They print what they receive: replace that with your own handling. They’re tested against the test vector below on every build.

They listen on plain HTTP: put them behind your HTTPS load balancer or reverse proxy, since we only deliver to https URLs.

Node.js 18 or later. verify-signature.mjs has the check on its own, for use in any framework: pass it the raw body as a Buffer (in Express, express.raw({ type: 'application/json' })).

verify-signature.mjs
// verify-signature.mjs: checks a Model Atlas webhook signature. Node.js 18+, no dependencies.
import { createHmac, timingSafeEqual } from 'node:crypto'
const TOLERANCE_SECONDS = 5 * 60
// verifySignature checks a Model-Atlas-Signature header ("t=<unix>,v1=<hex>[,v1=<hex>]")
// against the raw body bytes (a Buffer, exactly as received). It returns null when a v1
// signature matches and t is within 5 minutes of now, or the reason it doesn't.
export function verifySignature(header, rawBody, secret, now = Date.now() / 1000) {
let timestamp
const signatures = []
for (const part of (header ?? '').split(',')) {
const [key, ...rest] = part.trim().split('=')
const value = rest.join('=')
if (key === 't') timestamp = value
else if (key === 'v1' && /^[0-9a-f]{64}$/i.test(value)) signatures.push(Buffer.from(value, 'hex'))
}
if (!timestamp || !/^[0-9]+$/.test(timestamp)) return 'no timestamp'
if (Math.abs(now - Number(timestamp)) > TOLERANCE_SECONDS) return 'timestamp outside the tolerance'
// HMAC-SHA256 of "<t>.<raw body>", keyed with the whole secret string, whsec_ included.
const expected = createHmac('sha256', secret).update(`${timestamp}.`).update(rawBody).digest()
return signatures.some((s) => timingSafeEqual(s, expected)) ? null : 'no matching signature'
}
receiver.mjs
// receiver.mjs: receives Model Atlas webhooks. It verifies each delivery's signature,
// answers 204 at once, then processes the delivery off the request path.
// Run: MODEL_ATLAS_WEBHOOK_SECRET=whsec_... PORT=8000 node receiver.mjs
import { createServer } from 'node:http'
import { verifySignature } from './verify-signature.mjs'
const secret = process.env.MODEL_ATLAS_WEBHOOK_SECRET
if (!secret) throw new Error('set MODEL_ATLAS_WEBHOOK_SECRET to the endpoint\'s whsec_ secret')
const MAX_BODY_BYTES = 1024 * 1024 // Model Atlas sends at most 64 KB
// Delivery IDs already processed: the signed body's id, which a retry keeps. With more than
// one instance, or to survive restarts, keep them in your database instead (a unique key on the ID).
const seen = new Set()
function processDelivery(delivery) {
if (seen.has(delivery.id)) {
console.log(`delivery ${delivery.id}: duplicate, skipped`)
return
}
seen.add(delivery.id)
console.log(`delivery ${delivery.id} (part ${delivery.part} of ${delivery.parts}): ${delivery.model.name}: ${delivery.summary}`)
for (const event of delivery.events) {
if (event.data.detail?.truncated) {
console.log(` ${event.id} ${event.type}: truncated, the whole event is at ${event.data.detail.event}`)
} else {
console.log(` ${event.id} ${event.type}: ${event.entity.slug} ${event.data.field} ${event.data.old} -> ${event.data.new}`)
}
}
}
async function handle(req, res) {
if (req.method !== 'POST') return res.writeHead(405, { Allow: 'POST' }).end()
// Collect the raw bytes: the signature covers them exactly, so don't parse and re-serialize first.
const chunks = []
let size = 0
for await (const chunk of req) {
size += chunk.length
if (size <= MAX_BODY_BYTES) chunks.push(chunk)
}
if (size > MAX_BODY_BYTES) return res.writeHead(413).end()
const body = Buffer.concat(chunks)
const problem = verifySignature(req.headers['model-atlas-signature'], body, secret)
if (problem) return res.writeHead(400, { 'Content-Type': 'text/plain' }).end(problem)
let delivery
try {
delivery = JSON.parse(body.toString('utf8'))
} catch {
return res.writeHead(400, { 'Content-Type': 'text/plain' }).end('invalid JSON')
}
// The signature covers the body, not the Model-Atlas-Delivery header: dedupe on the body's id,
// and reject a header that doesn't match it (a replayed body under another delivery ID).
if (typeof delivery?.id !== 'string' || delivery.id !== req.headers['model-atlas-delivery']) {
return res.writeHead(400, { 'Content-Type': 'text/plain' }).end('Model-Atlas-Delivery does not match the body\'s id')
}
res.writeHead(204).end()
setImmediate(() => processDelivery(delivery))
}
const server = createServer((req, res) => {
handle(req, res).catch((err) => {
console.error(err)
if (!res.headersSent) res.writeHead(500).end()
})
})
server.listen(Number(process.env.PORT ?? 8000), () => console.log(`listening on port ${server.address().port}`))

Check your own code with this delivery, signed by Model Atlas’s signing code. Verified at t (or up to 5 minutes later), each header must pass with the secrets shown and fail with any change to the body, the timestamp or the secret. With your real clock, t is long past, so your code should reject it as too old: pass the time in, as the samples do.

secret
whsec_Zx3c9vT1mQ8kR2pL5nW7yB4dF6hJ0sA1uE3gI5oK7qM
t (2026-12-01T06:01:30Z)
1796104890
body (exactly these bytes: one line, no trailing newline)
{"created_at":"2026-12-01T06:00:40Z","events":[{"correction":false,"correction_reason":null,"data":{"detail":{"retires_on_kind":"exact"},"effective_on":"2027-05-15","field":"retires_on","new":"2027-05-15","old":"2027-04-08","region":null},"detected_at":"2026-12-01T06:00:12Z","entity":{"slug":"bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0","type":"offering"},"id":"01KB5Z6T8QY0M7J3V2C9W4D1EN","materiality":"high","provenance":{"source":"bedrock-lifecycle-page","source_run_id":"3f1c2b9e-8d47-4a6e-9b1f-0c2d5e7a8b10"},"type":"lifecycle.retirement_date_changed","version":1}],"id":"01KB5Z7A2M4N6P8R0S2T4V6W8X","model":{"name":"Claude Sonnet 4.5","slug":"claude-sonnet-4-5"},"part":1,"parts":1,"summary":"1 lifecycle.retirement_date_changed (high)","type":"events"}
Model-Atlas-Signature
t=1796104890,v1=e059c0788b0cda62189895d61445b39eaa1218a551117060e67b2295a8f474fd

During a rotation, the same delivery carries both secrets’ signatures, the new one first. Both secrets must verify it:

previous secret
whsec_6HbgwfmPSduORQL3iyYfzJSJPMZ0d9sl4_dk34B-nm4
Model-Atlas-Signature during a rotation
t=1796104890,v1=e059c0788b0cda62189895d61445b39eaa1218a551117060e67b2295a8f474fd,v1=2fdd303de864ec97275b8f211753de96a700489b8350f938e498923161698f4f

The secret (whsec_ and 43 more characters) is shown once: when you create the endpoint and when you rotate it. To rotate:

  1. Call POST /v1/webhook-endpoints/{id}/rotate-secret. It returns the new secret.
  2. For the next 24 hours, every delivery carries two v1= signatures, the new secret’s first and the old one’s second. Code that accepts any matching v1 keeps working with either secret, so you can deploy the new one whenever you’re ready in that window.
  3. After 24 hours, only the new secret signs.

You can’t rotate again while the old secret is still valid: that’s a 409 conflict, so the old secret always gets its full 24 hours. If a secret has leaked and you need it to stop working at once, replace the endpoint.

Deleting an endpoint stops its secret at once, but it also deletes the endpoint’s subscriptions, its delivery log and its pending deliveries. Creating a new endpoint alone leaves your notifications stopped. To replace one:

  1. Note its subscriptions first. List your subscriptions and keep the settings of each one whose endpoint_id is the old endpoint.
  2. Note the time, then delete the endpoint.
  3. Create the new endpoint and store its new secret where your receiver reads it. Deploy that before anything else, or the next deliveries fail your signature check.
  4. Recreate each subscription on the new endpoint. A new subscription matches only events after it was created, so nothing is sent twice.
  5. Recover what you missed. Deliveries that were pending on the old endpoint, and events between the deletion and the new subscriptions, aren’t sent again. Fetch them from GET /v1/events with since set to the time from step 2, or with after set to the last event ID you processed. The events have the same IDs and data as the webhooks.

A delivery can arrive more than once: after a timeout we retry even if your server did process it, a redelivery sends it again, and if we lose your answer on our side we send it again after 5 minutes. Every copy has the same delivery ID, in the body’s id and in the Model-Atlas-Delivery header. Each part of a large change has its own ID.

Deduplicate on the body’s id, after verifying the signature. The signature covers t and the body, not the headers. So someone who captures a request could replay it within the 5 minutes with a different Model-Atlas-Delivery value, and if you deduplicated on the header, you’d process it twice. Record the IDs you’ve processed (a unique key in your database is best) and skip the ones you’ve seen. We always send a header equal to the body’s id, so also reject a request where they differ (400, not processed), as the samples do.

The event IDs inside are stable too. Each attempt is signed afresh, so t and the signature differ between copies.

Answer with any 2xx as soon as the signature checks out, and do the work afterwards (a queue, a background job). Each attempt has 10 seconds, connecting included; a slower answer counts as a failure and is retried, even if you finish processing it.

Anything else is a failure: a non-2xx status, a timeout or a connection error. A 3xx is a failure too: we never follow redirects, so register the final URL.

A failed delivery is retried with the same ID and body. The wait after each failed attempt:

After attempt 1 2 3 4 5 6 7
Wait 1 min 5 min 30 min 2 h 8 h 24 h 36 h

Each wait varies by up to 20% either way. That’s 8 attempts over about 3 days. If the eighth fails, the delivery is failed: it stays in the delivery log and you can redeliver it.

If an endpoint keeps failing for 3 days without a single success, we disable it (enabled: false, disabled_reason: failing). Turn it back on with PATCH /v1/webhook-endpoints/{id} and {"enabled": true}: its pending deliveries resume, but changes from while it was disabled aren’t delivered. Catch up on those with GET /v1/events.

The delivery log (GET /v1/deliveries, the last 30 days) shows every delivery, and GET /v1/deliveries/{id} its attempts, with your status code, error and response time. POST /v1/deliveries/{id}/redeliver sends a failed, succeeded or skipped delivery again, with the same ID and body and a fresh set of attempts. One that’s still pending is a 409 conflict.

One delivery holds at most 100 events and 64 KB. A merge that changes more for one model comes as several deliveries, numbered by part of parts (1 of 3, 2 of 3, …). Each part has its own ID and is retried on its own, so parts can arrive in any order.

An event too big for a delivery on its own is truncated: its ID, type, materiality, entity and provenance stay; data.old and data.new keep their first 1 KB, ending in …; and data.detail becomes:

{"truncated": true, "event": "/v1/events/01KB5Z6T8QY0M7J3V2C9W4D1EN"}

Fetch the whole event from that path with your API key (GET /v1/events/{id}).

  • Keep the secret on your server. Store it like a password (a secrets manager or an environment variable), never in a browser, a mobile app or source control. Anyone with it can sign deliveries that pass your check.
  • HTTPS only. Endpoint URLs must use https and a host name (not an IP address) that resolves to public addresses. We use TLS 1.2 or later.
  • We never follow redirects and don’t send through a proxy: a delivery goes only to the URL you registered.
  • Verify before you trust anything in the body. The body comes from the internet until the signature says otherwise.
  • If a secret may have leaked, replace the endpoint: rotation keeps the old secret valid for 24 hours.