openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.2.0 description: Orchestriq Prism - Narrative Intelligence API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: feed description: News and social media feed - name: narratives description: Narrative analysis - name: alerts description: Notification alerts - name: dashboard description: Dashboard summaries - name: ingestion description: Data ingestion system paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /feed: get: operationId: getFeed tags: [feed] summary: Get unified live feed (news + social) parameters: - name: page in: query schema: type: integer default: 1 - name: limit in: query schema: type: integer default: 20 - name: platform in: query schema: type: string enum: [all, twitter, news, reddit, telegram] default: all - name: sourceType in: query schema: type: string enum: [all, news, social, rss] default: all - name: sourceConnector in: query schema: type: string - name: topic in: query schema: type: string - name: timeRange in: query schema: type: string enum: [1h, 6h, 24h, 7d, 30d] default: 24h - name: search in: query schema: type: string - name: sentiment in: query schema: type: string enum: [all, positive, negative, neutral, mixed] default: all - name: language in: query schema: type: string responses: "200": description: Feed items content: application/json: schema: $ref: "#/components/schemas/FeedResponse" /feed/{id}: get: operationId: getFeedItem tags: [feed] summary: Get a single feed item parameters: - name: id in: path required: true schema: type: string responses: "200": description: Feed item detail content: application/json: schema: $ref: "#/components/schemas/FeedItem" "404": description: Not found /search: get: operationId: searchFeed tags: [feed] summary: Keyword search across all ingested content parameters: - name: q in: query required: true schema: type: string - name: limit in: query schema: type: integer default: 20 - name: platform in: query schema: type: string - name: sourceType in: query schema: type: string responses: "200": description: Search results content: application/json: schema: $ref: "#/components/schemas/FeedResponse" /narratives/{id}/analysis: get: operationId: getNarrativeAnalysis tags: [narratives] summary: Get full narrative analysis for a feed item parameters: - name: id in: path required: true schema: type: string responses: "200": description: Full narrative analysis content: application/json: schema: $ref: "#/components/schemas/NarrativeAnalysis" /narratives/{id}/network: get: operationId: getNarrativeNetwork tags: [narratives] summary: Get network graph data for coordination visualization parameters: - name: id in: path required: true schema: type: string responses: "200": description: Network graph data content: application/json: schema: $ref: "#/components/schemas/NetworkGraph" /narratives/{id}/timeline: get: operationId: getNarrativeTimeline tags: [narratives] summary: Get timeline spike data for a narrative parameters: - name: id in: path required: true schema: type: string responses: "200": description: Timeline data content: application/json: schema: $ref: "#/components/schemas/TimelineData" /narratives/analyze: post: operationId: analyzeText tags: [narratives] summary: Analyze pasted text or URL requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AnalyzeRequest" responses: "200": description: Analysis result content: application/json: schema: $ref: "#/components/schemas/NarrativeAnalysis" /alerts: get: operationId: getAlerts tags: [alerts] summary: Get notification alerts responses: "200": description: Alerts list content: application/json: schema: type: array items: $ref: "#/components/schemas/Alert" /alerts/{id}/dismiss: post: operationId: dismissAlert tags: [alerts] summary: Dismiss an alert parameters: - name: id in: path required: true schema: type: string responses: "200": description: Alert dismissed /dashboard/summary: get: operationId: getDashboardSummary tags: [dashboard] summary: Get dashboard metrics summary responses: "200": description: Dashboard summary content: application/json: schema: $ref: "#/components/schemas/DashboardSummary" /dashboard/trending: get: operationId: getTrendingNarratives tags: [dashboard] summary: Get trending narrative topics responses: "200": description: Trending narratives content: application/json: schema: type: array items: $ref: "#/components/schemas/TrendingNarrative" /ingestion/status: get: operationId: getIngestionStatus tags: [ingestion] summary: Get status of all ingestion connectors responses: "200": description: Ingestion status content: application/json: schema: $ref: "#/components/schemas/IngestionStatus" /ingestion/trigger: post: operationId: triggerIngestion tags: [ingestion] summary: Manually trigger a full ingestion run requestBody: required: false content: application/json: schema: type: object properties: connector: type: string description: Optional specific connector to run responses: "200": description: Ingestion triggered content: application/json: schema: type: object properties: triggered: type: boolean message: type: string required: - triggered - message components: schemas: HealthStatus: type: object properties: status: type: string required: - status FeedItem: type: object properties: id: type: string headline: type: string summary: type: string content: type: string source: type: string sourceType: type: string enum: [news, social, rss] sourceConnector: type: string platform: type: string enum: [twitter, news, reddit, telegram] url: type: string externalId: type: string timestamp: type: string format: date-time coordinationScore: type: number minimum: 0 maximum: 100 coordinationLevel: type: string enum: [low, medium, high] topic: type: string autoTopics: type: array items: type: string tags: type: array items: type: string sentiment: type: string enum: [positive, negative, neutral, mixed] language: type: string credibilityScore: type: number minimum: 0 maximum: 100 location: type: string viewCount: type: integer shareCount: type: integer authorName: type: string authorHandle: type: string imageUrl: type: string isIngested: type: boolean required: - id - headline - source - platform - timestamp - coordinationScore - coordinationLevel - topic - tags FeedResponse: type: object properties: items: type: array items: $ref: "#/components/schemas/FeedItem" total: type: integer page: type: integer hasMore: type: boolean required: - items - total - page - hasMore CoordinationScore: type: object properties: overall: type: number minimum: 0 maximum: 100 timing: type: number minimum: 0 maximum: 100 language: type: number minimum: 0 maximum: 100 network: type: number minimum: 0 maximum: 100 amplification: type: number minimum: 0 maximum: 100 required: - overall - timing - language - network - amplification EmotionalAnalysis: type: object properties: fear: type: number minimum: 0 maximum: 100 anger: type: number minimum: 0 maximum: 100 neutral: type: number minimum: 0 maximum: 100 joy: type: number minimum: 0 maximum: 100 surprise: type: number minimum: 0 maximum: 100 required: - fear - anger - neutral - joy - surprise SourceDNA: type: object properties: sourceName: type: string bias: type: string enum: [far-left, left, center-left, center, center-right, right, far-right, unknown] ownership: type: string country: type: string founded: type: string reliabilityScore: type: number minimum: 0 maximum: 100 notes: type: string required: - sourceName - bias - ownership - country - reliabilityScore ReferenceChainNode: type: object properties: id: type: string source: type: string headline: type: string timestamp: type: string format: date-time isOrigin: type: boolean level: type: integer required: - id - source - headline - timestamp - isOrigin - level GroundTruth: type: object properties: localNarrative: type: string externalNarrative: type: string divergenceScore: type: number minimum: 0 maximum: 100 verifiedFacts: type: array items: type: string disputedClaims: type: array items: type: string required: - localNarrative - externalNarrative - divergenceScore - verifiedFacts - disputedClaims RepresentativePost: type: object properties: id: type: string text: type: string author: type: string platform: type: string timestamp: type: string format: date-time engagementScore: type: number required: - id - text - author - platform - timestamp - engagementScore NarrativeTag: type: string enum: - highly-amplified - emotionally-charged - coordinated-spread - likely-organic - one-sided - context-missing - disputed-claims - fear-inducing - anger-inducing - positive-spin OriginInsight: type: object properties: summary: type: string originSource: type: string firstSeenAt: type: string format: date-time platformCount: type: integer sourceCount: type: integer spreadPattern: type: string enum: [organic, burst, coordinated, slow-burn] timeToViral: type: string required: - summary - originSource - spreadPattern RecommendedAction: type: object properties: text: type: string type: type: string enum: [share-safe, pause-reflect, verify-first, do-not-share] reason: type: string required: - text - type - reason PerspectivePost: type: object properties: id: type: string text: type: string source: type: string sourceConnector: type: string platform: type: string sentiment: type: string url: type: string timestamp: type: string format: date-time required: - id - text - source - platform - sentiment - timestamp PerspectiveView: type: object properties: label: type: string type: type: string enum: [local, external] sourcesUsed: type: array items: type: string dominantTone: type: string keyPoints: type: array items: type: string missingContext: type: array items: type: string framingStyle: type: string representativePosts: type: array items: $ref: "#/components/schemas/PerspectivePost" articleCount: type: integer avgSentiment: type: number required: - label - type - sourcesUsed - dominantTone - keyPoints - missingContext - framingStyle - representativePosts - articleCount NarrativeAnalysis: type: object properties: id: type: string feedItemId: type: string headline: type: string aiSummary: type: string alertLevel: type: string enum: [low, medium, high] narrativeTags: type: array items: $ref: "#/components/schemas/NarrativeTag" coordinationScore: $ref: "#/components/schemas/CoordinationScore" emotionalAnalysis: $ref: "#/components/schemas/EmotionalAnalysis" sourceDNA: $ref: "#/components/schemas/SourceDNA" referenceChain: type: array items: $ref: "#/components/schemas/ReferenceChainNode" groundTruth: $ref: "#/components/schemas/GroundTruth" representativePosts: type: array items: $ref: "#/components/schemas/RepresentativePost" originInsight: $ref: "#/components/schemas/OriginInsight" recommendedAction: $ref: "#/components/schemas/RecommendedAction" localPerspective: $ref: "#/components/schemas/PerspectiveView" externalPerspective: $ref: "#/components/schemas/PerspectiveView" perspectiveDivergence: type: number minimum: 0 maximum: 100 analyzedAt: type: string format: date-time required: - id - feedItemId - headline - aiSummary - alertLevel - narrativeTags - coordinationScore - emotionalAnalysis - sourceDNA - referenceChain - groundTruth - representativePosts - analyzedAt NetworkNode: type: object properties: id: type: string label: type: string type: type: string enum: [source, amplifier, origin, hub] size: type: number color: type: string x: type: number y: type: number required: - id - label - type - size NetworkEdge: type: object properties: id: type: string source: type: string target: type: string weight: type: number type: type: string enum: [shares, cites, coordinates, amplifies] required: - id - source - target - weight - type NetworkGraph: type: object properties: nodes: type: array items: $ref: "#/components/schemas/NetworkNode" edges: type: array items: $ref: "#/components/schemas/NetworkEdge" clusterId: type: string coordinationDensity: type: number required: - nodes - edges - coordinationDensity TimelinePoint: type: object properties: timestamp: type: string format: date-time count: type: integer platform: type: string isSpikeEvent: type: boolean required: - timestamp - count - platform - isSpikeEvent TimelineData: type: object properties: points: type: array items: $ref: "#/components/schemas/TimelinePoint" peakTime: type: string format: date-time totalMentions: type: integer spikeCount: type: integer required: - points - peakTime - totalMentions - spikeCount AnalyzeRequest: type: object properties: text: type: string url: type: string mode: type: string enum: [ground-truth, outside-view, analyst] default: analyst required: [] Alert: type: object properties: id: type: string title: type: string message: type: string severity: type: string enum: [info, warning, critical] topic: type: string createdAt: type: string format: date-time dismissed: type: boolean feedItemId: type: string required: - id - title - message - severity - topic - createdAt - dismissed DashboardSummary: type: object properties: totalItemsTracked: type: integer highCoordinationCount: type: integer mediumCoordinationCount: type: integer lowCoordinationCount: type: integer activeAlerts: type: integer topTopics: type: array items: type: object properties: topic: type: string count: type: integer avgScore: type: number required: - topic - count - avgScore platformBreakdown: type: array items: type: object properties: platform: type: string count: type: integer required: - platform - count last24hTrend: type: array items: type: object properties: hour: type: string count: type: integer required: - hour - count required: - totalItemsTracked - highCoordinationCount - mediumCoordinationCount - lowCoordinationCount - activeAlerts - topTopics - platformBreakdown - last24hTrend TrendingNarrative: type: object properties: id: type: string topic: type: string headline: type: string velocity: type: number coordinationScore: type: number platformCount: type: integer mentionCount: type: integer trend: type: string enum: [rising, falling, stable, spike] required: - id - topic - headline - velocity - coordinationScore - platformCount - mentionCount - trend ConnectorStatus: type: object properties: name: type: string displayName: type: string type: type: string enum: [rss, reddit, newsapi] enabled: type: boolean lastRunAt: type: string format: date-time lastSuccess: type: boolean itemsLastRun: type: integer errorMessage: type: string required: - name - displayName - type - enabled - lastSuccess IngestionStatus: type: object properties: connectors: type: array items: $ref: "#/components/schemas/ConnectorStatus" totalIngested: type: integer lastRunAt: type: string format: date-time nextRunAt: type: string format: date-time isRunning: type: boolean required: - connectors - totalIngested - isRunning