Appearance
Stats ​
Lightweight endpoint for dashboard counts. Returns total counts for 13 resource domains in a single request, replacing 13 separate list fetches.
GET /api/v1/stats/counts ​
Returns item counts for all major resource domains of the authenticated account.
Authentication: Required (JWT or API Key)
Query Parameters: None
Response (DomainCounts):
json
{
"agents": 12,
"teams": 4,
"sessions": 1847,
"entities": 3241,
"entity_types": 8,
"tools": 15,
"knowledge_sources": 28,
"traits": 31,
"chat_themes": 6,
"agent_links": 19,
"scheduled_tasks": 4,
"automations": 3,
"domains": 3
}Field Details:
| Field | Description |
|---|---|
agents | Active agents in the account |
teams | Teams configured in the account |
sessions | Total user sessions (excludes INTERNAL/DEBUG) |
entities | Extracted entities across all sessions |
entity_types | Entity type schemas configured |
tools | Custom tools configured |
knowledge_sources | Knowledge sources (active + inactive) |
traits | Traits (account-owned only) |
chat_themes | Chat themes (including default) |
agent_links | Agent links (shareable chat/conversation links, incl. printed-QR redirects) |
scheduled_tasks | Recurring scheduled tasks |
automations | Event listener automations |
domains | Domains available for agent publication |
Errors:
401: Authentication required
Example:
bash
curl -X GET "https://api.gnosari.com/api/v1/stats/counts" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Use Case ​
The dashboard uses this endpoint to display resource counts in the sidebar and overview cards without loading full paginated lists. Call once on page load; re-fetch only when the user creates or deletes a resource.
javascript
// Dashboard initialization
const { data: counts } = await useFetch('/api/stats/counts')
// counts.agents → 12, counts.sessions → 1847, etc.