Skip to main content

Admin API

Complete reference for the super admin GraphQL API. All operations require a valid JWT token and isSuperAdmin: true on the authenticated user.

Total operations: 57 (32 queries, 24 mutations, 1 subscription)

warning

All admin endpoints are protected by JwtAuthGuard + SuperAdminGuard. Non-superadmin users receive a ForbiddenException (403).

Authentication

Every request must include:

Authorization: Bearer <jwt-token>

Platform Analytics (15 Queries)

QueryDescription
adminPlatformOverviewConsolidated stats: users, companies, jobs, candidates, talents, MRR, active subscriptions
adminUserStatisticsSignup trends (30 days), status breakdown (verified/unverified/superadmins), auth method split
adminCompanyStatisticsGrowth trends, size distribution, industry breakdown, avg users per company
adminRevenueStatisticsMRR, subscriptions by status/plan, invoice summary, promo code impact
adminRecruitmentStatisticsJobs by status, candidates by status, conversion funnel with rates
adminMeetingStatisticsMeetings by status/type, interview scores, completion/cancellation rates
adminNotificationStatisticsDelivery rates, engagement (read/click rates), channel breakdown
adminTalentPoolStatisticsPool status breakdown, CV parse stats, skills distribution
adminCollaboratorStatisticsInvitation acceptance rate, shares by type, collaboration trends
adminOnboardingStatisticsEmployer vs job seeker onboarding, completion rates, trends
adminSystemHealthLog level counts, errors last 24h/7d, errors by service, recent errors
adminPromoCodeStatisticsActive codes, total redemptions, total discount given
adminAuditLogsPaginated audit logs with filters (action, entity type, date range)
adminLookupUserDetailed user info by ID: companies, candidatures, subscription
adminLookupCompanyDetailed company info by ID: members, jobs, talent pools, candidates

Example: Dashboard Query

query AdminDashboard {
overview: adminPlatformOverview {
totalUsers
totalCompanies
totalJobs
monthlyRecurringRevenue
activeSubscriptions
}
users: adminUserStatistics {
totalUsers
usersCreatedThisWeek
statusBreakdown { verified unverified }
}
revenue: adminRevenueStatistics {
monthlyRecurringRevenue
subscriptionsByStatus { ACTIVE TRIALING PAST_DUE }
}
health: adminSystemHealth {
errorsLast24Hours
warningsLast24Hours
}
}

RBAC Management (14 Operations)

The platform has 8 roles in 3 tiers and 39 permissions across 13 feature modules. See Security & Authentication for the full role–permission matrix.

Current roles: Super Admin, Company Admin, Internal Sales, Recruiter/HR, External Sales, Economy, Auditor/Viewer, support.

Permission modules (13): Opportunities, CV Database, Task Board, Contact List, Statistics, Share CV List, Share Job List, Network Expansion, Grow Company, Subscriptions, Projects, Tracking System, Economy — each with READ, WRITE, DELETE levels.

Role CRUD

OperationTypeDescription
adminListRolesQueryList roles with pagination and search
adminGetRoleQueryRole details with permissions and assignment count
adminCreateRoleMutationCreate role with optional permission IDs
adminUpdateRoleMutationUpdate name, description, permissions (replaces existing)
adminDeleteRoleMutationDelete role (fails if active assignments exist)

Permission CRUD

OperationTypeDescription
adminListPermissionsQueryList all 39 module permissions with pagination and search
adminCreatePermissionMutationCreate permission (name must be unique)
adminUpdatePermissionMutationUpdate permission name or description
adminDeletePermissionMutationDelete permission (fails if assigned to roles)

Role Assignments

OperationTypeDescription
adminListRoleAssignmentsQueryList UserCompanyRole assignments filtered by user/company/role
adminAssignRoleMutationAssign role to user in a company (creates UserCompanyRole)
adminRevokeRoleMutationRevoke a role assignment by ID
adminBulkAssignRoleMutationAssign role to multiple users at once
adminRbacStatisticsQueryRole usage stats and assignment trends

Example: Create Role

mutation {
adminCreateRole(input: {
name: "Recruiter Lead"
description: "Senior recruiter with full pipeline access"
permissionIds: ["perm-uuid-1", "perm-uuid-2"]
}) {
success
message
role { id name }
}
}

Super Admin Management (2 Operations)

OperationTypeDescription
adminListSuperAdminsQueryList all users with SuperAdmin status (returns AdminListSuperAdminsResult!)
adminSetSuperAdminMutationGrant or revoke SuperAdmin status for a user (input: AdminSetSuperAdminInput!, returns AdminSetSuperAdminResult!)
warning

Cannot modify your own SuperAdmin status. The mutation prevents self-demotion for safety.

Example: Grant Super Admin

mutation {
adminSetSuperAdmin(input: {
userId: "user-uuid"
isSuperAdmin: true
reason: "Promoted to platform administrator"
}) {
success
message
userId
isSuperAdmin
email
}
}

Example: List Super Admins

query {
adminListSuperAdmins {
superAdmins { id email firstName lastName }
total
}
}

User Management (2 Mutations)

OperationTypeDescription
adminDeleteUserMutationSoft or hard delete a single user
adminBulkDeleteUsersMutationBulk delete up to 50 users
Safety Restrictions
  • Cannot delete your own account via admin mutations
  • Cannot delete users with isSuperAdmin: true
  • Hard delete requires confirmHardDelete: true
  • Bulk operations capped at 50 users per request

Example: Soft Delete

mutation {
adminDeleteUser(input: {
userId: "user-uuid"
deleteType: SOFT
reason: "User requested account closure"
}) {
success
message
deletedUserId
deleteType
}
}

Billing Administration (13 Operations)

