Skip to content

API Reference

Ciprian-LocalPulse edited this page Jul 31, 2026 · 1 revision

API Reference

Cross-cutting reference. Describes the service-wrapper interface referenced in the repository roadmap (docs/api/) that exposes the pipeline described in Architecture Overview to source adapters and to the founder-facing review interface.

API Surface Overview

flowchart LR
    subgraph Inbound["Inbound (Source Adapters -> Sentinel)"]
        A1[POST /v1/ingest]
    end
    subgraph Query["Query (Review Interface -> Sentinel)"]
        A2[GET /v1/queue]
        A3[GET /v1/messages/:id/analysis]
        A4[GET /v1/messages/:id/draft]
        A5[GET /v1/negotiation/:thread_id/brief]
        A6[GET /v1/capacity/current]
    end
    subgraph Action["Action (Founder -> Sentinel)"]
        A7[POST /v1/messages/:id/approve]
        A8[POST /v1/messages/:id/edit]
        A9[POST /v1/messages/:id/reject]
    end
    A1 --> Pipe[Ingestion -> Cortex -> Persona/Negotiation/Energy]
    Pipe --> A2
    Pipe --> A3
    Pipe --> A4
    Pipe --> A5
    Pipe --> A6
Loading

Inbound Endpoints

POST /v1/ingest

Used by source adapters (see Cortex Ingestion Pipeline) to submit a raw message for processing.

Request body: channel-specific raw payload plus a source field identifying the adapter.

Response: 202 Accepted with a message_id once the message has passed fingerprinting — processing continues asynchronously through scoring, drafting, and gating.

Query Endpoints

GET /v1/queue

Returns the founder's current review queue, ordered by priority tier and gated by current capacity state (see Energy Shield Biometric Integration). Supports filtering by tier and by whether a draft is attached.

GET /v1/messages/:id/analysis

Returns the full AnalysisResult (see Data Schemas Reference) for a given message, including every contributing factor behind the urgency and sentiment scores.

GET /v1/messages/:id/draft

Returns the current DraftResponse, including which Persona Contextual Mask was applied and its style-consistency score.

GET /v1/negotiation/:thread_id/brief

Returns the NegotiationBrief for a commercial thread, per Negotiation Intelligence Algorithms — always including the full factor breakdown, never a bare recommendation.

GET /v1/capacity/current

Returns the founder's current CapacityState, useful for the review interface to explain why certain items are or aren't currently surfaced.

Action Endpoints

POST /v1/messages/:id/approve

Approves a draft as-is for sending. Logged with a timestamp and, if applicable, the auto-send policy that authorized it (see Deployment Guide).

POST /v1/messages/:id/edit

Submits a founder-edited version of a draft. The diff between original and edited draft is retained as calibration signal for Persona Stylometry Engine.

POST /v1/messages/:id/reject

Discards a draft without sending. Logged for the same calibration purpose.

Sequence: A Message's Full API Lifecycle

sequenceDiagram
    participant Adapter as Source Adapter
    participant API as Sentinel API
    participant Pipe as Internal Pipeline
    participant UI as Review Interface
    participant Founder

    Adapter->>API: POST /v1/ingest
    API-->>Adapter: 202 Accepted, message_id
    API->>Pipe: process (ingestion -> cortex -> persona/negotiation/energy)
    UI->>API: GET /v1/queue (polling or subscribed)
    API-->>UI: prioritized, capacity-gated queue
    UI->>API: GET /v1/messages/:id/draft
    API-->>UI: DraftResponse
    Founder->>UI: reviews draft
    UI->>API: POST /v1/messages/:id/approve
    API->>Adapter: (via outbound channel) send
Loading

Authentication and Authorization

All endpoints require authenticated access scoped to a single founder's Sentinel instance — there is no multi-tenant cross-founder query surface by design, consistent with the sovereignty principle in Sovereign Path Data Sovereignty. Exact authentication mechanism (API key, OAuth, local-only socket) is a deployment-topology choice — see Deployment Guide.

Status

This API surface reflects the target specification for docs/api/, tracked as a Phase 4 deliverable in Roadmap and Status. Implementations should treat endpoint names and shapes here as the contract to build against.

See Also

Clone this wiki locally