Count distinct users with recorded activity in each bucket. Use this report for your Telegram subscription bot or Discord subscription bot project.
GET /v2/projects/ {project_id} /analytics/active-users CopyTry it Authorization Bearer API Key Required
API key scope: analytics:charts:read for restricted keys. Unrestricted project keys also support this endpoint.
Query Parameters First UTC calendar day, YYYY-MM-DD; default to minus 29 days.
Last UTC calendar day inclusive, YYYY-MM-DD; default today.
day (default), week (ISO Monday start), or month (calendar).
Dates must be real calendar days between 2000-01-01 and 2099-12-31, with from no later than to and at most 366 days inclusive. Unknown query parameters are rejected. There is no request body. See the shared analytics date, money, and cache rules .
Activity is retained for 40 days. A bucket beginning before the retained coverage has null counts and coverage pruned; do not display it as zero. Week and month counts are distinct users, not sums of daily counts. Loss days mark incomplete recording and can reduce reported activity.
curl "https://api.botsubscription.com/v2/projects/11111111-1111-4111-8111-111111111111/analytics/active-users?from=2026-09-07&to=2026-09-20&interval=week" \
-H "Authorization: Bearer YOUR_API_KEY" Report with unrestricted project key application/json
{
"ok" : true ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/active-users" ,
"code" : 200 ,
"data" : {
"period" : {
"from" : "2026-09-07" ,
"to" : "2026-09-20" ,
"interval" : "week" ,
"timezone" : "UTC" ,
"generated_at" : "2026-10-20T09:30:00.000Z"
},
"buckets" : [
{
"bucket" : "2026-09-07" ,
"start" : "2026-09-07" ,
"end" : "2026-09-13" ,
"partial" : false ,
"coverage" : "pruned" ,
"distinct_active_users" : null ,
"loss_days" : null ,
"incomplete" : true
},
{
"bucket" : "2026-09-14" ,
"start" : "2026-09-14" ,
"end" : "2026-09-20" ,
"partial" : false ,
"coverage" : "retained" ,
"distinct_active_users" : 41 ,
"loss_days" : 1 ,
"incomplete" : true
}
],
"disclosures" : {
"cache_ttl_seconds" : 120 ,
"timezone" : "UTC" ,
"coverage_from" : "2026-09-11" ,
"retention_days" : 40 ,
"distinct_per_bucket" : true ,
"loss_days" : [
"2026-09-16"
]
}
}
} UNAUTHORIZED application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/active-users" ,
"code" : 401 ,
"error" : {
"error_code" : "UNAUTHORIZED" ,
"message" : "Invalid or expired authentication token."
}
} FORBIDDEN application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/active-users" ,
"code" : 403 ,
"error" : {
"error_code" : "FORBIDDEN" ,
"message" : "Access is not permitted."
}
} VALIDATION_ERROR application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/active-users" ,
"code" : 422 ,
"error" : {
"error_code" : "VALIDATION_ERROR" ,
"message" : "Invalid request parameters."
}
} TOO_MANY_REQUESTS application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/active-users" ,
"code" : 429 ,
"error" : {
"error_code" : "TOO_MANY_REQUESTS" ,
"message" : "Too many requests. Please try again later."
}
} Invalid calendar day application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/active-users" ,
"code" : 422 ,
"errors" : [
{
"message" : "query: from Not a valid calendar date." ,
"error_code" : "VALIDATION_ERROR"
}
]
} Use the project API authentication reference for API-key setup.