Skip to main content
Was this helpful?

Platform API

Platform and Runtime Surface

Health probes, feature flags, monitoring, and security report ingestion

These endpoints sit outside the core product controllers and support runtime health, metrics, client telemetry, public feature flags, and security-report ingestion.

Mostly public routesHealth and readinessPrometheus metricsSecurity reports

Source

  • App controller: backend-nestjs/src/app.controller.ts
  • Feature flags controller: backend-nestjs/src/common/feature-flags.controller.ts
  • Monitoring controller: backend-nestjs/src/monitoring/monitoring.controller.ts
  • Security reports controller: backend-nestjs/src/common/security/security-reports.controller.ts
  • Honeypot controller: backend-nestjs/src/api-security/controllers/honeypot.controller.ts
  • DTOs: backend-nestjs/src/monitoring/dto/frontend-error-report.dto.ts, backend-nestjs/src/common/security/dto/security-report.dto.ts

Authentication and Scope

  • All endpoints on this page are public.
  • These routes are infrastructure-facing or abuse-detection-facing, not end-user feature APIs.
  • User API key creation and management are documented in Authentication API.

Endpoint Reference

Health and Availability

MethodPathPurposeRequest or queryAuthSource
GET/api/Root app response.NonePublicapp.controller.ts
GET/api/healthLiveness probe.NonePublicapp.controller.ts
GET/api/healthzLegacy liveness alias.NonePublicapp.controller.ts
GET/api/readyReadiness probe with DB check.NonePublicapp.controller.ts

Flags and Monitoring

MethodPathPurposeRequest or queryAuthSource
GET/api/feature-flagsReturn the current feature-flag snapshot.NonePubliccommon/feature-flags.controller.ts
GET/api/monitoring/metricsReturn Prometheus metrics text.NonePublicmonitoring/monitoring.controller.ts
GET/api/monitoring/metrics/jsonReturn metrics JSON.NonePublicmonitoring/monitoring.controller.ts
POST/api/monitoring/frontend-errorsIngest frontend error reports.Body: frontend error payloadPublicmonitoring/monitoring.controller.ts

Security Reports and Honeypots

MethodPathPurposeRequest or queryAuthSource
POST/api/security/reports/ctReceive certificate-transparency or similar security reports.Body: security report payloadPubliccommon/security/security-reports.controller.ts
POST/api/security/reports/cspReceive CSP violation reports.Body: security report payloadPubliccommon/security/security-reports.controller.ts
GET/api/security/honeypot/admin-loginAbuse-detection trap route.NonePublicapi-security/controllers/honeypot.controller.ts
POST/api/security/honeypot/submitAbuse-detection trap submit route.NonePublicapi-security/controllers/honeypot.controller.ts

Request Shapes

Frontend error reports

FrontendErrorReportDto

  • source: required string, max 180 chars
  • message: required string, max 400 chars
  • stack: optional string, max 10000 chars
  • url: optional string, max 400 chars
  • severity: optional error|warn|info
  • details: optional object

Security reports

  • Security-report endpoints accept the SecurityReportDto payload shape from backend-nestjs/src/common/security/dto/security-report.dto.ts.
  • The controller accepts both report and cspReport style payloads.

Example Calls

Read readiness

curl "$PRIMECAL_API/api/ready"

Fetch feature flags

curl "$PRIMECAL_API/api/feature-flags"

Submit a frontend error

curl -X POST "$PRIMECAL_API/api/monitoring/frontend-errors" \
-H "Content-Type: application/json" \
-d '{
"source": "calendar-view",
"message": "Week view render failed",
"severity": "error",
"url": "https://app.primecal.eu/app"
}'

Response and Behavior Notes

  • POST /api/monitoring/frontend-errors returns 202 Accepted.
  • Security report endpoints return 204 No Content.
  • Feature flags are intentionally public so the frontend can shape pre-login flows.

Best Practices

  • Use /api/health and /api/ready for deployment and load-balancer probes, not for customer-facing dashboards.
  • Keep frontend error payloads privacy-safe. Do not leak tokens, email addresses, or raw secrets in details.
  • Treat honeypot routes as internal abuse signals only. They are not product APIs to document for end users.
  • Separate observability concerns from product logic in clients. These routes should usually live in platform SDK layers, not feature modules.