Skip to content

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:

FieldDescription
agentsActive agents in the account
teamsTeams configured in the account
sessionsTotal user sessions (excludes INTERNAL/DEBUG)
entitiesExtracted entities across all sessions
entity_typesEntity type schemas configured
toolsCustom tools configured
knowledge_sourcesKnowledge sources (active + inactive)
traitsTraits (account-owned only)
chat_themesChat themes (including default)
agent_linksAgent links (shareable chat/conversation links, incl. printed-QR redirects)
scheduled_tasksRecurring scheduled tasks
automationsEvent listener automations
domainsDomains 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.