Get started
Payload Bay receives webhooks for you, keeps a durable copy of every request, and delivers it to your application, retrying until it arrives or you stop it.
What Payload Bay is
Many services notify your application by sending it a webhook: an HTTP request that says something happened. If your application is offline or slow when that request arrives, the message can be lost. Payload Bay sits in front of your application. It accepts each request, stores it, answers the sender, and then delivers it to your application in the background. You can look at every request, see whether it was delivered, and replay it.
Delivery is at least once. In rare cases your application can receive the same request twice, so it should ignore duplicates. Each delivery carries an x-payloadbay-delivery-id header you can use for that.
Payload Bay is open source and runs on your own server. Your data stays with you.
Run it with Docker
You need Docker with Compose, a PostgreSQL password and a few secrets. The single-container setup is the quickest way to try Payload Bay.
-
Copy
.env.examplefrom the repository to a private file outside Git and fill it in. Generate each secret withopenssl rand -hex 24. -
Start it:
docker compose --env-file /secure/payloadbay.env -f deploy/compose.single.yml up -d --build -
Put a reverse proxy with HTTPS in front of port 3000, and set
PUBLIC_URLto the address people will use. -
Create the first owner account, as described below.
Create the first owner
The first owner proves they control the server with PAYLOADBAY_BOOTSTRAP_SECRET from your env file, and signs in with an emailed code. The server must be able to send email, so configure SMTP first. This is available only until setup completes.
In the dashboard, open /setup and follow the four steps: your name, the setup secret, your email address, then the six-digit code (valid for five minutes). The last button creates the owner and signs you in.
Through the API, send the same three requests. Browser-style requests need an Origin header equal to PUBLIC_URL and x-payloadbay-csrf: 1; GET /api/v1/bootstrap returns {"configured": false} while setup is pending.
-
Request a code:
curl -c cookies.txt -X POST "$PUBLIC_URL/api/v1/bootstrap" \ -H "origin: $PUBLIC_URL" -H "x-payloadbay-csrf: 1" -H "content-type: application/json" \ -d '{"action":"request-code","secret":"<setup secret>","email":"you@example.com","name":"Your Name"}' -
Sign in with the emailed code, keeping the session cookie:
curl -b cookies.txt -c cookies.txt -X POST "$PUBLIC_URL/api/auth/sign-in/email-otp" \ -H "origin: $PUBLIC_URL" -H "content-type: application/json" \ -d '{"email":"you@example.com","otp":"123456"}' -
Complete setup with the same secret:
curl -b cookies.txt -X POST "$PUBLIC_URL/api/v1/bootstrap" \ -H "origin: $PUBLIC_URL" -H "x-payloadbay-csrf: 1" -H "content-type: application/json" \ -d '{"action":"complete","secret":"<setup secret>"}'
For all settings, upgrades and backups, see Single-container deployment. For the full installation with scripted routes, see Operator installation.
Send your first webhook
-
Sign in and create a project.
-
Create a destination, which is the address of your application, and a forwarding route that sends to it. The route shows its receiving URL.
-
Send a test request to that URL:
curl -X POST "https://your-payloadbay.example/ingress/<route-key>" \ -H "content-type: application/json" \ -d '{"hello":"world"}' -
Open the route's event history. You will see the request you sent and whether it was delivered. If your application was unavailable, the event waits and is delivered when it returns. You can also replay it by hand.
-
Give the route's receiving URL to the service that sends you webhooks.
Next steps
- Verify signatures from providers such as Stripe or Twitch with the integration examples.
- Decide who can do what with permissions.
- Reject unwanted requests with request protection.
- Reach an application on a private network with the Runner.
- Automate everything through the API.
Payload Bay documentation
Install, operate and integrate Payload Bay, the self-hosted webhook gateway.
Webhook integration examples
These examples run in Payload Bay's bounded workerd ingress stage. Copy the source from the linked template into the route's ingress editor, bind the named secret to ingress, save and publish.