Realtime SSE
The Realtime SSE endpoint allows you to receive live job progress updates as your bulk validation job is being processed.
Instead of polling the /status endpoint repeatedly, you can subscribe to a streaming connection and receive updates the moment they occur.
This is ideal for dashboards, progress bars, admin tools, and long-running list validations.
1. Endpoint
GET /api/v1/jobs/{job_id}/stream
This endpoint opens a Server-Sent Events (SSE) stream.
The connection remains open until:
The job is completed
The job fails
The client closes the stream
A network interruption occurs
Authentication (Required)
2. How SSE Works
When you connect to the stream, the server sends events such as:
status → job progress update
error → processing issue or job failure
Example event:
3. JavaScript Browser Example (EventSource)
⚠️ Note:
Browsers do not support custom headers in EventSource.
If your API requires Authorization headers, you must:
Use a backend proxy
ORSwitch to Axios / custom SSE clients in Node.js
4. Node.js Server Example (eventsource package)
5. Event Types
status
Emitted when job progress updates.
Example:
error
Emitted when the job encounters an issue.
Example:
6. Frequency & Behavior
Updates are sent every 1 second during processing
The connection automatically closes when:
Status =
completedStatus =
failed
Clients should implement reconnection logic if needed
7. Example of Full SSE Event Series
At the end of the job, you can:
Fetch paginated results using
/resultsDownload the file using
/download
8. Common SSE Errors
401 Unauthorized
404 Job Not Found
Job Failure Event
9. Best Practices
Use SSE instead of polling for better efficiency
Close the connection after job completes
Show progress bars using
processed_count&total_emailsFor large dashboards, avoid opening too many SSE connections
Use Node.js if you need custom headers in SSE
Always fallback to
/statusif SSE fails