Plan & Credit Pack Management

OperationTypeDescription
createPlanMutationCreate subscription plan
updatePlanMutationUpdate plan details
removePlanMutationDelete a plan
createCreditPackMutationCreate purchasable credit pack
updateCreditPackMutationUpdate credit pack
removeCreditPackMutationDelete credit pack

Subscription & Credit Admin

OperationTypeDescription
adminAssignSubscriptionMutationAssign subscription to company without payment
adminGrantCreditsMutationGrant credits to company or user (max 1M per grant)
creditCostConfigsQueryList all AI model credit cost configurations
createCreditCostConfigMutationSet per-token pricing for an AI model
updateCreditCostConfigMutationUpdate model credit costs
deleteCreditCostConfigMutationSoft-delete config (sets isActive: false)
adminAIOperationLogsQueryPlatform-wide AI operation logs with filters
info

adminGrantCredits requires exactly one of companyId or userId -- not both. Company ID targets the employer balance; user ID targets the job seeker balance.


Additional Admin Sections

Company Management

OperationTypeDescription
adminListCompaniesQueryList companies with search, status filter
adminGetCompanyQueryDetailed company info with subscription and owner
adminSuspendCompanyMutationSuspend company and deactivate subscriptions
adminReactivateCompanyMutationReactivate a suspended company
adminTransferOwnershipMutationTransfer company ownership to another user

Credit & Subscription Dashboard

OperationTypeDescription
adminListCreditBalancesQueryAll credit balances with search
adminGetCreditBalanceQueryBalance details with recent transactions
adminCreditStatisticsQueryPlatform credits in circulation, top consumers
adminAdjustCreditsMutationManual credit adjustment (positive or negative)
adminListSubscriptionsQuerySubscriptions filtered by status/plan
adminGetSubscriptionQueryFull subscription details including Stripe ID
adminExtendSubscriptionMutationExtend subscription end date
adminCancelSubscriptionMutationCancel subscription (DB-level, not Stripe-synced)
adminChangePlanMutationChange subscription plan

AI Operations Dashboard (Read-Only)

OperationTypeDescription
adminAIOperationsOverviewQueryTotal operations, tokens, credits, 30-day trends
adminAIOperationsByTypeQueryBreakdown by operation type (CV, matching, etc.)
adminTopAIConsumersQueryTop companies/users by credit consumption
adminAIOperationLogsQueryPaginated logs with type/status/date filters

Feature Flags

OperationTypeDescription
adminListFeatureFlagsQueryList all feature flags
adminGetFeatureFlagQueryGet flag by key
adminSetFeatureFlagMutationCreate or update flag (upsert by key)
adminDeleteFeatureFlagMutationDelete flag by key

Site Status (Public — No Auth)

OperationTypeDescription
publicSiteStatusQueryPublic, unauthenticated. Returns maintenance-mode status for the landing page, signin screen, and authenticated routes. Polled by frontend every 60s.

Returns:

type PublicSiteStatusOutput {
landingLocked: Boolean!
companiesLocked: Boolean!
jobseekersLocked: Boolean!
endsAt: String # ISO 8601 or null
serverNow: String! # ISO 8601 — always fresh, never cached
message: String
reason: String
supportContact: String
statusPageUrl: String
}

Backed by 8 SystemSetting keys (same table as feature flags, written via adminSetFeatureFlag):

KeyTypeNotes
maintenance_landingboolean"true" / "false" string
maintenance_companiesboolean"true" / "false" string
maintenance_jobseekersboolean"true" / "false" string
maintenance_ends_atstringISO 8601 or empty string (unset)
maintenance_messagestringLong message, shown on screen
maintenance_reasonstringShort reason, shown on screen
maintenance_support_contactstringEmail or URL, optional
maintenance_status_page_urlstringURL, optional

Server-side behavior:

  • Empty-string values coerced to null
  • If maintenance_ends_at parses to a valid date and is in the past, all three *Locked fields are forced to false regardless of stored values (authoritative expiry enforcement — stale caches can't trick the client)
  • endsAt is still returned verbatim so the frontend can display the original schedule
  • 10s in-memory TTL cache on the flag projection (not serverNow — that's recomputed every call)
  • Cache is busted on admin.featureFlag.{created,updated,deleted} events for maintenance_* keys, so admin toggles propagate to anonymous pollers within one poll cycle

See the Maintenance Mode Runbook for operational steps.

Job Moderation & Email Management

OperationTypeDescription
adminListJobsQueryJobs with status/company/search filters
adminGetJobQueryDetailed job with candidate/interview counts
adminUpdateJobStatusMutationModerate job status (NEW, IN_PROGRESS, CLOSED, DRAFT)
adminListEmailsQueryEmail delivery logs with filters
adminGetEmailQueryFull email content and delivery details
adminEmailStatisticsQueryDelivery rate, sent/failed/pending counts
adminResendEmailMutationResend a failed email

Schema Introspection

OperationTypeDescription
databaseSchemaQueryFull Prisma schema text from connected DB
modelSchemaQuerySchema for a specific model by name
schemaComparisonQueryCompare local vs database schema, diff report
databaseEnumsQueryAll enum definitions

Monitoring

OperationTypeDescription
applicationLogsQueryRecent logs filtered by level, service, correlation ID
errorLogsQueryRecent error logs
logStatsQueryLog counts and error summary
serviceLogStatsQueryPer-service log and error counts
logStreamSubscriptionReal-time log streaming via Redis pub/sub

Error Codes

ErrorCodeDescription
Unauthorized401Missing or invalid JWT token
Forbidden403User is not a superadmin
Not Found404Resource not found (lookup queries)
Bad Request400Validation failure (e.g., bulk delete exceeds 50)