# AUTO-GENERATED by scripts/gen-openapi.ts — DO NOT EDIT BY HAND. # Source of truth: serverless.yml routes + handler middleware + types/schema.json. # Regenerate: `npm run openapi:gen` openapi: 3.0.3 info: title: KINETK Graph Service API version: 1.0.0 description: > Public HTTP API for the KINETK graph-service. Health/sync probe, precomputed narrative reads, and an async job queue for heavy intelligence work (`intelligence_records`, `intelligence_signals`, `campaign_brief`, `llm_context`). Authentication: send your secret key in the `x-api-key` header on every request. Keys are issued from the billing dashboard and shown only once. Billing: async intelligence jobs are metered in credits (1 credit = $1.00). `POST /intelligence/jobs` requires an explicit `window` and returns an `estimated_cost` — an UPPER BOUND. Pricing is dynamic: you are charged the ACTUAL cost once the job completes (a query that returns fewer records than `limit` costs less), and the unused remainder of the reservation is released. If your balance can't cover a call you get `402` with a recommendation for how to fit your remaining budget. Every successful response carries `X-Kinetk-Credits-Used` and `X-Kinetk-Credits-Remaining` headers. Precomputed narrative/creator reads are free in V1. Cached job answers are charged at the full rate (no cache discount). contact: name: KINETK Engineering license: name: Proprietary servers: - url: https://api.kinetk.ai/graph description: Production. security: - ApiKeyAuth: [] paths: /health: get: operationId: health summary: Health + sync-freshness probe description: Liveness probe reporting connectivity and database sync freshness. Returns `503` when the database is unreachable. security: - ApiKeyAuth: [] responses: "200": description: Successful response content: application/json: schema: $ref: "#/components/schemas/IHealthResponse" headers: X-Kinetk-Credits-Used: $ref: "#/components/headers/CreditsUsed" X-Kinetk-Credits-Remaining: $ref: "#/components/headers/CreditsRemaining" "503": description: Service degraded — the database is unreachable or a pipeline (sync, narratives, or content migration) is stale. Same body shape as the 200. content: application/json: schema: $ref: "#/components/schemas/IHealthResponse" default: $ref: "#/components/responses/Error" /intelligence/jobs: post: operationId: intelligenceJobsSubmit summary: Submit an async intelligence job description: > Submit a job for async execution. Request body is `{ kind, input }` discriminated by `kind`. Response shapes: - `200 + { fromCache: true, result, charged }` — identical recent job within the per-kind freshness window; cached result returned synchronously and charged at full rate (no cache discount). - `202 + { dedup: true }` — identical job currently queued/running; reuses the in-flight `jobId`. - `202 + { estimated_cost }` — new job accepted; the credits were reserved at the estimate. Poll `GET /intelligence/jobs/{id}`. - `402` — insufficient credits; body recommends how to fit your budget. For `intelligence_records` / `campaign_brief` / `llm_context`, `window` (in `input`) is REQUIRED — it drives the credit price (fresher windows cost more). `estimated_cost` is an upper bound; the final charge is computed from the records actually returned. Input validation is strict: any undeclared field, type mismatch, or out-of-enum value is rejected with `400` (nothing is silently stripped or coerced). security: - ApiKeyAuth: [] requestBody: required: true content: application/json: schema: oneOf: - $ref: "#/components/schemas/IQueryJobSubmitBody" - $ref: "#/components/schemas/ISignalsJobSubmitBody" - $ref: "#/components/schemas/ICampaignJobSubmitBody" discriminator: propertyName: kind mapping: intelligence_records: "#/components/schemas/IQueryJobSubmitBody" intelligence_signals: "#/components/schemas/ISignalsJobSubmitBody" campaign_brief: "#/components/schemas/ICampaignJobSubmitBody" llm_context: "#/components/schemas/ICampaignJobSubmitBody" responses: "200": description: Successful response content: application/json: schema: $ref: "#/components/schemas/IJobSubmitResponse" headers: X-Kinetk-Credits-Used: $ref: "#/components/headers/CreditsUsed" X-Kinetk-Credits-Remaining: $ref: "#/components/headers/CreditsRemaining" "402": description: Insufficient credits. The body reports the credits required vs available plus budget recommendations (max affordable limit, cheaper windows, top-up URL). content: application/json: schema: $ref: "#/components/schemas/IInsufficientCreditsResponse" default: $ref: "#/components/responses/Error" "/intelligence/jobs/{id}": get: operationId: intelligenceJobsStatus summary: Poll an async job — status + final result description: | Returns the job's current state. All states (`queued`, `running`, `succeeded`, `failed`) return `200`; `404` for an unknown `jobId`, `410` once the result has expired (~24h after completion). On `succeeded`, `result` carries the per-kind payload. Large results (>300 KB) are rehydrated transparently from object storage. Recommended polling cadence: every 2–5 seconds. Typical end-to-end run: 5–20 s. security: - ApiKeyAuth: [] parameters: - name: id in: path required: true schema: minLength: 1 type: string responses: "200": description: Successful response content: application/json: schema: $ref: "#/components/schemas/IJobStatusResponse" headers: X-Kinetk-Credits-Used: $ref: "#/components/headers/CreditsUsed" X-Kinetk-Credits-Remaining: $ref: "#/components/headers/CreditsRemaining" default: $ref: "#/components/responses/Error" /usage: get: operationId: usage summary: Credit usage history for your account description: Newest-first ledger entries (top-ups, settlements, refunds) for the account the key belongs to. Paginate with `limit` + `cursor`; scope to a single key with `keyId`. security: - ApiKeyAuth: [] responses: "200": description: Successful response content: application/json: schema: $ref: "#/components/schemas/IUsageResponse" headers: X-Kinetk-Credits-Used: $ref: "#/components/headers/CreditsUsed" X-Kinetk-Credits-Remaining: $ref: "#/components/headers/CreditsRemaining" default: $ref: "#/components/responses/Error" components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: x-api-key description: Customer secret key, required on every request. Validated natively by API Gateway; missing / invalid / revoked → 403. responses: Error: description: Error response content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" schemas: ErrorResponse: type: object required: - error properties: error: type: string IBudgetRecommendations: additionalProperties: false properties: alternativeWindows: items: $ref: "#/components/schemas/IBudgetWindowOption" type: array maxLimitForWindow: type: number topUpUrl: type: string required: - maxLimitForWindow - topUpUrl type: object IBudgetWindowOption: additionalProperties: false properties: maxLimit: type: number window: $ref: "#/components/schemas/PublicJobWindow" required: - maxLimit - window type: object ICampaignBriefInput: additionalProperties: false properties: audience: type: string campaign: type: string limit: type: number platforms: description: Platforms to filter by. Case-insensitive. items: enum: - instagram - pinterest - reddit - snapchat - tiktok - x type: string type: array tone: type: string window: $ref: "#/components/schemas/PublicJobWindow" required: - campaign - limit - window type: object ICampaignBriefJobResult: additionalProperties: false properties: brief: additionalProperties: false properties: campaign: type: string contentAngles: items: type: string type: array creatorArchetypes: items: type: string type: array emergingNarrativesToTest: items: type: string type: array evidence: items: additionalProperties: false properties: description: type: string nullable: true likes: type: number platform: type: string nullable: true tags: items: type: string type: array title: type: string nullable: true uuid: type: string views: type: number required: - likes - tags - uuid - views type: object type: array narrativesToRide: items: additionalProperties: false properties: emergingScore: type: number id: type: string label: type: string momentumScore: type: number summary: type: string topTags: items: type: string type: array required: - emergingScore - id - label - momentumScore - summary - topTags type: object type: array platformStrategy: items: additionalProperties: false properties: platform: type: string nullable: true recommendation: type: string required: - recommendation type: object type: array positioning: items: type: string type: array recommendedCreators: items: additionalProperties: false properties: amplifierScore: type: number id: type: number platform: type: string totalEngagement: type: number required: - amplifierScore - id - platform - totalEngagement type: object type: array topTags: items: type: string type: array required: - campaign - contentAngles - creatorArchetypes - emergingNarrativesToTest - evidence - narrativesToRide - platformStrategy - positioning - recommendedCreators - topTags type: object context: additionalProperties: false properties: campaign: type: string creators: items: additionalProperties: false properties: amplifier_score: type: number content_count: type: number follower_count: type: number nullable: true id: type: number platform: type: string total_engagement: type: number required: - amplifier_score - content_count - id - platform - total_engagement type: object type: array graph: additionalProperties: false properties: edges: items: additionalProperties: false properties: source: type: string target: type: string type: enum: - contains - creator_posted - semantic_similarity - tag_overlap - tagged_with type: string weight: type: number required: - source - target - type - weight type: object type: array nodes: items: additionalProperties: false properties: creatorId: type: number id: type: string label: type: string score: type: number type: enum: - content - creator - narrative - tag type: string required: - id - label - type type: object type: array required: - edges - nodes type: object input: additionalProperties: false properties: campaign: type: string platforms: items: type: string type: array tone: default: specific, evidence-backed type: string window: $ref: "#/components/schemas/NarrativeWindow" required: - campaign - platforms - tone - window type: object narratives: items: additionalProperties: false properties: content_count: type: number creator_count: type: number emerging_score: type: number id: type: string label: type: string momentum_score: type: number platform_count: type: number score_breakdown: additionalProperties: false properties: creatorDiversity: type: number engagementStrength: type: number platformSpread: type: number recencyStrength: type: number required: - creatorDiversity - engagementStrength - platformSpread - recencyStrength type: object summary: type: string top_tags: items: type: string type: array total_engagement: type: number required: - content_count - creator_count - emerging_score - id - label - momentum_score - platform_count - score_breakdown - summary - top_tags - total_engagement type: object type: array platformOpportunities: items: additionalProperties: false properties: avgEngagement: type: number baselineEngagement: type: number contentCount: type: number creatorCount: type: number dominantPlatform: type: string engagementPremiumPct: type: number narrativeId: type: string narrativeLabel: type: string opportunity: type: string opportunityScore: type: number platformConcentration: type: number platformDistribution: $ref: "#/components/schemas/Record" required: - avgEngagement - baselineEngagement - contentCount - creatorCount - dominantPlatform - engagementPremiumPct - narrativeId - narrativeLabel - opportunity - opportunityScore - platformConcentration - platformDistribution type: object type: array representativeContent: items: additionalProperties: false properties: comment_count: type: number description: type: string nullable: true like_count: type: number platform: type: string nullable: true share_count: type: number tags: items: type: string type: array title: type: string nullable: true uuid: type: string view_count: type: number required: - comment_count - like_count - share_count - tags - uuid - view_count type: object type: array retrieval: additionalProperties: false properties: candidatesSeen: type: number filteredBreakdown: additionalProperties: false properties: canonical: type: number platform: type: number window: type: number required: - canonical - platform - window type: object filteredCandidates: type: number identityMatchedCandidates: type: number joinBreakdown: additionalProperties: false properties: contentPlatformId: type: number uuid: type: number weaviateId: type: number required: - contentPlatformId - uuid - weaviateId type: object joinedResults: type: number matchedCandidates: type: number mergeMethod: enum: - reciprocal_rank_fusion type: string resultsReturned: type: number tagWidening: additionalProperties: false properties: phaseAContentCount: type: number skipped: type: boolean source: enum: - none - phase_a_top_tags - query_hashtags type: string widenTags: items: type: string type: array widenedCount: type: number required: - phaseAContentCount - skipped - source - widenTags - widenedCount type: object unmatchedCandidates: type: number unmatchedSamples: items: additionalProperties: false properties: contentId: type: string nullable: true contentPlatformId: type: string nullable: true distance: type: number nullable: true matchedBy: enum: - contentPlatformId - uuid - weaviateId type: string nullable: true mediaType: type: string nullable: true platform: type: string nullable: true postgresCanonicalUuid: type: string nullable: true postgresPlatform: type: string nullable: true postgresPublishedAt: type: string nullable: true postgresUuid: type: string nullable: true rawSimilarity: type: number reason: enum: - no_postgres_identity_match - postgres_row_filtered_canonical - postgres_row_filtered_platform - postgres_row_filtered_window type: string rrfScore: type: number sourceUrl: type: string nullable: true weaviateObjectId: type: string nullable: true required: - contentId - contentPlatformId - distance - matchedBy - mediaType - platform - postgresCanonicalUuid - postgresPlatform - postgresPublishedAt - postgresUuid - rawSimilarity - reason - rrfScore - sourceUrl - weaviateObjectId type: object type: array vectorDiagnostics: items: additionalProperties: false properties: candidatesReturned: type: number error: type: string query: type: string status: enum: - failed - ok type: string targetVector: type: string required: - candidatesReturned - query - status - targetVector type: object type: array vectorTargets: items: type: string type: array required: - candidatesSeen - filteredBreakdown - filteredCandidates - identityMatchedCandidates - joinBreakdown - joinedResults - matchedCandidates - mergeMethod - resultsReturned - unmatchedCandidates - vectorDiagnostics - vectorTargets type: object sourceContentUuids: items: type: string type: array sourceNarrativeIds: items: type: string type: array topTags: items: type: string type: array required: - campaign - creators - graph - input - narratives - platformOpportunities - representativeContent - sourceContentUuids - sourceNarrativeIds - topTags type: object createdAt: type: string id: type: string recordCount: type: number required: - brief - context - createdAt - id - recordCount type: object ICampaignJobSubmitBody: additionalProperties: false properties: input: $ref: "#/components/schemas/ICampaignBriefInput" kind: enum: - campaign_brief - llm_context type: string required: - input - kind type: object IHealthResponse: additionalProperties: false properties: content: additionalProperties: false properties: isStale: type: boolean lastMigratedAt: type: string nullable: true minutesSinceMigration: type: number nullable: true required: - isStale - lastMigratedAt - minutesSinceMigration type: object db: enum: - connected - unreachable type: string dbError: type: string durationMs: type: number narratives: additionalProperties: false properties: isStale: type: boolean lastRunAt: type: string nullable: true minutesSinceLastRun: type: number nullable: true required: - isStale - lastRunAt - minutesSinceLastRun type: object stage: type: string status: enum: - error - ok type: string sync: additionalProperties: false properties: isStale: type: boolean lastCycle: $ref: "#/components/schemas/IHealthSyncLastCycle" nullable: true lastRunAt: type: string nullable: true minutesSinceLastRun: type: number nullable: true today: $ref: "#/components/schemas/IHealthSyncToday" nullable: true required: - isStale - lastCycle - lastRunAt - minutesSinceLastRun - today type: object timestamp: type: string required: - content - db - durationMs - narratives - stage - status - sync - timestamp type: object IHealthSyncLastCycle: additionalProperties: false properties: durationMs: type: number insertedCount: type: number processedCount: type: number required: - durationMs - insertedCount - processedCount type: object IHealthSyncToday: additionalProperties: false properties: insertedCount: type: number processedCount: type: number required: - insertedCount - processedCount type: object IInsufficientCreditsResponse: additionalProperties: false properties: credits_available: type: number credits_required: type: number error: enum: - insufficient_credits type: string recommendations: $ref: "#/components/schemas/IBudgetRecommendations" tier: description: "Pricing tier of the requested kind: 1 = per-record, 2 = per-signal." enum: - 1 - 2 type: number window: $ref: "#/components/schemas/PublicJobWindow" required: - credits_available - credits_required - error - recommendations - tier - window type: object IIntelligenceRecordsJobResult: additionalProperties: false properties: content: items: $ref: "#/components/schemas/PublicRankedContent" type: array expandedQueries: items: type: string type: array generatedAt: type: string graph: additionalProperties: false properties: edges: items: additionalProperties: false properties: source: type: string target: type: string type: enum: - contains - creator_posted - semantic_similarity - tag_overlap - tagged_with type: string weight: type: number required: - source - target - type - weight type: object type: array nodes: items: additionalProperties: false properties: creatorId: type: number id: type: string label: type: string score: type: number type: enum: - content - creator - narrative - tag type: string required: - id - label - type type: object type: array required: - edges - nodes type: object query: type: string retrieval: additionalProperties: false properties: candidatesSeen: type: number filteredBreakdown: additionalProperties: false properties: canonical: type: number platform: type: number window: type: number required: - canonical - platform - window type: object filteredCandidates: type: number identityMatchedCandidates: type: number joinBreakdown: additionalProperties: false properties: contentPlatformId: type: number uuid: type: number weaviateId: type: number required: - contentPlatformId - uuid - weaviateId type: object joinedResults: type: number matchedCandidates: type: number mergeMethod: enum: - reciprocal_rank_fusion type: string resultsReturned: type: number tagWidening: additionalProperties: false properties: phaseAContentCount: type: number skipped: type: boolean source: enum: - none - phase_a_top_tags - query_hashtags type: string widenTags: items: type: string type: array widenedCount: type: number required: - phaseAContentCount - skipped - source - widenTags - widenedCount type: object unmatchedCandidates: type: number unmatchedSamples: items: additionalProperties: false properties: contentId: type: string nullable: true contentPlatformId: type: string nullable: true distance: type: number nullable: true matchedBy: enum: - contentPlatformId - uuid - weaviateId type: string nullable: true mediaType: type: string nullable: true platform: type: string nullable: true postgresCanonicalUuid: type: string nullable: true postgresPlatform: type: string nullable: true postgresPublishedAt: type: string nullable: true postgresUuid: type: string nullable: true rawSimilarity: type: number reason: enum: - no_postgres_identity_match - postgres_row_filtered_canonical - postgres_row_filtered_platform - postgres_row_filtered_window type: string rrfScore: type: number sourceUrl: type: string nullable: true weaviateObjectId: type: string nullable: true required: - contentId - contentPlatformId - distance - matchedBy - mediaType - platform - postgresCanonicalUuid - postgresPlatform - postgresPublishedAt - postgresUuid - rawSimilarity - reason - rrfScore - sourceUrl - weaviateObjectId type: object type: array vectorDiagnostics: items: additionalProperties: false properties: candidatesReturned: type: number error: type: string query: type: string status: enum: - failed - ok type: string targetVector: type: string required: - candidatesReturned - query - status - targetVector type: object type: array vectorTargets: items: type: string type: array required: - candidatesSeen - filteredBreakdown - filteredCandidates - identityMatchedCandidates - joinBreakdown - joinedResults - matchedCandidates - mergeMethod - resultsReturned - unmatchedCandidates - vectorDiagnostics - vectorTargets type: object type: enum: - kinetk.query_intelligence.search.v1 type: string window: enum: - 30d - 7d - all type: string required: - content - generatedAt - graph - query - type - window type: object IIntelligenceSignalsJobResult: additionalProperties: false properties: generatedAt: type: string nullable: true insights: items: type: string type: array narrativeInsights: items: type: string type: array query: type: string nullable: true tagInsights: items: type: string type: array type: type: string window: type: string nullable: true required: - generatedAt - insights - narrativeInsights - query - tagInsights - type - window type: object IJobStatusResponse: additionalProperties: false properties: completedAt: type: number error: type: string jobId: type: string kind: $ref: "#/components/schemas/JobKind" result: anyOf: - $ref: "#/components/schemas/IIntelligenceRecordsJobResult" - $ref: "#/components/schemas/IIntelligenceSignalsJobResult" - $ref: "#/components/schemas/ICampaignBriefJobResult" - $ref: "#/components/schemas/ILlmContextJobResult" startedAt: type: number status: $ref: "#/components/schemas/JobStatus" submittedAt: type: number required: - jobId - kind - status - submittedAt type: object IJobSubmitResponse: additionalProperties: false properties: dedup: type: boolean fromCache: type: boolean jobId: type: string result: anyOf: - $ref: "#/components/schemas/IIntelligenceRecordsJobResult" - $ref: "#/components/schemas/IIntelligenceSignalsJobResult" - $ref: "#/components/schemas/ICampaignBriefJobResult" - $ref: "#/components/schemas/ILlmContextJobResult" status: $ref: "#/components/schemas/JobStatus" statusUrl: type: string required: - jobId - status type: object ILlmContextJobResult: additionalProperties: false properties: context: additionalProperties: false properties: campaign: type: string creators: items: additionalProperties: false properties: amplifier_score: type: number content_count: type: number follower_count: type: number nullable: true id: type: number platform: type: string total_engagement: type: number required: - amplifier_score - content_count - id - platform - total_engagement type: object type: array graph: additionalProperties: false properties: edges: items: additionalProperties: false properties: source: type: string target: type: string type: enum: - contains - creator_posted - semantic_similarity - tag_overlap - tagged_with type: string weight: type: number required: - source - target - type - weight type: object type: array nodes: items: additionalProperties: false properties: creatorId: type: number id: type: string label: type: string score: type: number type: enum: - content - creator - narrative - tag type: string required: - id - label - type type: object type: array required: - edges - nodes type: object input: additionalProperties: false properties: campaign: type: string platforms: items: type: string type: array tone: default: specific, evidence-backed type: string window: $ref: "#/components/schemas/NarrativeWindow" required: - campaign - platforms - tone - window type: object narratives: items: additionalProperties: false properties: content_count: type: number creator_count: type: number emerging_score: type: number id: type: string label: type: string momentum_score: type: number platform_count: type: number score_breakdown: additionalProperties: false properties: creatorDiversity: type: number engagementStrength: type: number platformSpread: type: number recencyStrength: type: number required: - creatorDiversity - engagementStrength - platformSpread - recencyStrength type: object summary: type: string top_tags: items: type: string type: array total_engagement: type: number required: - content_count - creator_count - emerging_score - id - label - momentum_score - platform_count - score_breakdown - summary - top_tags - total_engagement type: object type: array platformOpportunities: items: additionalProperties: false properties: avgEngagement: type: number baselineEngagement: type: number contentCount: type: number creatorCount: type: number dominantPlatform: type: string engagementPremiumPct: type: number narrativeId: type: string narrativeLabel: type: string opportunity: type: string opportunityScore: type: number platformConcentration: type: number platformDistribution: $ref: "#/components/schemas/Record" required: - avgEngagement - baselineEngagement - contentCount - creatorCount - dominantPlatform - engagementPremiumPct - narrativeId - narrativeLabel - opportunity - opportunityScore - platformConcentration - platformDistribution type: object type: array representativeContent: items: additionalProperties: false properties: comment_count: type: number description: type: string nullable: true like_count: type: number platform: type: string nullable: true share_count: type: number tags: items: type: string type: array title: type: string nullable: true uuid: type: string view_count: type: number required: - comment_count - like_count - share_count - tags - uuid - view_count type: object type: array retrieval: additionalProperties: false properties: candidatesSeen: type: number filteredBreakdown: additionalProperties: false properties: canonical: type: number platform: type: number window: type: number required: - canonical - platform - window type: object filteredCandidates: type: number identityMatchedCandidates: type: number joinBreakdown: additionalProperties: false properties: contentPlatformId: type: number uuid: type: number weaviateId: type: number required: - contentPlatformId - uuid - weaviateId type: object joinedResults: type: number matchedCandidates: type: number mergeMethod: enum: - reciprocal_rank_fusion type: string resultsReturned: type: number tagWidening: additionalProperties: false properties: phaseAContentCount: type: number skipped: type: boolean source: enum: - none - phase_a_top_tags - query_hashtags type: string widenTags: items: type: string type: array widenedCount: type: number required: - phaseAContentCount - skipped - source - widenTags - widenedCount type: object unmatchedCandidates: type: number unmatchedSamples: items: additionalProperties: false properties: contentId: type: string nullable: true contentPlatformId: type: string nullable: true distance: type: number nullable: true matchedBy: enum: - contentPlatformId - uuid - weaviateId type: string nullable: true mediaType: type: string nullable: true platform: type: string nullable: true postgresCanonicalUuid: type: string nullable: true postgresPlatform: type: string nullable: true postgresPublishedAt: type: string nullable: true postgresUuid: type: string nullable: true rawSimilarity: type: number reason: enum: - no_postgres_identity_match - postgres_row_filtered_canonical - postgres_row_filtered_platform - postgres_row_filtered_window type: string rrfScore: type: number sourceUrl: type: string nullable: true weaviateObjectId: type: string nullable: true required: - contentId - contentPlatformId - distance - matchedBy - mediaType - platform - postgresCanonicalUuid - postgresPlatform - postgresPublishedAt - postgresUuid - rawSimilarity - reason - rrfScore - sourceUrl - weaviateObjectId type: object type: array vectorDiagnostics: items: additionalProperties: false properties: candidatesReturned: type: number error: type: string query: type: string status: enum: - failed - ok type: string targetVector: type: string required: - candidatesReturned - query - status - targetVector type: object type: array vectorTargets: items: type: string type: array required: - candidatesSeen - filteredBreakdown - filteredCandidates - identityMatchedCandidates - joinBreakdown - joinedResults - matchedCandidates - mergeMethod - resultsReturned - unmatchedCandidates - vectorDiagnostics - vectorTargets type: object sourceContentUuids: items: type: string type: array sourceNarrativeIds: items: type: string type: array topTags: items: type: string type: array required: - campaign - creators - graph - input - narratives - platformOpportunities - representativeContent - sourceContentUuids - sourceNarrativeIds - topTags type: object generatedAt: type: string recordCount: type: number type: enum: - kinetk.campaign_context.v1 type: string required: - context - generatedAt - recordCount - type type: object IQueryIntelligenceInput: additionalProperties: false properties: limit: type: number platforms: description: Platforms to filter by. Case-insensitive. items: enum: - instagram - pinterest - reddit - snapchat - tiktok - x type: string type: array query: type: string window: $ref: "#/components/schemas/PublicJobWindow" required: - limit - query - window type: object IQueryJobSubmitBody: additionalProperties: false properties: input: $ref: "#/components/schemas/IQueryIntelligenceInput" kind: enum: - intelligence_records type: string required: - input - kind type: object ISignalsJobInput: additionalProperties: false properties: query: type: string required: - query type: object ISignalsJobSubmitBody: additionalProperties: false properties: input: $ref: "#/components/schemas/ISignalsJobInput" kind: enum: - intelligence_signals type: string required: - input - kind type: object IUsageEntry: additionalProperties: false properties: balanceAfter: type: number credits: type: number jobId: type: string keyId: type: string kind: enum: - campaign_brief - intelligence_records - intelligence_signals - llm_context type: string occurredAt: type: string reason: type: string stripeDisputeId: type: string stripePaymentIntentId: type: string stripeRefundId: type: string txnId: type: string type: enum: - refund - reserve - reversal - settle - topup type: string window: type: string required: - credits - occurredAt - txnId - type type: object IUsageResponse: additionalProperties: false properties: accountId: type: string keyId: type: string nextCursor: type: string usage: items: $ref: "#/components/schemas/IUsageEntry" type: array required: - accountId - usage type: object JobKind: enum: - campaign_brief - intelligence_records - intelligence_signals - llm_context type: string JobStatus: enum: - failed - queued - running - succeeded type: string NarrativeWindow: enum: - 30d - 7d - all type: string PublicJobWindow: enum: - 30d - 7d - all type: string PublicRankedContent: additionalProperties: false properties: authorReach: type: number commentCount: type: number contentType: type: string nullable: true creatorId: type: number nullable: true description: type: string nullable: true engagementDepth: type: number engagementScore: type: number exampleRankingScore: type: number followerCount: type: number nullable: true likeCount: type: number platform: type: string nullable: true publishedAt: type: string nullable: true rawSimilarity: type: number recencyScore: type: number relevance: type: number rrfScore: type: number shareCount: type: number similarity: type: number subjectMatch: type: boolean tags: items: type: string type: array textRerankScore: type: number nullable: true title: type: string nullable: true uuid: type: string viewCount: type: number required: - authorReach - commentCount - engagementDepth - engagementScore - exampleRankingScore - likeCount - rawSimilarity - recencyScore - rrfScore - shareCount - similarity - tags - uuid - viewCount type: object "Record": additionalProperties: false type: object headers: CreditsUsed: description: Credits consumed by this call (reserved estimate on a 202; actual once settled). schema: type: number example: 4 CreditsRemaining: description: Account credit balance remaining after this call. schema: type: number example: 996