Skip to main content
The OpenSRE backend serves one HTTP API (FastAPI, gateway/http/webapp.py). All routes live on a single port (default 8000). In production, always call the API over HTTPS — deploy behind a TLS-terminating load balancer (the backend is Terraform-managed, separately from this repo).

Authentication

The API has two auth schemes, matched to the caller:

Health

Alert intake

Queue an alert for background investigation (returns 202):
Bodies above 1 MiB are rejected with 413.

Synchronous investigation

Run an investigation inline and get the report in the response (slow — the request stays open for the full pipeline; prefer the async API behind load balancers):

Async investigations (Clerk-authenticated)

Enqueue and poll — the pattern web clients should use. Queued investigations are executed by a background worker in the web service; it is enabled by setting OPENSRE_INVESTIGATION_WORKER=1 (the Terraform deployment sets this). Records live in Postgres when DATABASE_URL is set, else in process memory. Reports are written to local disk first and uploaded to S3 when OPENSRE_ARTIFACTS_BUCKET is configured.
Investigations belong to the Clerk organization in the token; reading another organization’s investigation returns 404.

Status codes