The sidebar badge endpoint returns a synthesized summary for a company rather than a stored counter record.

Get Sidebar Badges

GET /api/companies/{companyId}/sidebar-badges
The route accepts either a company UUID or the company’s issue-prefix alias in {companyId}.

Response Semantics

  • The handler resolves the company, checks company access, and then computes the badge summary.
  • The returned object includes approvals, failedRuns, joinRequests, evaluationQueue, and inbox.
  • inbox is synthesized from the current badge buckets and alert conditions; it is not a separate persisted counter.

High-Level Buckets

FieldSource
approvalsActionable approval records in pending or revision_requested state
failedRunsLatest run state per agent when the latest run is failed or timed_out
joinRequestsPending join requests when the caller can approve joins
evaluationQueueLatest queue annotations that still need review
inboxCombined count used by the navigation chrome

Inbox Synthesis

The route adds the following into inbox:
  • actionable approvals
  • failed agent runs
  • pending join requests, when visible to the caller
  • a single alert bucket for agent errors when there are no failed runs
  • a single alert bucket for budget pressure when the company is at or above 80 percent of budget utilization
  • the evaluation queue count

Scope Notes

  • The company ID can be either a UUID or an issue-prefix alias.
  • The response is driven by current database state and company access.