Webhooks
Webhooks are HTTP callbacks that Roset sends to your application when processing events occur. Instead of polling the API to check if a file has finished processing, register a webhook endpoint and Roset will POST event payloads to it in real time.
This is the recommended way to react to processing completion in production applications.
Event Types
| Event | When it fires |
|---|---|
file.created | A new file record was created via upload |
file.processing.started | The extraction job began processing |
file.processing.completed | Extraction finished successfully and variants are available |
file.processing.failed | Extraction failed (check the job for error details) |
file.variant.ready | A new variant (markdown, embeddings) is available on the file |
file.deleted | A file and its variants were deleted |
connection.synced | A storage connection finished syncing metadata from the bucket |
Create a Webhook
Payload Format
Each delivery sends a JSON payload with an event type, timestamp, and event-specific data:
{
"id": "evt-123",
"type": "file.processing.completed",
"timestamp": "2025-06-15T10:30:00Z",
"data": {
"file_id": "abc-123",
"space": "default",
"filename": "report.pdf",
"status": "completed"
}
}Verify Signatures
Every webhook delivery includes an X-Roset-Signature header containing an HMAC SHA-256 signature of the request body. Use your webhook secret (returned when you created the webhook) to verify authenticity.
import crypto from 'crypto';
// Verify that the webhook payload was sent by Roset
function verifyWebhook(body: string, signature: string, secret: string): boolean {
const expected = crypto
.createHmac('sha256', secret)
.update(body)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected),
);
}Verify the signature on every webhook delivery to confirm it originated from Roset and was not tampered with in transit.
Retry Policy
Failed deliveries (non-2xx responses or timeouts) are retried up to 3 times with exponential backoff:
| Attempt | Delay |
|---|---|
| 1st retry | ~1 minute |
| 2nd retry | ~5 minutes |
| 3rd retry | ~30 minutes |
After 3 failed attempts, the delivery is marked as failed. You can view failed deliveries in the console or via the deliveries endpoint.
Manage Webhooks
Next Steps
- API Reference -- full webhook endpoint documentation.
- Storage Connections -- connect your cloud storage buckets.