Skip to main content
Documentation
Docs
Esc

    Loading the search index…

    Webhooks

    The webhooks Pagebread receives from its payment and email providers, how they are verified, and the state of outbound webhooks.

    Pagebread receives webhooks from two providers: Dodo Payments for billing and Resend for email. Both are endpoints Pagebread itself consumes. You can't register your own endpoint for them, and you don't need to call them.

    Outbound webhooks are not available yet

    Pagebread doesn't send webhooks to your systems. Plans list a webhooks feature and a number of webhook endpoints, but nothing sends events to customer endpoints today, and there is no screen or route to configure one. Use the API to read the state you need.

    The two inbound endpoints

    EndpointSenderWhat it is for
    POST /api/v2/billing/webhooks/dodoDodo PaymentsPayments, renewals, subscription status
    POST /api/v2/public/webhooks/resendResendEmail bounces and complaints

    Neither takes a bearer token: the caller is a provider, not a person. Each is authenticated by a signature over the exact bytes of the request body, with a secret shared with that provider and held only on Pagebread's servers.

    How deliveries are verified

    Both providers sign in the same scheme (Standard Webhooks, which Resend delivers through Svix):

    1. Three headers come with each delivery: an id, a Unix timestamp, and one or more signatures.
    2. The signed content is <id>.<timestamp>.<raw body>.
    3. The signature is an HMAC-SHA256 of that content with the endpoint's secret, base64-encoded, sent as v1,<signature>. Several may be sent, separated by spaces; one match is enough.
    EndpointId headerTimestamp headerSignature header
    Dodowebhook-idwebhook-timestampwebhook-signature
    Resendsvix-idsvix-timestampsvix-signature

    For Dodo deliveries, Pagebread also refuses a timestamp more than five minutes from its own clock. Resend deliveries are checked with Resend's own library.

    A delivery that doesn't verify, or that arrives when the endpoint has no secret configured, gets a fixed 401 UNAUTHORIZED and nothing in it is read.

    Billing events from Dodo

    Every delivery is recorded under its webhook-id, so a delivery seen before is not applied twice. Pagebread doesn't trust the payload itself: it fetches the payment or subscription the event names from Dodo again and applies Dodo's answer.

    Event familyWhat Pagebread does
    payment.* for a checkoutCompletes the checkout: the workspace moves to the paid plan and a receipt is written.
    payment.succeeded on a running subscriptionApplies a plan change that was waiting for its charge; otherwise records the renewal, moves the billing period on and writes a receipt.
    payment.failed for a plan changeFails that checkout. Nothing else changes.
    subscription.*Follows Dodo's status: past due becomes Payment overdue, on hold becomes Restricted, paused becomes Paused, active becomes active again. A subscription that is cancelled or expired moves the workspace to Free, with nothing deleted. The cancel-at-period-end flag follows Dodo too.
    refund.*, dispute.*Logged for Pagebread staff. Nothing changes in the workspace.
    Anything elseAcknowledged and ignored.

    Responses:

    • 204 when the event was applied, ignored or already seen.
    • 500 when applying it failed. Dodo then retries; each step is safe to repeat, so a retry applies once.

    What these states mean for a workspace is described in Trials, downgrades and freezes.

    Email events from Resend

    Pagebread acts on two events. Everything else is acknowledged with 204 and dropped.

    EventWhat Pagebread does
    email.bounced with a permanent bounceSuppresses the address: Pagebread stops sending to it.
    email.complainedSuppresses the address.

    Temporary bounces are left alone, since Resend retries them itself. When an address is suppressed, any open update request sent to it is marked as bounced, so your team sees it and can reach the applicant another way.

    A delivery later reporting a successful send does not lift a suppression. If recording a suppression fails, the endpoint answers 500 so Resend retries.

    Rate limits

    Both endpoints share a dedicated rate-limit tier, separate from the other public routes. See Rate limits.