Webhooks

Private beta The v1 contract is implemented; the endpoints are not publicly reachable yet and access is by request. Details may still change during the beta.

Webhooks are part of the private beta: endpoints are managed in the developer dashboard, deliveries are signed and retried as described here. Until the beta is deployed, polling GET /v1/fits/:id is the way to get a result.

Events

EventWhen
fit.processingThe Fit left the queue and is being generated
fit.completedThe Fit is completed; data.fit.output holds the links
fit.failedThe Fit failed; data.fit.error says why

Endpoints

Endpoints belong to the organization and are managed in the dashboard (an API for them is planned). Each endpoint has a public https URL, the events it subscribes to, and a signing secret shown once at creation. Private, local and link-local addresses are refused, at creation and again at every delivery. Up to ten endpoints per organization during the beta.

Payload

{
  "id": "evt_8nc2vX4qR1...",
  "object": "event",
  "type": "fit.completed",
  "apiVersion": "v1",
  "createdAt": "2026-01-01T10:00:48Z",
  "data": {
    "fit": { "id": "fit_7hsK2pL4...", "object": "fit", "status": "completed", "output": { "image": { "url": "https://...", "expiresAt": "..." } } }
  }
}

data.fit is the Fit object at the time of the event; for a completed Fit its output links are minted at delivery and expire like any other link. The id starts with evt_.

Headers

HeaderContent
Outfit-Event-IdThe event id, for deduplication
Outfit-Event-TypeThe event type
Outfit-TimestampUnix seconds when the delivery was signed
Outfit-Signaturev1=<hex>; several v1= values during a secret rotation

Verifying a signature

  1. Read the raw request body, unchanged.
  2. Build signedPayload = timestamp + "." + rawBody with the value of Outfit-Timestamp.
  3. Compute HMAC-SHA256(secret, signedPayload) and encode it as lower-case hex.
  4. Compare with each v1= value of Outfit-Signature using a constant-time comparison.
  5. Reject the delivery if the timestamp is more than five minutes from now.
import { createHmac, timingSafeEqual } from 'node:crypto';

export function verify(rawBody: string, headers: Headers, secret: string): boolean {
  const timestamp = headers.get('outfit-timestamp') ?? '';
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
  const expected = createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
  return (headers.get('outfit-signature') ?? '')
    .split(',')
    .map((part) => part.trim().replace(/^v1=/, ''))
    .some((sig) => sig.length === expected.length && timingSafeEqual(Buffer.from(sig), Buffer.from(expected)));
}

Replay protection

The timestamp window rejects old deliveries. In addition, store each Outfit-Event-Id you processed and ignore a repeated one: retries deliver the same event id again.

Responding and retries

Answer 2xx within 10 seconds; do the work afterwards. A failed attempt (any other status, a redirect, a timeout, a connection error) is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours: eight attempts in all, then the delivery is marked exhausted and shown in the dashboard. Events can arrive out of order; use the Fit's status, not the order of events. An endpoint that answers 410 Gone is disabled and its queued deliveries cancelled.

Secret rotation

Rotating a secret in the dashboard keeps the old one valid for 24 hours; deliveries in that window carry two v1= signatures. Verify against either.