Skip to content

HTTP API

The Nara HTTP API provides interfaces for network state retrieval, opinion inspection, and local control. It is divided into Public UI/API and Inspector API.

  • Local Server (Default :8080): Serves Web UI and general API.
  • Mesh Server (Default :7433): Serves peer-authenticated endpoints (see Mesh HTTP).
EndpointMethodPurpose
/api.jsonGETKnown naras and raw statuses.
/narae.jsonGETAggregated view with derived opinions/clout.
/profile/{name}.jsonGETDetailed profile: friends, teases, etc.
/eventsGETSSE stream of real-time UI-formatted events.
/metricsGETPrometheus metrics.
EndpointMethodPurpose
/api/inspector/eventsGETPaginated ledger events.
/api/inspector/checkpointsGETSummary of latest verified checkpoints.
/api/inspector/projectionsGETCurrent projection states (Online, Clout, Opinions).
/api/inspector/uptime/{subject}GETReconstructed timeline of status periods.
EndpointMethodPurpose
/world/startPOSTInitiate a World Postcard.
/api/stash/updatePOSTUpdate and distribute local stash.
/api/events/importPOSTSigned batch event import.
  1. Baseline: Latest Checkpoint TotalUptime.
  2. Backfill: If no checkpoint, use StartTime from Backfill event.
  3. Interleave: Process ONLINE, OFFLINE, MISSING events chronologically.
  4. Active: If currently online, extend final period to now.
  1. Proof: Requires SHA256(ts + ":" + event_ids) signed by Nara’s soul.
  2. Freshness: Timestamp must be within ±5m.
  • Authentication: Destructive/private operations require soul-based signatures.
  • Auditability: Inspector API exposes the subjective rationale behind “opinions.”
  • Sovereignty: API only reflects the local Nara’s world view.
  • TestHTTP_ApiJson / TestHTTP_InspectorEvents.
  • TestHTTP_EventImport: Validity and replay protection.
  • TestHTTP_UptimeTimeline: Interleaving logic.
  • TestHTTP_MeshAuthMiddleware: Access gating.