DocsAPI change webhooks

API change webhooks

Updated Oct 28, 2026

Get a signed CloudEvent at your HTTPS endpoint when a pipeline on a Skmtc Hub API finishes a delivery, and verify that Hub sent it.

A pipeline on Skmtc Hub starts a delivery when its API gets a new latest revision. The delivery runs the actions of the pipeline: generate, pull request and publish. A pipeline can also have a webhook action. The webhook action runs last, also after a failure. It sends one signed CloudEvent with the result of each action to your HTTPS endpoint.

This page tells you how to add a webhook action, receive the request, and check its signature. To make a pipeline, see Pipelines.

An OpenAPI 3.1 document describes the request. It has one entry under webhooks and no paths:

https://docs.skmtc.dev/openapi/api-change-webhooks-v1.json

Download the OpenAPI document. Load it by URL in Swagger Editor, Scalar or a code generator. It gives the request headers, the event schemas, and what Hub does with each response.

The same document is an API on Hub. See its docs and change history. The Skmtc API is the public HTTP API of Hub. Download its OpenAPI document.

This page is about the webhooks Hub sends to you. It is not about the webhooks section of an OpenAPI document that you publish.

Quick start

  1. Sign in to Hub and open the page of the API.
  2. Open the Pipelines menu and select New pipeline for this API.
  3. Select Add action, add a webhook action, and enter the HTTPS destination of your receiver. Add the other actions that you want.
  4. Select Create and run now. Hub creates the pipeline and starts a delivery for the current latest revision of the API.
  5. Copy the secret. Hub shows it one time only. Keep it where your receiver can read it.

