analytics33 ops

Analytics API

Earnings, performance metrics, and driver / merchant analytics.

Queries

QUERY

accountsByRole

#

Get distribution of accounts by role. Returns count and percentage of accounts for each role (Admin, Customer, Driver, Merchant, etc.)

Arguments

  • input!

    Default

    {
      "app": null
    }
Returns!
QUERY

activityDistribution

#

Get activity distribution (active vs inactive users). Shows breakdown of users by activity status based on configurable threshold.

Arguments

  • input!

    Default

    {
      "actorType": null,
      "app": null,
      "activityDays": 0
    }
Returns!
QUERY

adminDriverWeeklyTimesheet

#

Get a Monday–Sunday driver timesheet in the driver's operational time zone.

Arguments

  • accountId!
  • weekOf
Returns!
QUERY

cancellationBreakdown

#

Why the orders placed in a window were cancelled, and by whom.

Arguments

  • input!

    Default

    {
      "period": "LAST30_DAYS",
      "fromDate": null,
      "toDate": null,
      "kind": null
    }
Returns!
QUERY

countryDistribution

#

Get country distribution. Shows geographic breakdown of users by country.

Arguments

  • input!

    Default

    {
      "actorType": null,
      "app": null,
      "period": "LAST7_DAYS"
    }
Returns!
QUERY

customerMix

#

Customers who placed an order in a window, new against returning.

Arguments

  • input!

    Default

    {
      "period": "LAST30_DAYS",
      "fromDate": null,
      "toDate": null,
      "kind": null
    }
Returns!
QUERY

dispatchHealth

#

Operator dispatch-health analytics over all dispatched orders in the tenant. For the workspace's owner and for staff who may view reports: it is the Dispatch tab of the Taxi Insights page.

Arguments

  • input!
Returns!
QUERY

fleetPerformance

#

One row per driver for a window, with the fleet's totals. For the workspace's owner and for staff who manage drivers and may view reports.

Arguments

  • input!

    Default

    {
      "period": "LAST30_DAYS",
      "fromDate": null,
      "toDate": null,
      "sortBy": "EARNINGS",
      "descending": true,
      "pagination": null
    }
Returns!
QUERY

genderDistribution

#

Get gender distribution. Shows breakdown of users by gender (Male, Female, Other, Not Specified).

Arguments

  • input!

    Default

    {
      "actorType": null,
      "app": null,
      "period": "LAST7_DAYS"
    }
Returns!
QUERY

myEarningsChart

#

Get paginated earnings chart data for the authenticated driver. Returns one "page" of earnings data aligned to period boundaries: - WEEKLY: One week (Monday to Sunday) with daily data points - MONTHLY: One calendar month with daily data points - YEARLY: One calendar year with monthly data points Use endBefore cursor to navigate to older periods. Use includePreviousPeriod to get comparison data (earnings/rides change vs previous period). # Security This endpoint is scoped to the authenticated driver - drivers can only see their own data.

Arguments

  • input!
Returns!
QUERY

myPerformance

#

Get my performance metrics and trends Returns comprehensive performance data for the authenticated driver including: - All-time operational KPIs - Historical daily metrics for the specified period - Performance trends (recent 7 days vs previous 7 days) # Security This endpoint is scoped to the authenticated driver - drivers can only see their own data.

Arguments

  • periodDaysInt!

    Number of days of historical data to fetch

    Default

    30
Returns!
QUERY

orderAuditTrail

#

Discrete order lifecycle events with location snapshots (from PostgreSQL). Returns: - Lifecycle events (DriverAccepted, DriverArrived, RideStarted, …) from order_activities. - Per-driver dispatch offers (one entry per contacted driver) from dispatch_attempts, with the driver exposed as an Account reference. All entries are interleaved chronologically. Staff-only (admin-tier): it names every driver offered the ride, with their scores and distances.

Arguments

  • orderId!
