Stream case progress updates (SSE)
curl --request GET \
--url https://api.uk.veridox.ai/cases/{id}/progress/stream \
--header 'x-api-key: <api-key>'import requests
url = "https://api.uk.veridox.ai/cases/{id}/progress/stream"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.uk.veridox.ai/cases/{id}/progress/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uk.veridox.ai/cases/{id}/progress/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.uk.veridox.ai/cases/{id}/progress/stream"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.uk.veridox.ai/cases/{id}/progress/stream")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uk.veridox.ai/cases/{id}/progress/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"error_code": "request.cases.file.missing-risk-score",
"error_message": "User tried to perform an invalid operation on a file without a risk score.",
"error_details": {
"field": "email_address"
}
}{
"error_code": "request.cases.file.missing-risk-score",
"error_message": "User tried to perform an invalid operation on a file without a risk score.",
"error_details": {
"field": "email_address"
}
}Cases
Stream Case Analysis Progress
Receive real-time Server-Sent Events for case analysis progress updates.
GET
/
cases
/
{id}
/
progress
/
stream
Stream case progress updates (SSE)
curl --request GET \
--url https://api.uk.veridox.ai/cases/{id}/progress/stream \
--header 'x-api-key: <api-key>'import requests
url = "https://api.uk.veridox.ai/cases/{id}/progress/stream"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.uk.veridox.ai/cases/{id}/progress/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uk.veridox.ai/cases/{id}/progress/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.uk.veridox.ai/cases/{id}/progress/stream"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.uk.veridox.ai/cases/{id}/progress/stream")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uk.veridox.ai/cases/{id}/progress/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"error_code": "request.cases.file.missing-risk-score",
"error_message": "User tried to perform an invalid operation on a file without a risk score.",
"error_details": {
"field": "email_address"
}
}{
"error_code": "request.cases.file.missing-risk-score",
"error_message": "User tried to perform an invalid operation on a file without a risk score.",
"error_details": {
"field": "email_address"
}
}Establish a Server-Sent Events (SSE) connection to receive real-time progress updates during case analysis. This endpoint provides live streaming of analysis events including file processing stages, progress percentages, and completion notifications.
Network Restrictions: SSE streams may not be available on corporate or restricted networks due to proxy configurations, firewall rules, or man-in-the-middle (MITM) detection systems. If streaming fails, use the polling endpoint as a fallback.
Permission
You can follow a case you created, or any case in your organisation if you haveorganisation_cases:read; otherwise the API returns 404. Per-file events cover only the files you uploaded, and those uploaded through document requests into a case you created, unless you have organisation_files:read. Shared cases, if enabled for your organisation, also give you reach to every case and file. See Permissions and API Keys.
Event Types
The stream provides several event types to help you track progress:file.analysis.progress: Real-time updates on individual file processing stages.file.analysis.completed: Notification that a specific file has finished analysis.case.analysis.completed: Final event indicating the entire case is complete.heartbeat: Connection keep-alive signal.stream_closed: Indicates the stream has ended (e.g., if analysis was already finished).
Best Practices
- Reconnection Logic: Implement automatic reconnection with exponential backoff to handle transient network issues.
- Fallback Mechanism: Always detect SSE connection failures and automatically switch to polling.
- Resource Cleanup: Ensure connections are closed when the user leaves the progress screen or the analysis completes.
Authorizations
Path Parameters
Case ID
Query Parameters
API key for authentication (alternative to access_token)
Access token for JWT authentication
Response
Unauthorized (invalid or missing authentication token)
Machine-readable error code for programmatic handling
Examples:
"request.cases.file.missing-risk-score"
"request.authentication.invalid-token"
"request.forbidden"
"request.cases.case.not-found"
"request.cases.case.already-locked"
Human-readable error message explaining what went wrong
Example:
"User tried to perform an invalid operation on a file without a risk score."
Example:
{ "field": "email_address" }
Was this page helpful?
⌘I