DocumentationBuild. Deploy. Operate.
DocsQSCSCore HTTP API

Responses, Errors & Outages

On this page 14 sections

Status codes and error handling

There is no single error envelope for every QSCS response. Parse by HTTP status, Content-Type and endpoint. Core can return JSON, plain text or an empty body; upstream applications keep their own error formats.

200 and authentication results

ResponseInterpretation
200 application/json from login/logoutRead ok. A false value is failure even though HTTP succeeded.
200 from identity status/federationRead the lookup fields. Status discovery is not authorization proof.
200 with X-QSCS-Mode: headlessSaved fallback content; origin may still be unavailable.
200 text/plain with ok for an unregistered hostHealth fallback; not proof the requested route exists.
200 text/event-streamProcess SSE frames, heartbeats and reconnects; not a single JSON object.

3xx and conditional responses

Upstream redirects preserve Location. A conditional GET /auth/status with a matching If-None-Match returns 304 with no body; reuse the corresponding previously obtained status representation. Other eligible conditional public responses can also return 304. A negotiated empty nochange delta remains HTTP 200.

4xx

CodeSource / action
400Incomplete/oversized headers, malformed request, missing Host, or an unsupported method at the listener method check. Often text/plain.
401Protected route rejected missing, unknown, expired, replayed or invalid identity proof. Core body: {"error":"not authenticated"}. It does not expose the exact signature failure.
403Application or public-edge denial. Check account permissions; do not assume all 403 responses come from Core.
404Remote access to /qscs/metrics or an upstream missing resource. An unknown identity UUID is instead reported in HTTP 200 JSON.
421The interpreter rejected an invalid domain-style Host on its routing path.

5xx

CodeSource / action
502No origin for an application POST, peer/transport failure, or an unusable reconstructed peer state. May be plain text.
503Origin unavailable with no safe fallback; POST unavailable; worker/payload capacity exhausted; stream capacity exhausted; or a missing packaged runtime file. Inspect body and headers.
504A timed-out peer request on the remote transport path. Not an age-expiry signal for the current generic HEADLESS cache.
Upstream 5xxApplication failure forwarded through its delivery path. A completed HTTP error response does not itself prove a connection-level outage.

Example error bodies

JSON — login failure, HTTP 200

{"ok":false,"error":"authentication failed"}

JSON — protected request, HTTP 401

{"error":"not authenticated"}

JSON — stream capacity, HTTP 503 and Retry-After: 2

{"error":"stream_busy","retry":true}

Plain text — API payload capacity, HTTP 503 and Retry-After: 2

API state busy; retry shortly

An overloaded listener may return plain text QSCS: workers exhausted or an empty 503. Generic fallback errors use plain text. The structured POST outage shape is documented in Responses, Errors & Outages.

Retry and recovery

  1. Check transport success, HTTP status and media type. Do not call a JSON parser on every failed response.
  2. Check authentication JSON ok explicitly. Correct invalid inputs; do not retry rejected credentials automatically.
  3. For transient reads, honour Retry-After if present and use bounded backoff. Every signed retry needs a fresh timestamp and nonce.
  4. For a federated 401/403, check the issuer account first. Keep a valid issuer session while reporting a recipient resource failure.
  5. For writes with an uncertain outcome, reconcile state or use application idempotency before resubmitting. retry:true does not mean the operation was unexecuted or safe to replay.
  6. Keep the current key until signed logout is confirmed. A network error does not revoke a binding.

Outage response contract

HEADLESS can serve an eligible saved representation when an origin cannot be reached. It does not guarantee a response for every URL, preserve a valid identity indefinitely or queue writes. Distinguish fallback reads from failed application operations using status, Content-Type and the reason header.

When fallback applies

A failed live attempt can trigger fallback before the origin is classified degraded. Current health constants mark degradation after 10 consecutive failures and recovery after two consecutive successes; background probes run about every 10 seconds. These are implementation settings, not client retry timers.

Cookie-bearing, Authorization-bearing and header-selected application GETs attempt the live origin and return a non-cacheable error if it is unavailable; they must not receive an unrelated anonymous document. Identity verification still applies before a protected read. Explicit federated response caching has its own account and policy checks.

Eligible cached GET

Example HTTP response — selected headers

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
X-QSCS-Mode: headless
X-QSCS-Headless-Age: 42
X-QSCS-Headless-Reason: served

<cached body>

The current generic fallback accepts a valid cached payload up to 10 MiB. It has no age-based expiry ceiling: inspect the age and surface stale state where freshness matters. Entries remain subject to cache capacity and validity. HTTP 200 in this mode does not mean the origin is healthy.

Unavailable cached GET

Status / reasonMeaning
200 / servedEligible saved representation returned.
503 / origin_unreachableNo cache entry is available after origin failure.
503 / invalid_cacheEntry exists but is invalid or unsuitable for generic fallback.
503 / oversizedFallback payload exceeds the size ceiling.
503 / no_cacheListener has no response-cache service configured.

Generic fallback errors use text/plain. The historical ttl_expired and bootstrap reason names remain in the implementation but are not emitted by the current generic evaluator; do not build retry logic around them.

Application-specific GET unavailable

Example HTTP response — selected headers

HTTP/1.1 503 Service Unavailable
Content-Type: application/json
Cache-Control: no-store
X-QSCS-Mode: passthrough
X-QSCS-Headless-Reason: application_request_unavailable

{"error":"upstream_unavailable","retry":true,"reason":"application_request_unavailable"}

POST unavailable

Example HTTP response — selected headers

HTTP/1.1 503 Service Unavailable
Content-Type: application/json
X-QSCS-Mode: headless
X-QSCS-Headless-Reason: post_soft_fail

{"error":"upstream_unavailable","retry":true,"reason":"origin_unreachable","host":"app.example.com","uri":"/api/checkout"}
FieldTypeMeaning
errorstringupstream_unavailable
retrybooleantrue indicates a potentially recoverable service failure; it does not establish that replaying a write is safe.
reasonstringorigin_unreachable on the current POST failure path.
hoststringRequested public origin.
uristringRequested path and query.

Client handling

  1. For an eligible stale GET, show the saved state with its age where appropriate.
  2. For unavailable reads, keep the last verified view separate from the error, and retry with bounded backoff and fresh signatures. Honour Retry-After when present.
  3. For a failed write, show that completion is unconfirmed. The origin may have processed the operation before the response was lost. Reconcile with an operation-status read or an application-defined idempotency key before resubmitting.
  4. Do not display “saved”, silently replay a write, or treat an outage as successful logout. Complete signed revocation when connectivity returns.

QSCS does not provide a generic write outbox or application idempotency store. Those behaviours belong to your application protocol.

Need a hand with your deployment?Contact support ↗Back to top ↑