Health endpoints expose the server’s current readiness and migration state.

Get Health

GET /api/health
Returns the instance health snapshot.

Response Semantics

  • If the server has no database handle, the route returns { "status": "ok", "version": "..." }.
  • If the database check fails, the route returns 503 with { "status": "unhealthy", "version": "...", "error": "database_unreachable" }.
  • When the database is available, the response includes deployment metadata, bootstrap status, feature flags, an intelligence monitor summary, and optionally dev-server health.

Returned Fields

FieldMeaning
statusok when the health check succeeds
versionCurrent server version string
deploymentModeCurrent deployment mode reported by the server
deploymentExposurePublic/private exposure classification
authReadyWhether auth is considered ready
bootstrapStatusready or bootstrap_pending in authenticated deployments
bootstrapInviteActiveWhether a bootstrap invite is currently active
features.companyDeletionEnabledCompany-deletion feature flag
intelligenceMonitorMonitor summary from the intelligence service
devServerPresent only when persisted dev-server status exists

Get Migration Status

GET /api/health/migration-status
Returns the canonical migration inspection summary for the active runtime DB target.

Response Semantics

  • If the database handle is missing, the route returns 503 with { "error": "database_unavailable" }.
  • If the migration lookup fails, the route returns 500 with { "error": "migration_status_check_failed", "message": "..." }.
  • On success, the route reports the resolved DB source, migration status, table count, current applied migration file, server version, and any pending migrations.

Returned Fields

FieldMeaning
sourceWhich DB target the migration inspection used
statusupToDate or needsMigrations
tableCountNumber of discovered public tables during inspection
currentVersionLatest applied migration file name, or null if unavailable
targetVersionServer version string
pendingMigrationsPending migration file names when status is needsMigrations
estimatedTimeSecondsCurrently null; the handler does not estimate runtime
reasonPresent only when status is needsMigrations