The page of the pipeline (https://skmtc.dev/{owner}/pipelines/{name}) shows each delivery and the result of each action. The pipeline tools of the MCP server also create and run pipelines.

A pipeline has one webhook action or none. To send the result to more than one endpoint, make a pipeline for each endpoint.

Endpoint requirements

  • The URL uses https.
  • The host is public. Hub refuses loopback, private and reserved addresses.
  • The URL contains no user name or password.
  • The URL has 2048 characters or fewer, also after Hub encodes it. For example, Hub encodes é as %C3%A9.

Hub checks the URL when you save the pipeline. Before each request, Hub checks the URL, each redirect, and each address that DNS gives for the host. If a check fails, Hub does not send the request, and the webhook action fails with destination_blocked.

The request

Hub sends one HTTP POST for each delivery of the pipeline. The body is one CloudEvent 1.0 in structured mode, as JSON. Hub sends the body on one line; this page adds line breaks.

POST /webhooks/skmtc HTTP/1.1
content-type: application/cloudevents+json; charset=utf-8
user-agent: SKMTC-Hub-Webhooks/1
skmtc-signature: t=1791884463,v1=648a688fd085ce9157bbd0f17669d3cb3dbeb6881228f476c42c6a0ce370d337

{
  "specversion": "1.0",
  "id": "pdv_2c7e9a415b3d4f8ea6c21d0b9e8f7a65-1791884462",
  "source": "https://skmtc.dev",
  "subject": "acme/petstore",
  "time": "2026-10-13T09:41:02.000Z",
  "datacontenttype": "application/json",
  "type": "dev.skmtc.pipeline.delivery.v1",
  "data": {
    "deliveryId": "pdv_2c7e9a415b3d4f8ea6c21d0b9e8f7a65",
    "pipeline": {
      "owner": "acme",
      "name": "petstore-sdk",
      "url": "https://skmtc.dev/acme/pipelines/petstore-sdk"
    },
    "api": {
      "id": "api_8f2c1d4e5b6a47c9a0e3f1b2c3d4e5f6",
      "owner": "acme",
      "slug": "petstore",
      "name": "Petstore",
      "url": "https://skmtc.dev/acme/apis/petstore"
    },
    "revision": {
      "id": "ver_0c9e8d7f6a5b4c3d2e1f0a9b8c7d6e5f",
      "contentHash": "3b4f1c2d9e8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c",
      "version": "v2",
      "publishedAt": "2026-10-13T09:12:00.000Z",
      "retrievedAt": "2026-10-13T09:40:05.000Z",
      "url": "https://skmtc.dev/acme/apis/petstore/revisions/3b4f1c2d9e8a"
    },
    "results": [
      {
        "type": "generate",
        "outcome": "succeeded",
        "detail": "38 files from @acme/react-query 1.2.0",
        "durationMs": 7412
      },
      {
        "type": "pullRequest",
        "outcome": "succeeded",
        "detail": "https://github.com/acme/petstore-sdk/pull/12",
        "durationMs": 3954
      },
      {
        "type": "publish",
        "outcome": "succeeded",
        "detail": "@acme/petstore-sdk@0.1.4",
        "durationMs": 18230
      }
    ]
  }
}

Headers

HeaderValue
content-typeapplication/cloudevents+json; charset=utf-8
user-agentSKMTC-Hub-Webhooks/1
skmtc-signaturet=<unix seconds>,v1=<hex HMAC-SHA256>. See Verify the signature.

Event types

typeSent when
dev.skmtc.pipeline.delivery.v1A delivery of a pipeline with a webhook action gets to the webhook action.

The OpenAPI document also defines RevisionEventData, with RevisionEvent, the dev.skmtc.api.revision.v1 event that Hub builds internally. These are not webhooks. Hub sends RevisionEventData to MCP events subscribers as the data of an MCP event. It does this when a new revision becomes the latest revision of the API and the diff with the revision before it found a change. See Revision event data.

CloudEvent attributes

  • id is the same on every try of the event. Use it to find duplicates. It is the delivery id, a hyphen, and the time when the delivery started, in unix seconds. Run now on a delivery that finished starts it again, and the event gets a new id.
  • source is the Hub site that sent the event.
  • subject is the API of the revision, as {owner}/{slug}. Hub builds the event again on each try. Thus {owner} is the handle of the owner at the time of the try. If you filter on subject, accept both handles for at least 24 hours after a handle change.
  • time is the time when the delivery started. It is not the publisher's time.

Pipeline delivery event data

  • deliveryId: the Hub id of the delivery.
  • pipeline: the owner handle, the name and the url of the pipeline.
  • api: the id, owner, slug, name and url of the API of the revision.
  • revision: the revision that started the delivery.
  • results: one result for each action before the webhook action, in the order they ran. The webhook action is not in the list.

The revision has these fields:

  • id: the Hub id of the revision.
  • contentHash: the SHA-256 of the document. It is null for a revision with no stored document.
  • version: the publisher's version, or null. It does not give an order.
  • publishedAt: the publisher's time, or null when the publisher gave none.
  • retrievedAt: when Hub retrieved the revision.
  • url: the revision's page on Hub. For a revision with no stored document, it is the API's revisions page.

Each result has these fields:

  • type: generate, pullRequest or publish.
  • outcome: succeeded, failed, skipped, or notRun (an action before it failed). An action is skipped when the owner turned on skip for it. A pull request and a publish use the code of the generate action. Thus they are also skipped when the owner skips generate, or when the pipeline has no generate action.
  • reasonCode: a code for the machine, when the action failed or did not run.
  • detail: what the action did, or why it failed. For example, the URL of the pull request, or the published package as name@version.
  • durationMs: how long the action took. It is not there for an action that did not run.

The event contains results and links, not the generated code or the document. For a private API, the links open only for a signed-in user who can read the API.

Revision event data

MCP events subscribers get this data when a new revision becomes the latest revision of the API. The MCP events page gives the request that holds it.

{
  "api": {
    "id": "api_8f2c1d4e5b6a47c9a0e3f1b2c3d4e5f6",
    "owner": "acme",
    "slug": "petstore",
    "name": "Petstore",
    "url": "https://skmtc.dev/acme/apis/petstore"
  },
  "revision": {
    "id": "ver_0c9e8d7f6a5b4c3d2e1f0a9b8c7d6e5f",
    "contentHash": "3b4f1c2d9e8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c",
    "version": "v2",
    "publishedAt": "2026-10-13T09:12:00.000Z",
    "retrievedAt": "2026-10-13T09:40:05.000Z",
    "url": "https://skmtc.dev/acme/apis/petstore/revisions/3b4f1c2d9e8a"
  },
  "previousRevision": {
    "id": "ver_7a6b5c4d3e2f41a0b9c8d7e6f5a4b3c2",
    "contentHash": "9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d",
    "version": "v2",
    "publishedAt": null,
    "retrievedAt": "2026-10-06T14:02:51.000Z",
    "url": "https://skmtc.dev/acme/apis/petstore/revisions/9e8d7c6b5a4f"
  },
  "summary": {
    "diff": true,
    "details": {
      "endpoints": { "added": 1, "deleted": 0, "modified": 2 },
      "schemas": { "added": 0, "deleted": 1, "modified": 1 }
    }
  },
  "counts": { "breaking": 1, "warning": 0, "info": 3 },
  "changesUrl": "https://skmtc.dev/acme/apis/petstore/revisions/3b4f1c2d9e8a/changelog"
}
  • api: the id, owner, slug, name and url of the API.
  • revision: the revision that became the latest revision. It has the fields of the revision in the pipeline delivery event.
  • previousRevision: the latest revision before it. It can belong to a different version of the API.
  • summary.details: the number of added, deleted and modified items in each section of the document.
  • counts: the number of changes at each severity: breaking, warning and info.
  • changesUrl: the Hub page that lists the changes of revision against the revision before it in Hub's history. That revision can differ from previousRevision, so the page can differ from summary.

Hub does not send the event when the diff finds no change, for example after a commit that changes only spaces and line breaks. A revision that Hub imports into the history of an API, behind its latest revision, does not send an event.

Verify the signature

The skmtc-signature header has the form t=<unix seconds>,v1=<hex>. The v1 value is the HMAC-SHA256 of <t>.<body>:

  • The key is the whole secret as UTF-8, with its whsec_ prefix.
  • <t> is the t value from the header.
  • <body> is the raw request body.

Your receiver must:

  1. Calculate the HMAC from the raw body. Do not parse the JSON first. A body that you parse and serialize again can change by one byte, and then the signature does not match.
  2. Compare the result with v1 in constant time.
  3. Refuse a request whose t is more than five minutes from your clock.
  4. Use the CloudEvent id to ignore an event that you already processed.

This receiver does those steps. It uses only Web Crypto and the Fetch API Request and Response, so it runs on Deno, Bun and Cloudflare Workers. On Node.js, compile it to JavaScript first, or use Node.js 23.6 or later, which runs TypeScript.

// receiver.ts
const encoder = new TextEncoder()
const TOLERANCE_SECONDS = 5 * 60

/** Whether `header` is a valid skmtc-signature of `body` for `secret`. */
export const verifySignature = async (
  secret: string,
  header: string | null,
  body: string,
  now: number = Math.floor(Date.now() / 1000)
): Promise<boolean> => {
  const parts = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header ?? '')
  if (!parts) return false
  const [, timestamp = '', hex = ''] = parts
  if (Math.abs(now - Number(timestamp)) > TOLERANCE_SECONDS) return false

  const key = await crypto.subtle.importKey(
    'raw',
    encoder.encode(secret),
    { name: 'HMAC', hash: 'SHA-256' },
    false,
    ['verify']
  )
  const signature = new Uint8Array(32).map((_, index) =>
    parseInt(hex.slice(index * 2, index * 2 + 2), 16)
  )
  // `verify` compares in constant time.
  return crypto.subtle.verify('HMAC', key, signature, encoder.encode(`${timestamp}.${body}`))
}

