Overview
Run a local server, expose it with a tunnel (e.g., ngrok), and point Blooio to the public URL.
Start a local server
import express from "express";
const app = express();
app.use(express.json());
app.post("/webhooks/blooio", (req, res) => {
console.log("[Blooio]", req.headers["x-blooio-event"], req.body);
res.sendStatus(200);
});
app.listen(3001, () => console.log("Listening on http://localhost:3001"));
Expose the server
ngrok http http://localhost:3001
Copy the HTTPS URL from ngrok, e.g., https://abcd1234.ngrok.io.
Create a new webhook using the API:
curl -X POST 'https://backend.blooio.com/v1/api/webhooks' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"webhook_url": "https://abcd1234.ngrok.io/webhooks/blooio",
"webhook_type": "message"
}'
You can have up to 64 webhooks per organization. Set webhook_type to
"message" for message events only, or "all" for all events.
Verify deliveries
You should see incoming events in your terminal. See event schemas in Webhook events.
Managing webhooks
List all webhooks
curl -X GET 'https://backend.blooio.com/v1/api/webhooks' \
-H 'Authorization: Bearer YOUR_API_KEY'
Update a webhook
curl -X PATCH 'https://backend.blooio.com/v1/api/webhooks' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"webhook_url": "https://abcd1234.ngrok.io/webhooks/blooio",
"webhook_type": "all"
}'
Delete a webhook
curl -X DELETE 'https://backend.blooio.com/v1/api/webhooks' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"webhook_url": "https://abcd1234.ngrok.io/webhooks/blooio"
}'