BevylDevelopers

Webhooks

Get notified when uploads, projects, and exports finish.

Bevyl sends a POST to the webhook URL on your partner account when a background step finishes. The partner portal shows the URL.

Events

EventSent whendata
broll.processedAn uploaded video finishes processing.videoId, processingRunId
project.completedProject generation finishes with completed or no_clips.projectId, aiRunId (the runId that getProjectStatus takes), outcome (success or no_clips)
export.readyAn export is ready to download.exportId, projectId, projectTitle, exportName, exportUrl, exportDirectUrl (same as exportUrl), exportDownloadUrl, exportLinkExpiresAt

Every event shares one envelope:

{
  "event": "export.ready",
  "eventId": "customer-123:…",
  "workspaceId": "customer-123",
  "resource": { "type": "export", "id": "…" },
  "status": "ready",
  "occurredAt": "2026-10-22T16:00:00.000Z",
  "data": {
    "exportId": "…",
    "projectId": "…",
    "projectTitle": "Truffle burger ad",
    "exportName": "truffle-burger-ad.mp4",
    "exportUrl": "https://…",
    "exportDirectUrl": "https://…",
    "exportDownloadUrl": "https://…",
    "exportLinkExpiresAt": "2026-11-21T16:00:00.000Z"
  }
}

Branch on event. For project.completed, status is completed or no_clips. Bevyl calls uploaded footage b-roll, so resource.type is broll for uploads.

Bevyl may deliver an event twice. Skip any eventId you have handled.

Answer with a 2xx within 10 seconds. Failed uploads, project generations, and exports send no webhook. Deliveries can fail. Keep polling as a fallback.

Verify signatures

The x-webhook-signature header holds sha256= and the hex HMAC-SHA256 of the raw body, keyed with your signing secret. Verify the raw body. Re-serialized JSON will not match.

import { SIGNATURE_HEADER, parseWebhookEvent } from '@bevyl-ai/bevyl-sdk';

export async function POST(request: Request) {
  const event = parseWebhookEvent({
    rawBody: await request.text(),
    signature: request.headers.get(SIGNATURE_HEADER),
    secret: process.env.BEVYL_WEBHOOK_SECRET!,
  });

  // handle event
  return new Response(null, { status: 204 });
}

parseWebhookEvent throws BevylWebhookVerificationError on a bad signature or body. verifySignature checks the signature alone.

On this page