// Event ids you already processed. Use a durable store in production.
const processed = new Set<string>()

export const handleWebhook = async (request: Request, secret: string): Promise<Response> => {
  const body = await request.text()
  const signature = request.headers.get('skmtc-signature')
  if (!(await verifySignature(secret, signature, body))) {
    return new Response('Invalid signature', { status: 401 })
  }

  const event = JSON.parse(body)
  if (processed.has(event.id)) return new Response(null, { status: 204 })

  if (event.type === 'dev.skmtc.pipeline.delivery.v1') {
    for (const result of event.data.results) {
      console.log(`${event.data.pipeline.name}: ${result.type} ${result.outcome}`)
    }
  }
  // After the work: if it throws, Hub gets a 5xx and the retry runs it again.
  processed.add(event.id)
  return new Response(null, { status: 204 })
}

To run it on Deno:

// main.ts
import { handleWebhook } from './receiver.ts'

const secret = Deno.env.get('SKMTC_WEBHOOK_SECRET')
if (!secret) throw new Error('Set SKMTC_WEBHOOK_SECRET to the signing secret')

Deno.serve((request) => handleWebhook(request, secret))
SKMTC_WEBHOOK_SECRET=whsec_… deno run --allow-net --allow-env main.ts

Hub needs a public HTTPS URL. To receive events on your computer, put a tunnel in front of the receiver.

Check your code with an example

With this secret, timestamp and body, your code must calculate the signature below. The body is the event in The request, as Hub sends it: one line, with no line break at the end.

secret:    whsec_l8m3Yl0iXq2t5Q7bGHzv9dN4kRcEwUjA1sPfoT6xK0M
timestamp: 1791884700
body:      {"specversion":"1.0","id":"pdv_2c7e9a415b3d4f8ea6c21d0b9e8f7a65-1791884462","source":"https://skmtc.dev","subject":"acme/petstore","time":"2026-10-13T09:41:02.000Z","datacontenttype":"application/json","type":"dev.skmtc.pipeline.delivery.v1","data":{"deliveryId":"pdv_2c7e9a415b3d4f8ea6c21d0b9e8f7a65","pipeline":{"owner":"acme","name":"petstore-sdk","url":"https://skmtc.dev/acme/pipelines/petstore-sdk"},"api":{"id":"api_8f2c1d4e5b6a47c9a0e3f1b2c3d4e5f6","owner":"acme","slug":"petstore","name":"Petstore","url":"https://skmtc.dev/acme/apis/petstore"},"revision":{"id":"ver_0c9e8d7f6a5b4c3d2e1f0a9b8c7d6e5f","contentHash":"3b4f1c2d9e8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c","version":"v2","publishedAt":"2026-10-13T09:12:00.000Z","retrievedAt":"2026-10-13T09:40:05.000Z","url":"https://skmtc.dev/acme/apis/petstore/revisions/3b4f1c2d9e8a"},"results":[{"type":"generate","outcome":"succeeded","detail":"38 files from @acme/react-query 1.2.0","durationMs":7412},{"type":"pullRequest","outcome":"succeeded","detail":"https://github.com/acme/petstore-sdk/pull/12","durationMs":3954},{"type":"publish","outcome":"succeeded","detail":"@acme/petstore-sdk@0.1.4","durationMs":18230}]}}
signature: t=1791884700,v1=d43d8e63453a24c65802521df91904fbdc3473be56d3d04fd89f7a4ac0669671

