Skip to main content
The query API powers Tell’s analytics. Use it to fetch active users, events, sessions, logs, and stickiness metrics — with breakdowns, comparisons, and raw drill-down. All endpoints require a JWT token and X-Workspace-ID header:
curl "https://your-tell-server/api/v1/metrics/dau?range=30d" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-ID: ws_abc123"

Active users

Track daily, weekly, and monthly active users:
# Daily active users, last 30 days
curl "https://your-tell-server/api/v1/metrics/dau?range=30d"

# Weekly active users, broken down by country
curl "https://your-tell-server/api/v1/metrics/wau?range=90d&breakdown=country"

# Monthly active users, compared to previous period
curl "https://your-tell-server/api/v1/metrics/mau?range=30d&compare=previous"
EndpointMetric
/metrics/dauDaily active users
/metrics/wauWeekly active users
/metrics/mauMonthly active users
Each endpoint also has a /raw variant (e.g. /metrics/dau/raw) that returns the underlying user-level data with pagination.

Events

# Event volume over time
curl "https://your-tell-server/api/v1/metrics/events?range=30d&granularity=daily"

# Top events by count
curl "https://your-tell-server/api/v1/metrics/events/top?range=7d"

# Break down an event by a property
curl "https://your-tell-server/api/v1/metrics/events/properties?event=purchase&property=plan&range=30d"

# Custom aggregation — total revenue
curl "https://your-tell-server/api/v1/metrics/events/custom?event=purchase&property=amount&metric=sum&range=30d"
EndpointWhat it returns
/metrics/eventsEvent count over time
/metrics/events/topMost frequent events ranked by count
/metrics/events/top/{name}/rawRaw data for a specific event
/metrics/events/propertiesProperty breakdown (requires event and property params)
/metrics/events/customAggregation on a property — sum, avg, min, max, count
/metrics/events/rawRaw event data

Sessions

# Session volume
curl "https://your-tell-server/api/v1/metrics/sessions?range=30d"

# Top sessions by device type
curl "https://your-tell-server/api/v1/metrics/sessions/top?range=30d&property=device_type"

# Unique sessions
curl "https://your-tell-server/api/v1/metrics/sessions/unique?range=30d"

Logs

# Log volume over time
curl "https://your-tell-server/api/v1/metrics/logs?range=7d"

# Top logs by level
curl "https://your-tell-server/api/v1/metrics/logs/top?range=7d"

# Filter by service and level
curl "https://your-tell-server/api/v1/metrics/logs/raw?service=api&level=error&range=7d"
Log-specific filters: service, level, source.

Users and stickiness

# User count over time
curl "https://your-tell-server/api/v1/metrics/users?range=30d"

# Daily stickiness (DAU/MAU ratio)
curl "https://your-tell-server/api/v1/metrics/stickiness/daily?range=30d"

# Weekly stickiness (WAU/MAU ratio)
curl "https://your-tell-server/api/v1/metrics/stickiness/weekly?range=30d"

Common parameters

Most metric endpoints share these query parameters:
ParameterDefaultOptions
range30d7d, 30d, 90d, or custom: 2025-01-01,2025-01-31
granularitydailyminute, hourly, daily, weekly, monthly
breakdownAny dimension: country, platform, device_type, os, etc.
compareprevious (previous period) or yoy (year-over-year)
conditions[N][field]Filter conditions (see Filtering)
Raw endpoints add pagination:
ParameterDefaultDescription
limit100Max rows returned
offset0Skip rows for pagination
count_totalfalseInclude total count (slower)

SQL queries

For full flexibility, execute SQL directly against your analytics data. Rate-limited to 30 requests per minute.
curl -X POST https://your-tell-server/api/v1/data/query \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-ID: ws_abc123" \
  -H "Content-Type: application/json" \
  -d '{"query": "SELECT event, count() as cnt FROM events_v1 GROUP BY event ORDER BY cnt DESC LIMIT 10"}'
Returns:
{
  "columns": [
    { "name": "event", "data_type": "String" },
    { "name": "cnt", "data_type": "UInt64" }
  ],
  "rows": [
    ["page_view", 48210],
    ["click", 12503]
  ],
  "row_count": 2,
  "execution_time_ms": 42
}
Only SELECT statements are allowed. Queries are automatically scoped to your workspace database. Max 10,000 rows per query (default 1,000).

Data exploration

Discover what data is available before writing queries:
# List available data sources
curl https://your-tell-server/api/v1/data/sources \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-ID: ws_abc123"

# Get fields for a source
curl https://your-tell-server/api/v1/data/sources/events/fields \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-ID: ws_abc123"

# Get distinct values for a field
curl "https://your-tell-server/api/v1/data/sources/events/values/country?limit=20" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-ID: ws_abc123"

Available sources

SourceTableDescription
eventsevents_v1Custom events and page views
logslogs_v1Structured logs
contextcontext_v1Device and session context
user_traitsuser_traits_v1User properties set via identify
usersusers_v1Unique users
user_devicesuser_devicesDevice-to-user mappings

What’s next