GraphQL Queries
The GraphQL schema is CLI-first and canonical: the active query fields use
snake_case get_* names. The camelCase, organization, passkey, onboarding,
and metrics queries from the old web-dashboard era are still present in the
executable schema but are @deprecated (dashboard sunset) and slated for
removal in v2.0 — they are listed at the bottom of this page.
Explore the live schema and every field with GraphiQL at
https://gql-api.tokenbot.com/graphql.
Most get_* queries return a success / data / error envelope.
Auth & User
Section titled “Auth & User”Get the authenticated user’s profile.
query { me { success data { id email email_verified is_active provider referral_code created_at } }}Exchange Accounts
Section titled “Exchange Accounts”get_exchange_accounts
Section titled “get_exchange_accounts”List the caller’s connected exchange accounts.
query { get_exchange_accounts { success data { id exchange_name account_name trading_type is_active balance last_sync_at } }}get_exchange_account
Section titled “get_exchange_account”query { get_exchange_account(id: "exc_123") { success data { id exchange_name permissions perpetual_capabilities } }}Strategies
Section titled “Strategies”get_strategies
Section titled “get_strategies”query { get_strategies { success data { id name exchange status is_active copiers { id name } totalTrades currentBalanceUSD balanceChange24h } }}Copiers
Section titled “Copiers”get_copiers
Section titled “get_copiers”query { get_copiers { success data { id name exchange status is_active strategy { id name } totalTrades currentBalanceUSD } }}Trades
Section titled “Trades”get_trades
Section titled “get_trades”Accepts optional filters, pagination, sortBy (default EXECUTED_AT), and
sortOrder (default DESC).
query { get_trades { success data { id side type price amount fee status created_at } }}get_trade
Section titled “get_trade”query { get_trade(id: "trd_123") { success data { id side type price amount status } }}search_trades
Section titled “search_trades”Full-text search across trades.
query { search_trades(query: "BTC/USDT") { success data { id side price amount status } }}Analytics
Section titled “Analytics”Aggregation queries backed by the trade partition store. Date ranges default to
MONTH, grouping to DAY.
| Query | Args | Returns |
|---|---|---|
get_trade_analytics | dateRange, groupBy, filters | TradeAnalyticsResponse! |
get_trade_summary | dateRange, strategyId, exchangeAccountId | TradeSummaryResponse! |
get_strategy_performance | dateRange, strategyIds | [StrategyPerformance!]! |
get_exchange_performance | dateRange, exchangeAccountIds | [ExchangePerformance!]! |
get_pnl_over_time | dateRange, groupBy, strategyId | [DailyPnL!]! |
get_trade_correlation | strategyIds!, dateRange | JSON |
query { get_trade_summary(dateRange: MONTH) { success data { totalTrades winRate realizedPnlUSD } }}Trade Pairs
Section titled “Trade Pairs”get_trade_pairs
Section titled “get_trade_pairs”query { get_trade_pairs { success data { id symbol exchange } }}Supported Exchanges
Section titled “Supported Exchanges”get_supported_exchanges
Section titled “get_supported_exchanges”query { get_supported_exchanges { success data { id name } }}Reward Types
Section titled “Reward Types”get_reward_types
Section titled “get_reward_types”query { get_reward_types { success data { id name } }}User Settings
Section titled “User Settings”get_user_setting
Section titled “get_user_setting”query { get_user_setting { success data { key value } }}Withdrawals
Section titled “Withdrawals”get_withdraws / get_withdraw
Section titled “get_withdraws / get_withdraw”query { get_withdraws { success data { id amount wallet_address status } }}query { get_withdraw(id: "wd_123") { success data { id amount status } }}API Keys & CLI Identity
Section titled “API Keys & CLI Identity”| Query | Args | Returns |
|---|---|---|
validate_api_key | key_hash: String! | ValidateApiKeyResponse! |
list_api_keys | — | ApiKeyListResponse! |
cli_challenge | — | CliChallenge! |
cli_identity_by_pubkey | public_key: String! | CliIdentity |
cli_challenge and register_cli_identity (mutation) back the tokenbot init
registration flow; cli_identity_by_pubkey resolves a signed-request public key
to its account.
Admin queries require a system-admin identity (is_system_admin, or an active
admin organization role). They are authorized per-resolver via requireAdmin.
adminGetDashboard
Section titled “adminGetDashboard”System overview stats.
adminGetUsers
Section titled “adminGetUsers”query { adminGetUsers(page: 1, limit: 20, search: "john") { id email is_active is_system_admin }}adminGetUser
Section titled “adminGetUser”Detailed user info (user_id: String!).
adminGetAuditLogs
Section titled “adminGetAuditLogs”Query the admin audit log (admin_id, target_user_id, action, start_date,
end_date, page, limit).
tokenbot-admin CLI surface (admin_extended)
Section titled “tokenbot-admin CLI surface (admin_extended)”These four queries (plus the adminUpdateUser / adminBanUser /
adminBulkUserAction mutations) are the operations the internal
tokenbot-admin CLI drives:
| Query | Args | Returns |
|---|---|---|
adminGetActivityLog | page, limit | ActivityLogResponse! |
adminGetStrategies | page, limit | [Strategy!]! |
adminGetCopiers | page, limit | [Copier!]! |
adminGetLinks | — | [AdminStrategyCopierLink!]! |
Deprecated (dashboard-era) queries
Section titled “Deprecated (dashboard-era) queries”These remain resolvable for backward compatibility but are @deprecated (web
dashboard sunset, no active consumer) and will be removed in v2.0. Do not build
new integrations on them:
- Organizations:
get_organizations,get_organization,get_user_organizations,get_organization_members - Passkeys:
userPasskeys,checkWebAuthnSupport - Onboarding:
getOnboardingStatus,shouldShowOnboarding - Rewards / Notifications:
get_user_reward,get_notification - System / Metrics:
systemVersion,adminGetApiKeys,adminGetSystemHealth,adminGetMetricsSummary,adminGetMetricsTimeSeries,adminGetSecurityAlerts,adminGetUsageTrends,adminGetMetricsBufferStats

