{"openapi":"3.1.0","info":{"title":"Good Stories AI Tools API","description":"The Good Stories Media Tech Lab API -- AI tools for storytellers and their AI agents, serving the Media & Entertainment industry.\n\nAuthenticate with your API key via the `X-API-Key` header.","version":"1.0.0"},"paths":{"/v1/auth/magic-link":{"post":{"tags":["Authentication"],"summary":"Request a customer sign-in link","description":"Send a Supabase sign-in link without exposing whether an account exists.","operationId":"request_customer_magic_link_v1_auth_magic_link_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/api/access/request":{"post":{"tags":["Authentication"],"summary":"Request a verified API-access link","description":"Register an API customer and send the link that establishes identity.\n\nSupplying an email here grants no key, checkout, data, or model access. All\naccount mutations remain behind ``require_session_user`` and derive their\nowner from the verified bearer token.","operationId":"request_api_access_v1_api_access_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiAccessRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/api-key":{"post":{"tags":["Authentication"],"summary":"Activate a free API key for the verified customer","description":"Mint a key for the session owner without accepting an email parameter.","operationId":"activate_account_api_key_v1_account_api_key_post","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyAccessResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/account/api-key/rotate":{"post":{"tags":["Authentication"],"summary":"Rotate the verified customer's API key","description":"Replace only the active key owned by the verified session identity.","operationId":"rotate_account_api_key_v1_account_api_key_rotate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyAccessResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/account/checkout":{"post":{"tags":["Billing"],"summary":"Create checkout for the verified customer","description":"Create subscription Checkout using only server-verified identity.","operationId":"account_checkout_v1_account_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/account/billing-portal":{"post":{"tags":["Billing"],"summary":"Open billing management for the verified customer","description":"Create a Stripe-hosted portal using only server-verified ownership.\n\nExisting customers must be able to manage or cancel a paid plan even while\nnew checkout is held. For that reason this route is intentionally\nindependent from ``CUSTOMER_BILLING_ENABLED``.","operationId":"account_billing_portal_v1_account_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/health":{"get":{"tags":["Public"],"summary":"Health Check","description":"Return service health status and version.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/llms.txt":{"get":{"tags":["Public"],"summary":"LLM-friendly site or API summary","description":"Serve a host-aware llms.txt file for AI agent discoverability.","operationId":"serve_llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/llms-full.txt":{"get":{"tags":["Public"],"summary":"LLM-friendly full API reference","description":"Serve the llms-full.txt file with comprehensive API documentation for AI agents.","operationId":"serve_llms_full_txt_llms_full_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/audit":{"post":{"tags":["SEO"],"summary":"SEO Audit","description":"Perform an on-page SEO audit of the given URL.\n\nFetches the page, analyzes title tags, meta descriptions, heading\nstructure, and content length. Returns a structured report with\nindividual scores and an overall score.","operationId":"seo_audit_v1_audit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/summarize":{"post":{"tags":["AI Content"],"summary":"Summarize Text","description":"Summarize content in the requested style.\n\nReturns a condensed version, key points, and takeaways using the configured\nLLM routing backend.","operationId":"summarize_text_v1_summarize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/rewrite":{"post":{"tags":["AI Content"],"summary":"Rewrite Text","description":"Rewrite content in the specified tone.\n\nReturns the rewritten text using the configured LLM routing backend.","operationId":"rewrite_text_v1_rewrite_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RewriteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RewriteResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/extract":{"post":{"tags":["AI Content"],"summary":"Extract Structured Data","description":"Extract structured data from unstructured text.\n\nProvide a schema describing the fields you want and the AI will pull\nmatching data from the text using the configured LLM routing backend.","operationId":"extract_data_v1_extract_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/jobs":{"post":{"tags":["AI Content"],"summary":"Enqueue an async AI job","description":"Queue an AI task (summarize/rewrite/extract) for async processing.\n\nReturns immediately with a job id; poll GET /v1/jobs/{id} or subscribe to\nthe job row via Supabase Realtime for the result. The synchronous endpoints\nremain available unchanged for callers that want an inline response.","operationId":"enqueue_ai_job_v1_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobEnqueueRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobEnqueueResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/jobs/{job_id}":{"get":{"tags":["AI Content"],"summary":"Get async AI job status/result","description":"Fetch a job's status and result, strictly scoped to the caller's org so a\nkey cannot read another tenant's jobs.","operationId":"get_ai_job_v1_jobs__job_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatusResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/search":{"post":{"tags":["Search"],"summary":"Semantic Search","description":"Search the memory index using semantic similarity.\n\nEmbeds the query using sentence-transformers, then computes cosine\nsimilarity against all indexed entries. Filters by category and\nsimilarity threshold.","operationId":"semantic_search_v1_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/usage/stats":{"get":{"tags":["Analytics"],"summary":"API usage statistics","description":"Get API usage statistics for the authenticated key.","operationId":"get_usage_stats_v1_usage_stats_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","description":"Period: today, week, month, all","default":"today","title":"Period"},"description":"Period: today, week, month, all"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/content/generate":{"post":{"tags":["Good Stories Lab"],"summary":"AI-generate a content draft","description":"Generate a new content draft from a topic using AI.\n\nIf schema_name is provided, injects RevDoc schema rules into the AI prompt\nand auto-validates the generated output.","operationId":"generate_content_draft_v1_content_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentGenerateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/content/validate":{"post":{"tags":["Good Stories Lab"],"summary":"Validate content against a RevDoc schema","description":"Validate content against a named RevDoc schema. Returns structured errors, warnings, and a score.","operationId":"validate_content_v1_content_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentValidateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/content/schemas":{"get":{"tags":["Good Stories Lab"],"summary":"List available RevDoc schemas","description":"List all available RevDoc content schemas.","operationId":"list_content_schemas_v1_content_schemas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/content/schemas/{name}":{"get":{"tags":["Good Stories Lab"],"summary":"Get a RevDoc schema definition","description":"Get the full definition of a named RevDoc schema.","operationId":"get_content_schema_v1_content_schemas__name__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/content/prism/compile":{"post":{"tags":["Good Stories Lab"],"summary":"Compile Prism source to all target platforms","description":"Compile a Prism source document into platform-native outputs.\n\nIf fill_gaps is True, uses AI to generate content for platforms\nthat lack tagged sections.","operationId":"prism_compile_v1_content_prism_compile_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrismCompileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/content/render":{"post":{"tags":["Good Stories Lab"],"summary":"Render a LiveBlocks document to HTML","description":"Render a LiveBlocks document. Server mode resolves all blocks.\nStatic mode resolves to defaults or strips interactive blocks.","operationId":"render_liveblocks_v1_content_render_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveBlocksRenderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/content/pipeline/run":{"post":{"tags":["Good Stories Lab"],"summary":"Start a content pipeline run","description":"Start a new pipeline run for a content draft.","operationId":"start_pipeline_run_v1_content_pipeline_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/content/pipeline/runs":{"get":{"tags":["Good Stories Lab"],"summary":"List pipeline runs","description":"List active and recent pipeline runs.","operationId":"list_pipeline_runs_v1_content_pipeline_runs_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: running, paused, completed, failed","title":"Status"},"description":"Filter by status: running, paused, completed, failed"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/content/pipeline/runs/{run_id}":{"get":{"tags":["Good Stories Lab"],"summary":"Get pipeline run status","description":"Get full status and stage history for a pipeline run.","operationId":"get_pipeline_run_v1_content_pipeline_runs__run_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/content/pipeline/advance/{run_id}":{"post":{"tags":["Good Stories Lab"],"summary":"Advance pipeline to next stage","description":"Advance a paused pipeline run to the next stage (e.g. after human review).","operationId":"advance_pipeline_run_v1_content_pipeline_advance__run_id__post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineAdvanceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/patterns/search":{"post":{"tags":["Story Patterns"],"summary":"Search Narrative Patterns","description":"Search for narrative patterns using semantic similarity and/or filters.\n\nAt least one of query, category, name, or source is required.\nWhen query is provided, results are ranked by semantic similarity.","operationId":"pattern_search_v1_patterns_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternSearchResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/patterns/stats":{"get":{"tags":["Story Patterns"],"summary":"Pattern Database Statistics","description":"Get overview statistics for the Story Patterns database.","operationId":"pattern_stats_v1_patterns_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternStatsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/patterns/categories":{"get":{"tags":["Story Patterns"],"summary":"List Pattern Categories","description":"List the 7 narrative pattern categories with descriptions and examples.","operationId":"pattern_categories_v1_patterns_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/patterns/{pattern_id}":{"get":{"tags":["Story Patterns"],"summary":"Get Pattern by ID","description":"Fetch a single narrative pattern by UUID.","operationId":"pattern_by_id_v1_patterns__pattern_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"pattern_id","in":"path","required":true,"schema":{"type":"string","title":"Pattern Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternResult"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApiAccessRequest":{"properties":{"email":{"type":"string","maxLength":254,"minLength":5,"title":"Email"},"name":{"type":"string","maxLength":100,"title":"Name","default":""}},"type":"object","required":["email"],"title":"ApiAccessRequest","description":"Public registration input; this never grants access by itself."},"ApiCheckoutRequest":{"properties":{"plan":{"type":"string","enum":["pro","business"],"title":"Plan"}},"type":"object","required":["plan"],"title":"ApiCheckoutRequest","description":"A paid public plan selected after session verification."},"ApiKeyAccessResponse":{"properties":{"status":{"type":"string","title":"Status"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"key_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Hint"},"tier":{"type":"string","title":"Tier"},"daily_credit_limit":{"type":"integer","title":"Daily Credit Limit"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","tier","daily_credit_limit","message"],"title":"ApiKeyAccessResponse"},"AuditFinding":{"properties":{"category":{"type":"string","title":"Category"},"score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Score"},"details":{"type":"string","title":"Details"},"recommendation":{"type":"string","title":"Recommendation"}},"type":"object","required":["category","score","details","recommendation"],"title":"AuditFinding"},"AuditRequest":{"properties":{"url":{"type":"string","title":"Url","description":"The fully-qualified URL of the page to audit (e.g. https://example.com).","examples":["https://example.com"]}},"type":"object","required":["url"],"title":"AuditRequest","description":"Request body for the SEO audit endpoint."},"AuditResponse":{"properties":{"url":{"type":"string","title":"Url"},"overall_score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Overall Score"},"findings":{"items":{"$ref":"#/components/schemas/AuditFinding"},"type":"array","title":"Findings"},"fetched_at":{"type":"string","title":"Fetched At"}},"type":"object","required":["url","overall_score","findings","fetched_at"],"title":"AuditResponse"},"BatchValidateRequest":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":20,"minItems":1,"title":"Items","description":"List of {content, schema_name, platform?} objects to validate."}},"type":"object","required":["items"],"title":"BatchValidateRequest","description":"Validate multiple content pieces in one call."},"BlockEventRequest":{"properties":{"block_id":{"type":"string","minLength":1,"title":"Block Id"},"event_type":{"type":"string","pattern":"^(impression|click|scroll_reach|variant_assigned|section_visible)$","title":"Event Type"},"draft_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Id"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant"},"visitor_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visitor Hash"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["block_id","event_type"],"title":"BlockEventRequest","description":"Request body for recording a block engagement event."},"ContactFormRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"email":{"type":"string","maxLength":254,"minLength":5,"title":"Email"},"company":{"type":"string","maxLength":100,"title":"Company","default":""},"message":{"type":"string","maxLength":2000,"minLength":10,"title":"Message"},"source":{"type":"string","maxLength":50,"title":"Source","default":"landing-page"}},"type":"object","required":["name","email","message"],"title":"ContactFormRequest"},"ContentAuditRequest":{"properties":{"content_id":{"type":"string","title":"Content Id","description":"ID of the content draft being audited."},"action":{"type":"string","title":"Action","description":"Audit action: validated, approved, published, flagged, rejected."},"schema_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Name"},"validation_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Validation Score"},"notes":{"type":"string","title":"Notes","default":""}},"type":"object","required":["content_id","action"],"title":"ContentAuditRequest","description":"Request to log a content audit event."},"ContentBulkActionRequest":{"properties":{"ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Ids","description":"List of draft UUIDs"},"action":{"type":"string","pattern":"^(approve|discard|archive)$","title":"Action"}},"type":"object","required":["ids","action"],"title":"ContentBulkActionRequest","description":"Request body for bulk actions on drafts."},"ContentDraftUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Title"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"status":{"anyOf":[{"type":"string","pattern":"^(draft|awaiting_approval|approved|scheduled|posting|published|failed|discarded|archived)$"},{"type":"null"}],"title":"Status"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"publish_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publish At","description":"ISO 8601 datetime for scheduling"},"impressions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Impressions"},"clicks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Clicks"},"engagement_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Notes"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","title":"ContentDraftUpdate","description":"Request body for updating a content draft."},"ContentGenerateRequest":{"properties":{"topic":{"type":"string","maxLength":4000,"minLength":1,"title":"Topic","description":"Topic or brief to generate content about"},"platform":{"type":"string","pattern":"^(linkedin|twitter|email|blog|medium|reddit|gumroad_description|gumroad_update)$","title":"Platform"},"tone":{"type":"string","maxLength":50,"title":"Tone","description":"Tone: professional, casual, technical, persuasive","default":"professional"},"additional_instructions":{"type":"string","maxLength":4000,"title":"Additional Instructions","description":"Extra instructions for the AI","default":""},"schema_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Schema Name","description":"RevDoc schema for structured generation and validation"}},"type":"object","required":["topic","platform"],"title":"ContentGenerateRequest","description":"Request body for AI content generation."},"ContentRegenerateRequest":{"properties":{"instructions":{"type":"string","maxLength":4000,"title":"Instructions","description":"Instructions for how to change the content","default":""},"platform":{"anyOf":[{"type":"string","maxLength":64,"pattern":"^(linkedin|twitter|email|blog|medium|reddit|gumroad_description|gumroad_update)$"},{"type":"null"}],"title":"Platform","description":"Optionally change the target platform"}},"type":"object","title":"ContentRegenerateRequest","description":"Request body for regenerating an existing draft."},"ContentValidateRequest":{"properties":{"content":{"type":"string","minLength":1,"title":"Content","description":"The content text to validate"},"schema_name":{"type":"string","minLength":1,"title":"Schema Name","description":"Name of the RevDoc schema to validate against"},"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform","description":"Target platform for platform-specific rules"}},"type":"object","required":["content","schema_name"],"title":"ContentValidateRequest","description":"Request body for validating content against a RevDoc schema."},"CreditCheckoutRequest":{"properties":{"price_id":{"type":"string","title":"Price Id","description":"A configured credit-pack Stripe price ID."},"quantity":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Quantity","description":"Number of packs to buy.","default":1}},"type":"object","required":["price_id"],"title":"CreditCheckoutRequest","description":"Request body for buying a prepaid credit pack."},"CreditCheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"}},"type":"object","required":["checkout_url"],"title":"CreditCheckoutResponse"},"ErrorResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"ErrorResponse"},"ExtractRequest":{"properties":{"text":{"type":"string","maxLength":20000,"minLength":1,"title":"Text","description":"The source text to extract structured data from."},"schema":{"additionalProperties":true,"type":"object","title":"Schema","description":"A JSON object describing the fields to extract. Example: {\"name\": \"string\", \"email\": \"string\", \"company\": \"string\"}"}},"type":"object","required":["text","schema"],"title":"ExtractRequest","description":"Request body for the data extraction endpoint."},"ExtractResponse":{"properties":{"extracted":{"additionalProperties":true,"type":"object","title":"Extracted"}},"type":"object","required":["extracted"],"title":"ExtractResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status","default":"ok"},"version":{"type":"string","title":"Version","default":"1.0.0"},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["timestamp"],"title":"HealthResponse"},"IntelArticle":{"properties":{"title":{"type":"string","title":"Title"},"summary":{"type":"string","title":"Summary"},"source":{"type":"string","title":"Source","default":""},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"relevance_score":{"type":"number","title":"Relevance Score","default":0.0},"published_at":{"type":"string","title":"Published At","default":""},"file_path":{"type":"string","title":"File Path","default":""}},"type":"object","required":["title","summary"],"title":"IntelArticle"},"IntelFeedRequest":{"properties":{"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","description":"Domain filter: ai, logistics, saas, education, finance."},"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords","description":"Keywords to boost relevance scoring.","default":[]},"days":{"type":"integer","maximum":30.0,"minimum":1.0,"title":"Days","description":"How many days back to look.","default":1},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","description":"Max articles to return.","default":10},"min_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min Score","description":"Min relevance score (0-1).","default":0.0}},"type":"object","title":"IntelFeedRequest","description":"Request body for agent intel feed."},"IntelFeedResponse":{"properties":{"articles":{"items":{"$ref":"#/components/schemas/IntelArticle"},"type":"array","title":"Articles"},"count":{"type":"integer","title":"Count"},"query":{"additionalProperties":true,"type":"object","title":"Query"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["articles","count","query","generated_at"],"title":"IntelFeedResponse"},"JobEnqueueRequest":{"properties":{"type":{"type":"string","title":"Type","description":"Job type. One of: summarize, rewrite, extract."},"payload":{"additionalProperties":true,"type":"object","title":"Payload","description":"Input for the job, e.g. {\"text\": \"...\", \"style\": \"executive\"}."},"priority":{"type":"integer","title":"Priority","description":"Higher priority jobs are claimed first.","default":0}},"type":"object","required":["type"],"title":"JobEnqueueRequest","description":"Request body for enqueuing an async AI job."},"JobEnqueueResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"type":{"type":"string","title":"Type"}},"type":"object","required":["id","status","type"],"title":"JobEnqueueResponse"},"JobStatusResponse":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"status":{"type":"string","title":"Status"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["id","type","status"],"title":"JobStatusResponse"},"LiveBlocksRenderRequest":{"properties":{"content":{"type":"string","minLength":1,"title":"Content","description":"LiveBlocks document content"},"mode":{"type":"string","pattern":"^(server|static)$","title":"Mode","description":"Render mode","default":"server"},"visitor_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visitor Hash","description":"Visitor hash for A/B test assignment"},"draft_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Id","description":"Content draft ID for event linking"}},"type":"object","required":["content"],"title":"LiveBlocksRenderRequest","description":"Request body for rendering a LiveBlocks document."},"NewsletterSubscribeRequest":{"properties":{"email":{"type":"string","maxLength":254,"minLength":5,"title":"Email"},"source":{"type":"string","maxLength":80,"title":"Source","default":"newsletter"},"referring_site":{"type":"string","maxLength":255,"title":"Referring Site","default":""}},"type":"object","required":["email"],"title":"NewsletterSubscribeRequest"},"NewsletterSubscribeResponse":{"properties":{"status":{"type":"string","title":"Status","default":"ok"},"provider":{"type":"string","title":"Provider","default":"beehiiv"},"signup_state":{"type":"string","title":"Signup State"},"message":{"type":"string","title":"Message"},"source":{"type":"string","title":"Source"},"next_step":{"type":"string","title":"Next Step"},"unsubscribe_note":{"type":"string","title":"Unsubscribe Note"},"privacy_url":{"type":"string","title":"Privacy Url"}},"type":"object","required":["signup_state","message","source","next_step","unsubscribe_note","privacy_url"],"title":"NewsletterSubscribeResponse"},"PatternResult":{"properties":{"id":{"type":"string","title":"Id"},"pattern_category":{"type":"string","title":"Pattern Category"},"pattern_name":{"type":"string","title":"Pattern Name"},"pattern_explanation":{"type":"string","title":"Pattern Explanation"},"confidence":{"type":"integer","title":"Confidence"},"article_title":{"type":"string","title":"Article Title"},"article_source":{"type":"string","title":"Article Source"},"article_url":{"type":"string","title":"Article Url"},"article_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Article Date"},"similarity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity"}},"type":"object","required":["id","pattern_category","pattern_name","pattern_explanation","confidence","article_title","article_source","article_url"],"title":"PatternResult"},"PatternSearchRequest":{"properties":{"query":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Query","description":"Natural language semantic search query."},"category":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Category","description":"Filter by pattern category: archetype, conflict, structure, hook, angle, tension, beat."},"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name","description":"Filter by pattern name (partial match, case-insensitive)."},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Source","description":"Filter by article source (partial match, case-insensitive)."},"min_confidence":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Min Confidence","description":"Minimum confidence score (1-5). Default 3.","default":3},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","description":"Maximum number of results. Default 20.","default":20},"threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Threshold","description":"Minimum similarity score for semantic search (0-1). Default 0.3.","default":0.3}},"type":"object","title":"PatternSearchRequest","description":"Request body for Story Patterns semantic + filtered search."},"PatternSearchResponse":{"properties":{"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"results":{"items":{"$ref":"#/components/schemas/PatternResult"},"type":"array","title":"Results"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["query","results","count"],"title":"PatternSearchResponse"},"PatternStatsResponse":{"properties":{"total_patterns":{"type":"integer","title":"Total Patterns"},"by_category":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Category"},"by_source":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Source"},"latest_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Date"},"sources_count":{"type":"integer","title":"Sources Count"}},"type":"object","required":["total_patterns","by_category","by_source","latest_date","sources_count"],"title":"PatternStatsResponse"},"PipelineAdvanceRequest":{"properties":{"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Optional data for next stage"}},"type":"object","title":"PipelineAdvanceRequest","description":"Request body for advancing a pipeline stage."},"PipelineRunRequest":{"properties":{"pipeline":{"type":"string","minLength":1,"title":"Pipeline","description":"Pipeline name (e.g. 'product-launch')"},"draft_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Id","description":"Existing content_drafts UUID to run through pipeline"},"publish_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publish At","description":"ISO 8601 datetime for schedule stage"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["pipeline"],"title":"PipelineRunRequest","description":"Request body for starting a pipeline run."},"PrismCompileRequest":{"properties":{"content":{"type":"string","maxLength":30000,"minLength":1,"title":"Content","description":"Prism source document content"},"platforms":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":4},{"type":"null"}],"title":"Platforms","description":"Override target platforms (uses frontmatter if omitted)"},"fill_gaps":{"type":"boolean","title":"Fill Gaps","description":"Use AI to generate content for platforms without tagged sections","default":true}},"type":"object","required":["content"],"title":"PrismCompileRequest","description":"Request body for compiling a Prism source document."},"PrismPublishRequest":{"properties":{"content":{"type":"string","maxLength":30000,"minLength":1,"title":"Content","description":"Prism source document content"},"platforms":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":4},{"type":"null"}],"title":"Platforms","description":"Override target platforms"},"fill_gaps":{"type":"boolean","title":"Fill Gaps","description":"Use AI to generate content for platforms without tagged sections","default":true},"status":{"type":"string","pattern":"^(draft|awaiting_approval|approved|scheduled)$","title":"Status","default":"draft"},"publish_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publish At","description":"ISO 8601 datetime for scheduling all outputs"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Tags to apply to all generated drafts"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Category for all generated drafts"}},"type":"object","required":["content"],"title":"PrismPublishRequest","description":"Request body for compiling and publishing to content_drafts."},"RewriteRequest":{"properties":{"text":{"type":"string","maxLength":20000,"minLength":1,"title":"Text","description":"The text content to rewrite."},"tone":{"$ref":"#/components/schemas/RewriteTone","description":"Desired tone: professional, friendly, persuasive, or academic."}},"type":"object","required":["text","tone"],"title":"RewriteRequest","description":"Request body for the content rewriter endpoint."},"RewriteResponse":{"properties":{"tone":{"type":"string","title":"Tone"},"rewritten_text":{"type":"string","title":"Rewritten Text"}},"type":"object","required":["tone","rewritten_text"],"title":"RewriteResponse"},"RewriteTone":{"type":"string","enum":["professional","friendly","persuasive","academic"],"title":"RewriteTone"},"SearchRequest":{"properties":{"query":{"type":"string","minLength":1,"title":"Query","description":"Natural language search query."},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Filter by category: soul, user, daily, projects, meetings, archive, intel."},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","description":"Maximum number of results to return.","default":10},"threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Threshold","description":"Minimum similarity score (0-1). Higher = stricter matching. Default 0.3.","default":0.3}},"type":"object","required":["query"],"title":"SearchRequest","description":"Request body for semantic search."},"SearchResponse":{"properties":{"query":{"type":"string","title":"Query"},"results":{"items":{"$ref":"#/components/schemas/SearchResult"},"type":"array","title":"Results"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["query","results","count"],"title":"SearchResponse"},"SearchResult":{"properties":{"file_path":{"type":"string","title":"File Path"},"category":{"type":"string","title":"Category"},"title":{"type":"string","title":"Title"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"summary":{"type":"string","title":"Summary"},"similarity":{"type":"number","title":"Similarity"}},"type":"object","required":["file_path","category","title","tags","summary","similarity"],"title":"SearchResult"},"StoryLensRequest":{"properties":{"text":{"type":"string","maxLength":600,"minLength":30,"title":"Text"}},"type":"object","required":["text"],"title":"StoryLensRequest"},"StoryLensResponse":{"properties":{"mode":{"type":"string","const":"deterministic_preview","title":"Mode","default":"deterministic_preview"},"pattern":{"type":"string","title":"Pattern"},"signal":{"type":"string","title":"Signal"},"next_question":{"type":"string","title":"Next Question"},"match_strength":{"type":"string","enum":["exploratory","moderate","strong"],"title":"Match Strength"},"note":{"type":"string","title":"Note","default":"Rule-based preview; no model call and no submitted text is stored."}},"type":"object","required":["pattern","signal","next_question","match_strength"],"title":"StoryLensResponse"},"SummarizeRequest":{"properties":{"text":{"type":"string","maxLength":20000,"minLength":1,"title":"Text","description":"The text content to summarize."},"style":{"$ref":"#/components/schemas/SummarizeStyle","description":"Summary style: executive, academic, or casual."}},"type":"object","required":["text","style"],"title":"SummarizeRequest","description":"Request body for the content summarizer endpoint."},"SummarizeResponse":{"properties":{"style":{"type":"string","title":"Style"},"condensed":{"type":"string","title":"Condensed"},"key_points":{"items":{"type":"string"},"type":"array","title":"Key Points"},"takeaways":{"items":{"type":"string"},"type":"array","title":"Takeaways"}},"type":"object","required":["style","condensed","key_points","takeaways"],"title":"SummarizeResponse"},"SummarizeStyle":{"type":"string","enum":["executive","academic","casual"],"title":"SummarizeStyle"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VideoStatusResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"video_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Video Url"},"message":{"type":"string","title":"Message"}},"type":"object","required":["job_id","status","message"],"title":"VideoStatusResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"},"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}}}