Skip to content

HTTP APIs ​

June serves a dashboard and health probes on its main web server. The optional docs server publishes a read-only command manifest and status API.


1. Documentation & Manifest API ​

When enabled via DOCS_API_ENABLED=true in src/docs/server.js, June exposes a read-only, versioned interface designed for static site builders, documentation portals, and LLM context indexers.

Configuration ​

env
DOCS_API_ENABLED=true
DOCS_API_HOST=0.0.0.0
DOCS_API_PORT=3010
DOCS_ORIGIN=https://docs.june.4ofl.dev
DOCS_INCLUDE_ADMIN_COMMANDS=false

Endpoints ​

GET /v1/manifest ​

Returns the complete generated command contract with ETag caching support.

  • Fields: schemaVersion, generatedAt, product, version, categories, and commands.
  • Exclusions: Excludes internal secrets, administrator IDs, database connection strings, and unwhitelisted server IDs.

GET /v1/commands ​

A lightweight array of command specifications without product metadata, optimized for automated CI validation and test harnesses.

GET /v1/status ​

Returns a status snapshot with checkedAt, status, version, uptimeSeconds, discord, database, providers, and runtime. Readiness determines whether HTTP status is 200 or 503. The main web server also publishes this snapshot at /api/status and /v1/status.

GET /v1/llms.txt ​

Plain-text, markdown-formatted command reference optimized for Large Language Model indexing and developer CLI consumption.


2. Dashboard API ​

Discord OAuth establishes a seven-day signed session. Production uses the __Host-june_session cookie with Secure, HttpOnly, and SameSite=Lax. Set a dedicated SESSION_SECRET in production. June resolves the current Discord user's access on each request.

MethodEndpointAccessDescription
GET/auth/login, /auth/callbackOAuthStart and complete Discord sign-in.
GET/auth/mePublicCheck dashboard sign-in and profile.
POST/auth/logoutPublicClear the session cookie.
GET/api/stateApprovedLoad settings, receipts, reminders, watches, and temporary inboxes.
PATCH/api/settingsApprovedUpdate preferences.
DELETE/api/receipts/:id, /api/receiptsApprovedDelete one or all saved receipts.
POST/api/remindersApprovedSchedule a Discord DM within 24 hours.
DELETE/api/reminders/:id, /api/remindersApprovedCancel one or all reminders.
POST/api/watchesApprovedAdd a URL to monitor.
DELETE/api/watches/:id, /api/watchesApprovedRemove one or all watches.
POST/api/tempmailApprovedCreate a temporary inbox.
DELETE/api/tempmail/:addressApprovedRemove an inbox lease.
GET/api/tempmail/:address/messages/:idApprovedRead one message from an inbox the caller owns.
POST/api/admin/whitelistAdmin or ownerApprove a Discord account.
DELETE/api/admin/whitelist/:userIdAdmin or ownerRevoke approval for a Discord account.

Dashboard reminders go to Discord DMs. For reminders created in Discord, June checks that you can still post to the original channel before delivering. If channel delivery is unavailable, June tries DM. Temporary failures are retried, and reminders that exhaust retries show a delivery failure in the list.

June queries Stalwart on demand when loading inbox state or reading a message.

3. Health and Metrics ​

June exposes standard observability endpoints for container orchestrators and Prometheus scraping:

  • GET /healthz: Process liveness probe. Returns HTTP 200 { "ok": true, "status": "ok" } if the event loop is responsive.
  • GET /readyz: Readiness probe. Validates Discord Gateway connection and SQLite database accessibility. Returns HTTP 503 if the database is busy or the gateway is disconnected.
  • GET /metrics: Prometheus-formatted metrics (application counters and timings). Gated by METRICS_TOKEN Bearer authentication.
  • GET /version: Returns deployed application version and git commit hash.

Private Discord utility platform, diagnostic engine, and ephemeral mail service.