Returns[!]!
QUERY

orderLocationTrail

#

Continuous GPS breadcrumb trail during an active order (from ClickHouse). Returns the full movement path of the driver, with computed total distance. Staff-only (admin-tier): the driver's live whereabouts are not the business of any other session in the tenant.

Arguments

  • orderId!
  • from
  • to
Returns!
QUERY

orderMetricsSummary

Deprecated#

Deprecation reason: Use orderMetricsSummaryWithDetails; BET-205

Arguments

  • input!

    Default

    {
      "kind": null,
      "period": "LAST7_DAYS",
      "fromDate": null,
      "toDate": null
    }
Returns!
QUERY

orderMetricsSummaryWithDetails

#

Get summary metrics for order dashboard cards. Returns 4 key metrics (total orders, total revenue, completion rate, average order value) with current values, comparison to previous period, and sparkline data for trend visualization. # Arguments * input - Query parameters including order kind filter, time period, and optional currency # Returns Summary of order metrics for dashboard display

Arguments

  • input
Returns!
QUERY

ordersByKind

Deprecated#

Get distribution of orders by kind. Returns breakdown of orders grouped by kind (Taxi, Shop, Parking, Service) with counts, percentages, and comparison to previous period. # Arguments * input - Query parameters including time period and whether to include revenue # Returns Order kind distribution with counts, percentages, and period comparison

Deprecation reason: Legacy Flutter-admin distribution; retain until supported-client and trace checks permit retirement; BET-222

Arguments

  • input!

    Default

    {
      "period": "LAST7_DAYS",
      "includeRevenue": false
    }
Returns!
QUERY

orderStatusDistribution

Deprecated#

Deprecation reason: Use orderStatusDistributionWithDetails; BET-205

Arguments

  • input!

    Default

    {
      "kind": null,
      "period": "LAST7_DAYS",
      "fromDate": null,
      "toDate": null
    }
Returns!
QUERY

orderStatusDistributionWithDetails

#

Get distribution of orders by status. Returns breakdown of orders grouped by status (Finished, DriverCanceled, RiderCanceled, etc.) with counts and percentages for each status. # Arguments * input - Query parameters including order kind filter and time period # Returns Order status distribution with counts and percentages

Arguments

  • input
Returns!
QUERY

orderVolumeByKind

#

Get order volume time series grouped by order kind. Returns time-bucketed order counts for each kind (Taxi, Shop, Parking, Service), along with aggregated totals and period-over-period comparisons. Ideal for rendering stacked area charts or line charts. The aggregation interval is automatically determined based on the period: - Today: hourly buckets - Last 7 days, Last 30 days, This month, Last month: daily buckets - This year: monthly buckets # Arguments * input - Query parameters including time period, kind filter, and optional custom dates # Returns Order volume time series with per-kind breakdown and aggregated totals

Arguments

  • input!

    Default

    {
      "period": "LAST7_DAYS",
      "kinds": null,
      "currency": null,
      "fromDate": null,
      "toDate": null
    }
Returns!
QUERY

platformExpenseBreakdownHistory

#

Get expense breakdown by category over time. Groups expenses by category (PAYOUTS, REFUNDS, PROMOTIONS, PARTNER_SHARES, CHARGEBACKS, OTHER) and returns time-bucketed data. # Arguments * input - Query parameters including currency and chart filter (date range, period) # Returns Vector of expense entries, one per (category, time_bucket) combination

Arguments

  • input!
Returns[!]!
QUERY

platformRevenueExpenseHistory

#

Get revenue vs expense over time. Returns time-bucketed revenue and expense totals with net income for financial comparison charts. # Arguments * input - Query parameters including currency and chart filter (date range, period) # Returns Vector of revenue/expense entries, one per time bucket

Arguments

  • input!
Returns[!]!
QUERY

platformWalletBalanceHistory

#

