Webhooks
Receive real-time notifications when import jobs complete, fail, or encounter validation errors. Webhooks are powered by Svix, which handles reliable delivery, automatic retries, and signature verification.
Event types
| Event | When it fires |
|---|---|
smart_import.job.started | An import job begins processing |
smart_import.job.completed | An import job finishes successfully |
smart_import.job.failed | An import job fails after all retries |
smart_import.import.validation_failed | Input data fails validation before processing |
Managing webhook endpoints
Webhook endpoints are managed directly from your portal. The Webhooks section embeds the Svix App Portal — a white-labelled UI where you can add endpoints, inspect delivery history, replay events, and debug failures. No Svix account needed.
What you can do in the portal
- • Add, edit, and delete webhook endpoints
- • Choose which event types to subscribe to
- • Inspect delivery history and response codes
- • Replay past events for testing
- • Rotate endpoint signing secrets
Payload examples
smart_import.job.completed
{
"job_id": "job_abc123",
"user_id": "user_456",
"status": "completed",
"result": { "rows": 100, "columns": 5 },
"duration_ms": 2500,
"timestamp": 1708407000
}smart_import.job.failed
{
"job_id": "job_abc123",
"user_id": "user_456",
"status": "failed",
"error": "Invalid CSV format",
"error_code": "INVALID_FORMAT",
"retry_count": 3,
"timestamp": 1708407000
}smart_import.import.validation_failed
{
"job_id": "job_abc123",
"user_id": "user_456",
"error_type": "validation_error",
"validation_errors": [
{ "field": "email", "message": "Invalid email format", "value": "not-an-email" }
],
"timestamp": 1708407000
}Verifying signatures
Every delivery is signed by Svix. Verify the signature before processing the payload to ensure requests are genuinely from PasteAnything and have not been tampered with.
Always verify the signature. Skip verification only during local development.
Node.js (using the svix package)
import { Webhook } from "svix";
const WEBHOOK_SECRET = process.env.SVIX_WEBHOOK_SECRET; // from Svix dashboard
app.post("/webhooks/paste-anything", express.raw({ type: "application/json" }), (req, res) => {
const wh = new Webhook(WEBHOOK_SECRET);
let payload;
try {
payload = wh.verify(req.body, {
"svix-id": req.headers["svix-id"],
"svix-timestamp": req.headers["svix-timestamp"],
"svix-signature": req.headers["svix-signature"],
});
} catch (err) {
return res.status(400).send("Invalid signature");
}
// Safe to process
console.log(payload.type, payload);
res.status(200).send();
});Delivery & retries
Automatic retries
Svix retries failed deliveries with exponential back-off over 5 days.
Idempotency
Each event has a unique ID. Use the "svix-id" header to deduplicate retries.
Return 2xx quickly
Respond with a 2xx status within 30 seconds. Process the payload asynchronously.