Skip to content

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.

Get the authenticated user’s profile.

query {
me {
success
data {
id
email
email_verified
is_active
provider
referral_code
created_at
}
}
}

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
}
}
}
query {
get_exchange_account(id: "exc_123") {
success
data {
id
exchange_name
permissions
perpetual_capabilities
}
}
}
query {
get_strategies {
success
data {
id
name
exchange
status
is_active
copiers { id name }
totalTrades
currentBalanceUSD
balanceChange24h
}
}
}
query {
get_copiers {
success
data {
id
name
exchange
status
is_active
strategy { id name }
totalTrades
currentBalanceUSD
}
}
}

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
}
}
}
query {
get_trade(id: "trd_123") {
success
data {
id
side
type
price
amount
status
}
}
}

Full-text search across trades.

query {
search_trades(query: "BTC/USDT") {
success
data { id side price amount status }
}
}

Aggregation queries backed by the trade partition store. Date ranges default to MONTH, grouping to DAY.

QueryArgsReturns
get_trade_analyticsdateRange, groupBy, filtersTradeAnalyticsResponse!
get_trade_summarydateRange, strategyId, exchangeAccountIdTradeSummaryResponse!
get_strategy_performancedateRange, strategyIds[StrategyPerformance!]!
get_exchange_performancedateRange, exchangeAccountIds[ExchangePerformance!]!
get_pnl_over_timedateRange, groupBy, strategyId[DailyPnL!]!
get_trade_correlationstrategyIds!, dateRangeJSON
query {
get_trade_summary(dateRange: MONTH) {
success
data { totalTrades winRate realizedPnlUSD }
}
}
query {
get_trade_pairs {
success
data { id symbol exchange }
}
}
query {
get_supported_exchanges {
success
data { id name }
}
}
query {
get_reward_types {
success
data { id name }
}
}
query {
get_user_setting {
success
data { key value }
}
}
query {
get_withdraws {
success
data { id amount wallet_address status }
}
}
query {
get_withdraw(id: "wd_123") {
success
data { id amount status }
}
}
QueryArgsReturns
validate_api_keykey_hash: String!ValidateApiKeyResponse!
list_api_keys—ApiKeyListResponse!
cli_challenge—CliChallenge!
cli_identity_by_pubkeypublic_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.

System overview stats.

query {
adminGetUsers(page: 1, limit: 20, search: "john") {
id
email
is_active
is_system_admin
}
}

Detailed user info (user_id: String!).

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:

QueryArgsReturns
adminGetActivityLogpage, limitActivityLogResponse!
adminGetStrategiespage, limit[Strategy!]!
adminGetCopierspage, limit[Copier!]!
adminGetLinks—[AdminStrategyCopierLink!]!

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