Get platform wallet balance history over time. Returns time series of platform wallet balances with summary statistics (start, end, min, max, average, percent change). # Arguments * input - Query parameters including currency and chart filter (date range, period) # Returns Financial timeline with points and summary

Arguments

  • input!
Returns!
QUERY

retentionMetrics

#

Get retention metrics for user cohorts. Shows retention rates at 1, 7, 30, and 90 days.

Arguments

  • input!

    Default

    {
      "actorType": null,
      "cohortPeriod": "LAST7_DAYS"
    }
Returns!
QUERY

revenueMetrics

#

Query revenue metrics for the authenticated tenant.

Arguments

  • input!
Returns[!]!
QUERY

rideMetrics

#

Query ride metrics for the authenticated tenant.

Arguments

  • input!
Returns[!]!
QUERY

signupConversion

#

Customer accounts opened in a window and how many have ordered since.

Arguments

  • input!

    Default

    {
      "period": "LAST30_DAYS",
      "fromDate": null,
      "toDate": null,
      "kind": null
    }
Returns!
QUERY

taxiInsights

#

The workspace's taxi business over a window, for the Taxi Insights page. For the workspace's owner and for staff who may view reports.

Arguments

  • input!

    Default

    {
      "regionId": null,
      "period": "LAST30_DAYS",
      "fromDate": null,
      "toDate": null,
      "bucket": null,
      "timeZone": null
    }
Returns!
QUERY

topSpenders

#

Get top spenders/earners leaderboard. For customers: shows top spenders by total spending. For drivers/merchants: shows top earners by total earnings.

Arguments

  • input!
Returns!
QUERY

totalExpenses

Deprecated#

Get total platform expenses with daily breakdown. Aggregates expenses including payouts, refunds, promotions, partner shares, and chargebacks from ledger entries. # Arguments * input - Query parameters including currency and time period # Returns Total expenses with daily sparkline and period comparison

Deprecation reason: Legacy Flutter-admin financial view; retain until supported-client and trace checks permit retirement; BET-222

Arguments

  • input!
Returns!
QUERY

totalOutstandingUserBalances

#

Get total outstanding user balances with daily breakdown. Sum of all customer wallet balances at the current time. daily is the balance at the end of each bucket of the period, and comparison sets the balance at the period's end against the one at the previous period's end. # Arguments * input - Query parameters including currency and time period # Returns Total outstanding balances with their history and period comparison

Arguments

  • input!
Returns!
QUERY

totalRevenue

Deprecated#

Get total platform revenue with daily breakdown. Aggregates revenue from platform wallet credits with revenue-related ledger purposes (PLATFORM_REVENUE_CREDIT, etc.). # Arguments * input - Query parameters including currency and time period # Returns Total revenue with daily sparkline and period comparison

Deprecation reason: Legacy Flutter-admin financial view; retain until supported-client and trace checks permit retirement; BET-222

Arguments

  • input!
Returns!
QUERY

usersByApp

#

Get distribution of users by app (Taxi, Shop, Parking, etc.) Optionally filter by actor type (Customer, Driver, etc.)

Arguments

  • input!

    Default

    {
      "actorType": null,
      "app": null,
      "period": "LAST7_DAYS"
    }
Returns!

Mutations

MUTATION

naturalLanguageAnalyticsQuery

#

Answer an analytics question asked in plain language. The model picks a structured plan from a closed set of metrics and groupings, and the plan is run against the workspace's own analytics; amounts are in the workspace currency. Admin-only; staff need View reports. Requires natural-language analytics to be switched on under Settings → AI and an AI provider with budget left. Errors carry a code: AI_NOT_ENABLED when the feature is off, AI_CALL_FAILED when the provider could not be reached or refused, AI_PARSE_FAILED when its answer could not be used, QUESTION_NOT_SUPPORTED when none of the available figures answers the question, and INVALID_INPUT for an empty or over-long question.

Arguments

  • input!
Returns!