How Webhooks Work
When you submit a request to the Helios API:- You receive an immediate response with a
runId - Analysis runs in the background (5-8 minutes for Light Agent, 10-13 minutes for Deep Agent, 3-6 minutes for Lab Results Agent)
- Results are delivered to your
webhookUrlvia HTTP POST - Your endpoint should return
200 OKto acknowledge receipt
Webhook Headers
Every webhook includes these headers for security and tracking:Webhook Payloads
Success Payload (Light Agent)
When Light Agent analysis completes successfully:Success Payload (Deep Agent)
Deep Agent responses include additional research task information:Success Payload (Lab Results Agent)
Lab Results Agent responses include the analyzed labs and metadata:Lab Results Agent does not include
selectedElements since all provided labs are analyzed directly. Instead, it includes labResults (the labs that were analyzed) and metadata with processing statistics.Error Payload
When analysis fails:Status Update Payload
During processing, you receive status updates at each step:sequenceNumber field is a monotonically increasing number that allows you to order webhooks correctly. Webhooks may arrive out of order due to network conditions, but you can sort them by sequenceNumber to reconstruct the correct sequence. The timestamp field can also be used as a fallback for ordering.
Processing Steps
The following steps are sent during processing: Light Agent Steps:
Deep Agent Steps:
Steps 1-4 are sent by the initial API server. Steps 5-8 and the final result are sent by the Deep Agent research processor. This architecture allows the Deep Agent to run for up to 16 minutes without timeout constraints.
Error Codes
Signature Verification
Verification Steps
- Get the raw request body - Use the raw body string, not parsed JSON
- Check the timestamp - Reject webhooks older than 5 minutes
- Compute the expected signature -
sha256=HMAC-SHA256(webhook_secret, raw_body) - Compare signatures - Use timing-safe comparison
Implementation Examples
Retry Policy
Helios retries failed webhook deliveries with exponential backoff:
After 3 failed attempts, the webhook is logged but not retried further.
Best Practices
Return 200 quickly
Return 200 quickly
Process webhooks asynchronously. Return
200 OK immediately, then handle the data in a background job.Handle duplicates
Handle duplicates
In rare cases, you may receive the same webhook twice. Use the
runId to deduplicate:Order webhooks correctly
Order webhooks correctly
Webhooks may arrive out of order due to network conditions. Use the The
sequenceNumber field to sort them correctly:sequenceNumber starts at 1 and increments for each webhook sent during a run. The final completed or error webhook will have the highest sequenceNumber.Log webhook events
Log webhook events
Log all incoming webhooks for debugging and audit purposes. Store the
runId, status, and timestamp.Use HTTPS
Use HTTPS
Your webhook endpoint must use HTTPS in production. Self-signed certificates are not supported.
Getting Your Webhook Secret
Your webhook secret is used to verify webhook signatures and ensure requests are authentic. To generate your webhook secret:- Log in to your Helios Dashboard
- Go to Settings (API Keys page)
- In the Webhook Secret section, click Generate Secret
- Copy and securely store the secret—it will only be shown once
Next Steps
EHR Agent
Full EHR Agent request and response reference.
Lab Results Agent
Full Lab Results Agent request and response reference.
API Overview
Shared concepts: auth, errors, privacy.
Dashboard
View your API usage and logs.