Skip to main content

gRPC API Overview

This document summarizes the gRPC API of the zero-trust control plane: a single gRPC server, all services and their main RPCs, and how callers use it (backend in-process, frontend via Next.js API routes). For auth, sessions, policy, and other topics, see the linked backend docs.

Audience: Developers integrating with the backend or extending the API.

Overview

Services and RPCs

ServicePurposeMain RPCs
AdminServiceSystem adminGetSystemStats
AuthServiceAuth, MFA, tokensRegister, Login, VerifyCredentials, VerifyMFA, SubmitPhoneAndRequestMFA, Refresh, Logout, LinkIdentity
UserServiceUser lookup and lifecycleGetUser, GetUserByEmail, ListUsers, DisableUser, EnableUser
OrganizationServiceOrgs (tenants)CreateOrganization (public), GetOrganization, ListOrganizations, SuspendOrganization
MembershipServiceOrg membership and rolesAddMember, RemoveMember, UpdateRole, ListMembers
DeviceServiceDevice trustRegisterDevice, GetDevice, ListDevices, RevokeDevice
SessionServiceSessionsRevokeSession, ListSessions, GetSession, RevokeAllSessionsForUser
PolicyServiceRego policies (device-trust/MFA)CreatePolicy, UpdatePolicy, DeletePolicy, ListPolicies
OrgPolicyConfigServiceOrg policy config (MFA, device, session, access control)GetOrgPolicyConfig, UpdateOrgPolicyConfig, GetBrowserPolicy, CheckUrlAccess
TelemetryServiceTelemetry eventsEmitTelemetryEvent, BatchEmitTelemetry
AuditServiceAudit logsListAuditLogs
HealthServiceReadiness/livenessHealthCheck
DevServiceDev-only (e.g. OTP)GetOTP

Details: auth, sessions, session-lifecycle, mfa, device-trust, policy-engine, org-policy-config, audit, organization-membership, health, telemetry.

Public Endpoints: Most RPCs require a Bearer access token (obtained via Login or Refresh). Public endpoints that do not require authentication include:

  • AuthService.Register, AuthService.Login, AuthService.VerifyCredentials, AuthService.VerifyMFA, AuthService.SubmitPhoneAndRequestMFA, AuthService.Refresh
  • OrganizationService.CreateOrganization (allows newly registered users to create organizations before login)
  • HealthService.HealthCheck
  • DevService.GetOTP (dev-only)

Calling the API

  • From the backend: Handlers and services use the same process; no network call. Dependencies are injected into RegisterServices; if a dep is nil, that service may return Unimplemented.
  • From the frontend: The browser does not call gRPC. Next.js API routes (e.g. under frontend/app/api/) use gRPC clients (frontend/lib/grpc/) to call the backend; they map gRPC errors to HTTP status and JSON via grpc-to-http.ts. See Frontend Architecture.