Skip to main content
Helios delivers analysis results to your webhook URL asynchronously. This guide covers webhook payloads, signature verification, and best practices.

How Webhooks Work

When you submit a request to the Helios API:
  1. You receive an immediate response with a runId
  2. Analysis runs in the background (5-8 minutes for Light Agent, 10-13 minutes for Deep Agent, 3-6 minutes for Lab Results Agent)
  3. Results are delivered to your webhookUrl via HTTP POST
  4. Your endpoint should return 200 OK to 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:
Important: The 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.
Lab Results Agent Steps:

Error Codes

Signature Verification

Always verify webhook signatures in production to ensure requests are authentic and haven’t been tampered with.

Verification Steps

  1. Get the raw request body - Use the raw body string, not parsed JSON
  2. Check the timestamp - Reject webhooks older than 5 minutes
  3. Compute the expected signature - sha256=HMAC-SHA256(webhook_secret, raw_body)
  4. 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.
Your webhook endpoint should return a 2xx status code within 30 seconds to be considered successful.

Best Practices

Process webhooks asynchronously. Return 200 OK immediately, then handle the data in a background job.
In rare cases, you may receive the same webhook twice. Use the runId to deduplicate:
Webhooks may arrive out of order due to network conditions. Use the sequenceNumber field to sort them correctly:
The 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 all incoming webhooks for debugging and audit purposes. Store the runId, status, and timestamp.
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:
  1. Log in to your Helios Dashboard
  2. Go to Settings (API Keys page)
  3. In the Webhook Secret section, click Generate Secret
  4. Copy and securely store the secret—it will only be shown once
If you regenerate your webhook secret, the previous secret is immediately invalidated. Make sure to update your server configuration before regenerating.

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.