BizHedge Docs
Platform

Public HTTP surfaces

The public product and integration surfaces exposed by BizHedge.

SurfacePurpose
HealthReports public application readiness without exposing private configuration.
AnalysisTranslates an owner outcome into one reasoned market relationship or an honest no-fit result.
SportsBuilds promotion positions and keeps them separate from ordinary business-risk analysis.
Market DemandPublishes safe, grouped evidence about missing markets.
Demand eventsRecords eligible product signals for later grouped publication.
Shared receiptsCreates a revocable, public-safe summary of one result.
Partner Demand APIProvides authenticated snapshots, changes, summaries and taxonomy.

Each surface has its own schema and allowlist. A successful response from one surface does not grant access to another.

Route and method matrix

Every route accepts a fixed method set and answers the rest with a structured 405 carrying an Allow header. All bodies are JSON except POST /api/analyze, which returns a Server-Sent Events stream (Content-Type: text/event-stream) of ordered stage events.

RouteMethodsAuthNotes
/api/healthGET, HEAD, OPTIONSnoneAlways 200; inspect the body for degraded.
/api/analyzePOST, OPTIONSserver-keyedSSE stream; optional owner-supplied key in the body only.
/api/sports-promosGET, HEAD, OPTIONSnoneBundled fallback when live data is unavailable.
/api/gap-demandGET, POST, OPTIONSnonePublic aggregate read; idempotent capture on POST.
/api/receiptsGET, POST, OPTIONSnonePublic-safe shared receipts; 503 before its migration.
/api/partner/v1/*GET, HEAD, OPTIONSbearerHeader-authenticated; no cross-origin browser access.

Operator and scheduled routes exist but are private and are not documented here. Unknown paths return a structured 404. HEAD mirrors GET headers with no body. OPTIONS follows each route's own CORS contract; a bare 204 without CORS headers does not authorize a browser.

Status codes

Responses are sanitized: no route returns a stack trace, database error, or credential detail.

StatusMeaning
200Success. May still carry a degraded or fallback body; read it.
202Optional capture or resumable refresh progress accepted; not a completion.
400Malformed request, or a credential supplied in the query string.
401Missing or invalid bearer token. Body is {"error":"unauthorized"} with no detail.
403Fails closed: required server configuration is absent.
404Unknown path.
405Unsupported method. Carries an Allow header.
409Partner sync checkpoint is stale; discard local state and take a new full snapshot.
429Per-IP rate limit exceeded.
503A persistence-backed surface is unavailable, sanitized.

Authentication

Partner, operator, and scheduled routes take a bearer token in the header only:

Authorization: Bearer <token>

Credentials in a query string are rejected with 400. The optional Analyze bring-your-own-key travels in the request body and is never logged, persisted, or returned. Tokens are compared with a constant-time check, and each credential class is a distinct secret of at least 32 bytes.

Origin policy

Each surface sets its own CORS contract. Public read-only health and Sports data are broadly readable. Analysis, Demand capture, and receipts accept same-host or explicitly allowlisted origins. Partner integration is header-authenticated and closed to cross-origin browser use entirely.

Availability is part of the contract

Some surfaces return a safe fallback; persistence-backed surfaces can report unavailability. A 200 health status can still carry a degraded body. Optional run capture can fail without changing the completed owner result. Private and authenticated surfaces fail closed when required configuration is absent.

Consumers must read the documented body state rather than infer readiness from a single status code.

On this page