How Webhooks Work

Instead of waiting for API responses that might take several seconds, webhooks allow you to:

  • Receive responses asynchronously
  • Process large files efficiently
  • Build event-driven architectures
  • Scale your application without timeout concerns

Common Use Cases

  • Store responses in your database like projectId
  • Chain multiple API processes

Retry Policy

  • Maximum 5 retry attempts
  • 30-second delay between retries
  • Fails after 5 unsuccessful attempts (non 2xx responses)
  • Failed webhook data still accessible via /projects/{projectId}
  • Email notification sent on final failure

Implementation Example

const express = require("express");
const app = express();
app.use(express.json());

app.post("/hook", (req, res) => {
  try {
    const webhookData = req.body;

    // Process webhook data
    console.log("Received webhook:", webhookData);

    // Return success response
    res.status(200).json({ received: true });
  } catch (error) {
    console.error("Webhook processing failed:", error);
    res.status(500).json({ error: "Processing failed" });
  }
});

app.listen(3000);

If webhook delivery fails after 5 attempts, you can still retrieve your results by projectId. The projectId is returned in the initial API response. For more information on getting your projects by projectId, please refer to the Get Projects.