Ambient Sync
Every ambient badge surface in one cheap round trip (TOS-3494).
Replaces the ambient half of the always-on GET /api/me/events stream. That stream is a held HTTP request, and Cloud Run bills request-based CPU at 9.6x the idle rate for the whole time any request is in flight, so an open-but-silent stream costs the same as hard compute. Measured 2026-08-22: 563 streams x 228s mean = 128,394 request-seconds/day, 51% of all billable instance time on awen-api, overwhelmingly from tabs nobody was looking at.
Why ONE endpoint rather than four polls. The four ambient surfaces (nav unread badge, notification bell, agents "needs review" badge, chat sidebar) each have a perfectly good REST endpoint already. Polling all four costs four auth passes, four get_db sessions and four middleware traversals per tick, and the measured floor for any request here is ~0.25-0.6s regardless of how trivial its work is. Consolidating is roughly a 3x saving on top of the ~30x from not holding the stream open. constraint-intelligence runs the unconsolidated version (3-5 sequential round trips per tick) and lists it as a known defect; this is the fixed shape, not a port of theirs.
since is optional. Omitted, this is a bootstrap returning current state with no changed_chat_ids. Supplied, changed_chat_ids carries chats whose activity moved since then. The comparison is >= (matching the existing activity_since filter on GET /api/chats), so the boundary chat can repeat across consecutive polls; consumers must treat the list as a set of "refetch this" hints and not as an append log.
Sends ETag/304. The overwhelmingly common outcome is that nothing changed, and a 304 skips the response body: FastAPI clears it for any status that may not carry one, so the wire form is a bodiless, Content-Length-less 304 per RFC 7232. It does NOT skip serialization - the payload is still encoded and then discarded - and it does NOT skip the queries below, which is deliberate: a cheaper "has anything changed" probe would need its own high-water-mark column, and each query here is already indexed and cheap. Revisit only if measurement says these queries, rather than the request floor, are the cost.
Request
- Base URL: https://app.thinqos.com (the document declares no server; this is the origin it was published from)
- URL: https://app.thinqos.com/api/me/sync
- Auth: none declared
Query parameters
Headers
Response
Successful Response
Changes
No recorded changes to this operation across all 3 revisions of this API.