Aggregate agent connection counters
Returns tenant-scoped aggregates of connection state for the
Agents dashboard summary cards. The response groups the
agent_instances rows by deployment_mode, connection_status,
and transport.
The underlying query hits the
(tenant_id, connection_status) index added in migration 074,
so response time is independent of fleet size for a single
tenant.
Scope rules:
- Non-super callers: always scoped to the caller’s tenant;
body.tenant_idis silently ignored. - Super-admins: pass
tenant_idto scope to a single tenant, or omit it to aggregate globally across all tenants. agent_type(optional, both roles) narrows to a single fleet.
POST
Aggregate agent connection counters
Body
application/json
Scope filters for POST /agents/get_connection_stats. Both fields are optional. With none set, stats cover the caller's entire tenant.
Response
Aggregated connection counters for the scope.
