Skip to Content

Users

Manage end-users within an application.

OperationGraphQL
List usersusers(where: {application_id: {_eq: $appId}, active: {_eq: true}}, order_by: {created_at: desc})
List all usersusers(where: {application_id: {_eq: $appId}}, order_by: {created_at: desc})
Search usersusers(where: {application_id: {_eq: $appId}, handler: {_ilike: $searchPattern}}, limit: $limit, offset: $offset)
User countusers_aggregate(where: {application_id: {_eq: $appId}}) { aggregate { count } }
Ban/unban userupdate_users_by_pk(pk_columns: {id: $userId}, _set: {active: false})
User usage eventsusage_events(where: {application_id: {_eq: $appId}, user_id: {_eq: $userId}, created_at: {_gte: $start, _lte: $end}})
User usage statsusage_events_aggregate(where: {application_id: {_eq: $appId}, user_id: {_eq: $userId}, created_at: {_gte: $windowStart}}) { aggregate { count, sum { tokens_in, tokens_out, cost_pusd } } }
Assign planinsert_user_plan_assignments_one(object: {organization_id, application_id, billing_plan_id, user_id, status: "active"})
Cancel plan assignmentupdate_user_plan_assignments(where: {organization_id: {_eq: $orgId}, application_id: {_eq: $appId}, user_id: {_eq: $userId}, status: {_eq: "active"}}, _set: {status: "canceled", ends_at: $now})
Get assignable plansbilling_plans(where: {organization_id: {_eq: $orgId}, deleted: {_neq: true}, is_active: {_eq: true}})
Last updated on