Skip to main content

Analytics API

Read what the assistant cost and what people did with it. There is no /analytics router: the numbers come from two surfaces, /token-usage for model spend and /activity for interactions. Paths are relative to the base URL described in Authentication, and every call carries Authorization: Bearer <token>.

Token usage​

The caller's own rows​

curl 'https://api.appilot.space/token-usage/user?start_date=2026-01-01&limit=50' \
-H 'Authorization: Bearer <token>'

Query parameters:

ParameterTypeDescription
domainstringFilter by domain
app_idnumberFilter by application
sourcestringOne of extension, backoffice, platform-admin
providerstringOne of openai, gemini
modelstringFilter by model id
operationstringFilter by operation type
start_date, end_datestringISO date, YYYY-MM-DD, expanded to cover the whole day
page, limitnumberPagination, default page 1 and limit 50, limit capped at 100

The source and provider filters take a closed list and drop anything else silently rather than answering 400. Rows recorded for a provider outside that list, DeepSeek among them, are returned by an unfiltered call but cannot be selected with provider=.

Response:

{
"success": true,
"data": [
{
"id": 1,
"user_id": 1,
"organization_id": 1,
"domain": "example.com",
"source": "extension",
"provider": "deepseek",
"model": "deepseek-chat",
"operation": "chat",
"prompt_tokens": 150,
"completion_tokens": 200,
"total_tokens": 350,
"cost_usd": 0.0,
"created_at": "2026-01-15T10:00:00.000Z"
}
],
"pagination": { "page": 1, "limit": 50, "total": 100, "totalPages": 2 }
}

Aggregates​

EndpointReturns
GET /token-usage/user/statsThe caller's totals, plus a byPeriod series (period query parameter: day, week, month) and a byDomain breakdown
GET /token-usage/organizationThe organization's rows and its aggregate. Requires an active organization context, otherwise 400
GET /token-usage/statsThe organization's aggregate on its own, without the rows
GET /token-usage/domain/:domainRows and aggregate for one domain. URL-encode the domain

Aggregate bodies use the same field names throughout: total_tokens, prompt_tokens, completion_tokens, total_cost_usd, count.

curl 'https://api.appilot.space/token-usage/user/stats?period=week' \
-H 'Authorization: Bearer <token>'
{
"success": true,
"aggregated": {
"total_tokens": 50000,
"prompt_tokens": 30000,
"completion_tokens": 20000,
"total_cost_usd": 0.15,
"count": 100
},
"byPeriod": [
{ "period": "2026-01-15", "total_tokens": 5000, "count": 10 }
],
"byDomain": [
{ "domain": "example.com", "total_tokens": 25000, "count": 50 }
]
}

Activity data​

The caller's own activity​

EndpointReturns
GET /activityTimeline. Query: limit, start_date, end_date, metric_type
GET /activity/statsEvent counts by type and by domain
GET /activity/recentThe most recent events, limit defaults to 50
GET /activity/analyticsTime series. Query: period (day, week, month, year), start_date, end_date
curl 'https://api.appilot.space/activity/analytics?period=day' \
-H 'Authorization: Bearer <token>'
{
"success": true,
"period": "day",
"data": {
"metrics": [
{ "date": "2026-01-15", "hour": 10, "xAxisKey": 10, "conversations": 5, "actions": 2 }
],
"summary": {
"period": "day",
"totalPoints": 24,
"totalConversations": 120,
"totalActions": 48,
"avgConversations": 5.0,
"avgActions": 2.0
}
},
"count": 24
}

The two series are conversations (assistant_query) and actions (action_executed).

Organization activity​

GET /activity/organization, /activity/organization/stats, /activity/organization/recent and /activity/organization/assistant-queries return what other members did, so they require the org admin role. A member without it gets 403 with code ORG_ADMIN_REQUIRED. A valid token is not a tenancy check.

/activity/organization accepts limit, start_date, end_date, metric_type, app_id and domain. /activity/organization/assistant-queries accepts limit, offset and has_actions, and is the endpoint behind the question list in the Backoffice.

What activity does not contain​

This measures Appilot, not browsing. Appilot records what a user does with the assistant and nothing about where they go otherwise, so there is no visited-page series to return. page_visit, search_performed, form_interaction and domain_visit were retired in September 2026 and are refused at ingest with 410 and code ACTIVITY_TYPE_RETIRED. Historical rows keep those values and still render. See Privacy.

Knowledge gaps​

There is no coverage-scoring endpoint. Where the knowledge base falls short is read from two places instead: GET /knowledge/requests lists the gaps users flagged themselves (see the Knowledge API), and GET /activity/organization/assistant-queries lists what was actually asked, so an unanswered topic shows up as a cluster of questions with no matching article.