The request in The request has a signature from the same secret.

Respond

Return a 2xx status within 10 seconds. Hub does not read the response body. If the work is slow, put the event in a queue and respond. Hub counts a slow response as a timeout, and sends the event again.

Your responseWhat Hub does
Any 2xxThe webhook action succeeded.
307 or 308Hub sends the same request to the location, for not more than three redirects.
408, 429, any 5xx, a timeout or a network errorHub tries again later.
Any other 3xx or 4xxThe webhook action fails with destination_rejected. Hub does not try again.

Hub does not send the request again for a 301, 302 or 303 redirect, because a client changes the POST to a GET for these. Give the final URL as the destination.

Retries, duplicates and order

Hub makes the first try when the delivery gets to the webhook action. If Hub must try again, the webhook action shows failed with the reason code webhook_retrying, and the delivery shows failed. Hub tries again for not more than 24 hours after the first try. The first waits are about one minute, and each wait is about two times the wait before it, to not more than six hours.

  • When a later try gets a 2xx, the webhook action changes to succeeded. If the webhook action was the only failure, the delivery also changes to succeeded.
  • When the 24 hours end, the webhook action fails with retries_exhausted.

Each try has a new t and a new signature, but the same event id.

Delivery is at least once: your receiver can get the same event more than one time, for example when Hub did not get your response. Use the event id to find duplicates.

Hub does not guarantee the order of deliveries.

A newer delivery of the pipeline supersedes an older one. Then the older delivery sends no event, and Hub cancels the later tries of its event with superseded. Thus you do not get an event for each revision. Use revision to find the revision that each event describes.

Failures and auto-pause

Five failed deliveries in a row pause the pipeline. A webhook action that fails on its first try, for example with destination_rejected, makes the delivery fail, and that counts. A webhook action with webhook_retrying does not count. When a later try fails, for example with retries_exhausted, that also does not count. A delivery that succeeds sets the count to zero.

Pause, resume and delete

  • Pause. A new revision does not start a delivery during the pause. Hub cancels the later tries of a webhook event with pipeline_paused, and does not send them after you resume.
  • Resume. The next new revision starts a delivery. To deliver the current latest revision, select Run now.
  • Remove the webhook action. Hub cancels the later tries of its events with webhook_deleted.
  • Delete the pipeline. Hub deletes its deliveries and their tries.

Access to the API

Before each try, Hub checks that the user who created the pipeline can read the API of the revision. If that user can no longer read it, Hub cancels the tries with access_revoked and pauses the pipeline.

Rotate the secret

To get a new secret, send a POST to /v1/pipelines/{account}/{pipeline}/rotate-webhook-secret of the Skmtc API from a signed-in session. A personal access token cannot rotate the secret. The response shows the new secret one time.

The old secret stops at once. Hub signs the next try with the new secret. This also applies to tries of events from before the rotation. Until your receiver has the new secret, it refuses Hub's requests with a 401, and the webhook action fails with destination_rejected. After you update the receiver, select Run now to deliver the current latest revision again.

Delivery history and troubleshooting

The page of the pipeline shows each delivery, with the result of each action. The GET /v1/pipelines/{account}/{pipeline}/deliveries route of the Skmtc API gives the same deliveries. A webhook action that did not succeed has one of these reason codes:

Reason codeMeaning
webhook_retryingA try got a retryable answer. Hub tries again for not more than 24 hours.
destination_rejectedYour endpoint returned a 3xx or 4xx that Hub does not retry.
retries_exhaustedThe endpoint did not return a 2xx within 24 hours.
destination_blockedThe URL, a redirect, or a DNS address is not a public HTTPS destination.
access_revokedThe user who created the pipeline can no longer read the API.
pipeline_pausedThe pipeline was paused before a later try.
supersededA newer delivery of the pipeline started before a later try.
webhook_deletedThe webhook action was removed before a later try.
event_unavailableThe API or the revision that the event names is missing. Hub does not try again.
delivery_lostAn error in Hub stopped the try before it got a result. Hub does not try again.

The detail of the result gives the response status or the error.