Why webhook‑triggered tests?
Part of Avido’s secret sauce is that you can kick off a test without touching your code.Instead of waiting for CI or redeploys, Avido sends an HTTP
POST to an endpoint that you control.
| Benefit | What it unlocks |
|---|---|
| Continuous coverage | Run tests on prod/staging as often as you like and automated. |
| SME‑friendly | Non‑developers trigger & tweak tasks from the Avido UI. |
How it works
- A test is triggered in the dashboard or automatically.
- Avido POSTs to your configured endpoint.
- Validate the
signature+timestampwith our API/SDK. - Run your LLM flow using
promptfrom the payload. - Emit a trace that includes
testIdto connect results in Avido.
Using OpenTelemetry? Set theavido.test.idspan attribute instead — see the OpenTelemetry guide. - Return
200 OK– any other status tells Avido the test failed.
Validating a webhook with the API requires both
x-api-key and x-application-id
headers. Use the application ID that issued the API key.Payload example
When Avido triggers your webhook endpoint, it sends:Webhook payload
| Header | Purpose |
|---|---|
x-avido-signature | HMAC signature of the payload |
x-avido-timestamp | Unix ms timestamp (in milliseconds) the request was signed |
testIdis always included in webhook payloads and is unique per test run. Pass it to youringest.create()call so the trace is linked to the Avido test.metadatais optional and only included when available from the originating task.- The webhook body may contain additional fields beyond those shown above. For example, experiment-related data is included when tests are part of an experiment. Do not assume a fixed schema — always handle unknown fields gracefully.
You do not need to set
traceId when responding to a webhook. The server generates one automatically. If you do set it, use a random UUID — do not reuse the testId as the traceId. See the Tracing guide for details.Always validate the raw body. The HMAC signature is computed over the exact JSON payload sent by Avido. You must forward the raw, unmodified request body to the
/v0/validate-webhook endpoint (or use it directly when verifying the signature). If you parse and re-serialize the body, differences in key ordering or whitespace can cause signature verification to fail.Verification flow
If validation fails, respond 401 (or other 4xx/5xx). Avido marks the test as failed.Body validation best practices
The webhook body is not a fixed schema. While the most common fields areprompt, testId, and metadata, the payload may include additional fields at any time (for example, experiment data when a test is part of an experiment). Your endpoint should:
- Accept any valid JSON body — do not reject requests that contain unknown fields.
- Forward the entire raw body for signature validation — the HMAC signature covers every field in the payload. If you strip, rename, or re-order fields before calling
/v0/validate-webhook, the signature check will fail. - Read only the fields you need after validation succeeds — safely ignore fields you don’t recognize.
When using a framework that automatically parses JSON (e.g., Express, Flask, FastAPI), pass the parsed object directly to the validation endpoint or SDK method. Avoid manually re-serializing it, as subtle differences (key order, whitespace) can break signature verification.
Code examples
SDK method reference
validateWebhook.validate()
Verifies that an incoming webhook request was signed by Avido.
| Parameter | Type | Description |
|---|---|---|
signature | string | The x-avido-signature header value |
timestamp | string | The x-avido-timestamp header value |
body | object | The full webhook request body (parsed JSON) |
valid boolean field.
Experiments
When a test is triggered as part of an experiment, the webhook payload includes an additionalexperiment field. Experiments let you compare different configurations (variants) of your LLM pipeline against a baseline, and the experiment field tells your application which overrides to apply.
Experiment payload
Webhook payload with experiment
| Field | Type | Description |
|---|---|---|
experiment.experimentId | string (uuid) | Unique identifier for the experiment |
experiment.experimentVariantId | string (uuid) | Unique identifier for the variant being tested |
experiment.overrides | Record<string, Record<string, unknown>> | Configuration overrides keyed by inference step name (e.g. response_generator, classifier). Each step’s value is an object of parameter overrides (e.g. temperature, system, model) |
overrides object tells you what to change: each key is a step name, and each value contains the specific settings to overwrite for that step.
For example, if overrides contains { "response_generator": { "temperature": 0.3 } }, you should use 0.3 as the temperature for your response_generator step instead of whatever your default is — and keep all other settings as-is.
Using experiments in your application
When your webhook handler receives a payload withexperiment, apply the overrides to the corresponding steps in your LLM pipeline:
You don’t need to change your trace ingestion code. The
testId already links the trace back to the correct experiment variant in Avido. Just pass body.testId as usual.If your application doesn’t run experiments yet, you can safely ignore the
experiment field — its presence is optional and your existing webhook handler will continue to work without changes.Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Signature always invalid | Body was re-serialized before validation | Pass the parsed JSON object directly; don’t JSON.stringify it first |
| Missing signature header | Framework strips custom headers | Check your reverse proxy / load balancer isn’t dropping x-avido-* headers |
| Test shows as failed | Endpoint returned non-200 status | Ensure you return 200 OK after successful processing |
| Trace not linked to test | Missing testId in ingestion | Pass body.testId in your ingest.create() call |
| Experiment overrides not applied | experiment field ignored in handler | Check for body.experiment and apply overrides to your pipeline config before running the LLM call |
Next steps
- Send us Trace events to capture your full LLM workflow.
- Using OpenTelemetry? See the OpenTelemetry Integration guide.
- Schedule or trigger tasks from Tasks in the dashboard.
- Invite teammates so they can craft evals and review results directly in Avido.