{"openapi":"3.0.0","components":{"examples":{},"headers":{},"parameters":{},"requestBodies":{},"responses":{},"schemas":{"WorkspaceWebhookEventType":{"type":"string","enum":["review.mentioned","review.replied","article.updated"]},"WorkspaceWebhook":{"properties":{"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"active":{"type":"boolean"},"events":{"items":{"$ref":"#/components/schemas/WorkspaceWebhookEventType"},"type":"array"},"url":{"type":"string"},"workspaceId":{"type":"string"},"webhookId":{"type":"string"}},"required":["updatedAt","createdAt","active","events","url","workspaceId","webhookId"],"type":"object"},"CreateWorkspaceWebhookResponse":{"allOf":[{"$ref":"#/components/schemas/WorkspaceWebhook"},{"properties":{"secret":{"type":"string","description":"Returned once. Store it securely; mdedit cannot reveal it again."}},"required":["secret"],"type":"object"}]},"CreateWorkspaceWebhookRequest":{"properties":{"events":{"items":{"$ref":"#/components/schemas/WorkspaceWebhookEventType"},"type":"array"},"url":{"type":"string"}},"required":["url"],"type":"object"},"UpdateWorkspaceWebhookRequest":{"properties":{"rotateSecret":{"type":"boolean"},"active":{"type":"boolean"},"events":{"items":{"$ref":"#/components/schemas/WorkspaceWebhookEventType"},"type":"array"},"url":{"type":"string"}},"type":"object"},"ArticleType":{"type":"string","enum":["explanation","tutorial","how_to","reference","comparison"],"description":"Primary article type — the reader need this piece serves.\n\n- explanation: understanding-oriented (mental model / why / how it works)\n- tutorial: learning-oriented (guided lesson; end-to-end result)\n- how_to: task-oriented (solve a specific problem; assumes baseline competence)\n- reference: lookup-oriented (scannable facts, tables, definitions)\n- comparison: decision-oriented (criteria + tradeoffs; may or may not recommend)"},"ArticleFormat":{"type":"string","enum":["default","q_and_a","listicle","checklist","cheatsheet"],"description":"Optional presentation format hint. This should influence structure without\nredefining the underlying intent (ArticleType)."},"ComparisonRecommendationMode":{"type":"string","enum":["required","allowed","forbidden"]},"ContentType":{"type":"string","enum":["tutorial","guide","comparison","integration","migration","troubleshooting","listicle"]},"SeoIntent":{"type":"string","enum":["informational","commercial","navigational","transactional"],"description":"Content project topics + audit events.\n\nThese types mirror the backend contracts under:\n`/workspaces/{workspaceId}/topics`"},"ContentTopicSerpSummary":{"properties":{"topDomains":{"items":{"type":"string"},"type":"array"},"topTitles":{"items":{"type":"string"},"type":"array"},"provider":{"type":"string"},"queriedAt":{"type":"number","format":"double"}},"required":["topDomains","topTitles","provider","queriedAt"],"type":"object","additionalProperties":false},"ContentTopicKeywordMetrics":{"properties":{"volume":{"type":"number","format":"double","description":"Monthly search volume for the primary keyword."},"globalVolume":{"type":"number","format":"double","description":"Worldwide monthly search volume for the primary keyword."},"difficulty":{"type":"number","format":"double","description":"Keyword difficulty 0–100."},"cpc":{"type":"number","format":"double","description":"Cost-per-click in USD."},"trend":{"items":{"type":"number","format":"double"},"type":"array","description":"12 monthly search volume values, oldest first."},"fetchedAt":{"type":"number","format":"double","description":"Unix seconds when metrics were fetched."},"provider":{"type":"string","description":"Provider that supplied the metrics, e.g. 'dataforseo'."},"locale":{"type":"string","description":"BCP-47 locale used for the market-specific volume."}},"required":["fetchedAt","provider"],"type":"object","additionalProperties":false},"SourceEvidenceType":{"type":"string","enum":["own_site","competitor","third_party","community","docs","workspace","serp","manual"]},"ContentTopicSourceEvidence":{"properties":{"url":{"type":"string"},"title":{"type":"string"},"snippet":{"type":"string"},"sourceType":{"$ref":"#/components/schemas/SourceEvidenceType"},"query":{"type":"string"},"statusCode":{"type":"number","format":"double"},"relevance":{"type":"string"},"capturedAt":{"type":"string"}},"required":["url","sourceType","relevance","capturedAt"],"type":"object","additionalProperties":false},"EvidenceQuality":{"type":"string","enum":["strong","adequate","weak"]},"GenerationQualityTier":{"type":"string","enum":["fast","deep"]},"WordCountRange":{"properties":{"min":{"type":"number","format":"double"},"max":{"type":"number","format":"double"}},"required":["min","max"],"type":"object","additionalProperties":false},"TopicStatus":{"type":"string","enum":["idea","shortlisted","outlined","drafted","archived"],"description":"Lifecycle states for a content topic.\n\n  idea → shortlisted → outlined → drafted\n                    ↘ archived (from any state)\n\n\"published\" is intentionally absent; publish state is derived from\nthe linked MdhArticleV2 record."},"Exclude_TopicStatus.archived_":{"type":"string","enum":["idea","shortlisted","outlined","drafted"],"description":"Exclude from T those types that are assignable to U"},"ContentTopicArchiveReason":{"type":"string","enum":["manual","content_project_archived","rerank_duplicate","rerank_quality","rerank_cap","regenerate_replaced","quality_tier_changed"]},"ContentTopicApprovals":{"properties":{"outline":{"properties":{"note":{"type":"string"},"approvedBy":{"type":"string"},"approvedAt":{"type":"number","format":"double"}},"required":["approvedBy","approvedAt"],"type":"object"},"draft":{"properties":{"note":{"type":"string"},"approvedBy":{"type":"string"},"approvedAt":{"type":"number","format":"double"}},"required":["approvedBy","approvedAt"],"type":"object"}},"type":"object","additionalProperties":false},"ContentPerformanceTrackingStatus":{"type":"string","enum":["untracked","tracking_pending","tracking_active","needs_attention"]},"ContentPerformanceTargetSource":{"type":"string","enum":["manual_url","primary_external_publication"]},"ContentPerformanceSyncStatus":{"type":"string","enum":["synced","untracked","needs_connection","needs_resource","failed"]},"ContentTopicPerformanceTarget":{"properties":{"status":{"$ref":"#/components/schemas/ContentPerformanceTrackingStatus"},"source":{"$ref":"#/components/schemas/ContentPerformanceTargetSource"},"url":{"type":"string"},"canonicalUrl":{"type":"string"},"domain":{"type":"string"},"path":{"type":"string"},"externalPublicationId":{"type":"string"},"externalPublicationStatus":{"type":"string"},"title":{"type":"string"},"submittedAt":{"type":"number","format":"double"},"submittedBy":{"type":"string"},"lastVerifiedAt":{"type":"number","format":"double"},"lastVerificationError":{"type":"string"},"firstMetricDate":{"type":"string"},"lastSyncStatus":{"$ref":"#/components/schemas/ContentPerformanceSyncStatus"},"lastSyncedAt":{"type":"number","format":"double"},"lastSuccessfulSyncAt":{"type":"number","format":"double"},"lastMetricDate":{"type":"string"},"lastSyncError":{"type":"string"}},"required":["status"],"type":"object","additionalProperties":false},"RecommendedAction":{"type":"string","enum":["CREATE","UPDATE","REWRITE","OPTIMISE"]},"RankProximity":{"type":"string","enum":["page-1","striking-distance","not-ranking"]},"ContentTopic":{"description":"A single topic candidate — the output of the Topic Research Agent or a\nuser-created entry.  Stored in MdhContentTopics.","properties":{"topicId":{"type":"string","description":"PK – UUID"},"shortId":{"type":"string","description":"Workspace-scoped public handle, e.g. \"brief-12\"."},"slug":{"type":"string","description":"Stable readable slug for URL decoration."},"contentProjectId":{"type":"string","description":"Optional folderId of the content project this topic belongs to.\n\nTopics may also be standalone (no content project)."},"workspaceId":{"type":"string","description":"Workspace that owns this topic"},"ownerId":{"type":"string","description":"Owner / creator username"},"title":{"type":"string"},"seoTitle":{"type":"string","description":"Optional SEO/meta title candidate for publishing surfaces. Human-facing H1 remains `title`."},"articleType":{"$ref":"#/components/schemas/ArticleType","description":"New taxonomy fields. During migration, older records may still only have\n`contentType` populated; treat these as optional at the type level and\ncoerce at read time."},"articleFormat":{"$ref":"#/components/schemas/ArticleFormat"},"comparisonRecommendationMode":{"$ref":"#/components/schemas/ComparisonRecommendationMode"},"contentType":{"$ref":"#/components/schemas/ContentType","description":"Legacy field (pre Diátaxis taxonomy). Kept temporarily so older records can\nbe read and migrated without runtime failures."},"targetAudience":{"type":"string"},"estimatedIntent":{"$ref":"#/components/schemas/SeoIntent"},"priorityScore":{"type":"number","format":"double","description":"0–100, computed by agent or set manually"},"priorityRationale":{"type":"string"},"serpSummary":{"$ref":"#/components/schemas/ContentTopicSerpSummary"},"keywordMetrics":{"$ref":"#/components/schemas/ContentTopicKeywordMetrics","description":"Keyword metrics fetched at generation time (volume, difficulty, CPC, trend)."},"seoBriefRevision":{"type":"number","format":"double","description":"Current revision of the separately stored SEO brief."},"outlineSeoBriefRevision":{"type":"number","format":"double","description":"SEO brief revision used to produce the latest outline."},"draftSeoBriefRevision":{"type":"number","format":"double","description":"SEO brief revision used to produce the latest draft."},"seoReviewSeoBriefRevision":{"type":"number","format":"double","description":"SEO brief revision used by the latest SEO review."},"cluster":{"type":"string","description":"Optional cluster label, e.g. \"auth\", \"payments\""},"angles":{"items":{"type":"string"},"type":"array","description":"Key subtopics/angles to cover for this topic."},"mustInclude":{"items":{"type":"string"},"type":"array","description":"Important concepts, APIs, or constraints to include."},"suggestedSources":{"items":{"properties":{"why":{"type":"string"},"url":{"type":"string"}},"required":["why","url"],"type":"object"},"type":"array","description":"Suggested sources to consult (prefer authoritative project URLs)."},"sourceEvidence":{"items":{"$ref":"#/components/schemas/ContentTopicSourceEvidence"},"type":"array","description":"Observed research evidence supporting this article brief."},"searchedQueries":{"items":{"type":"string"},"type":"array","description":"Queries directly relevant to this article brief."},"contentGap":{"type":"string","description":"Evidence-backed reason this brief is worth creating or improving."},"evidenceQuality":{"$ref":"#/components/schemas/EvidenceQuality"},"generatedQualityTier":{"$ref":"#/components/schemas/GenerationQualityTier","description":"Immutable provenance for the tier that generated this brief."},"briefQualityScore":{"type":"number","format":"double"},"productRelevanceScore":{"type":"number","format":"double"},"evidenceScore":{"type":"number","format":"double"},"originalityScore":{"type":"number","format":"double"},"keywordCoverageScore":{"type":"number","format":"double"},"duplicateRiskScore":{"type":"number","format":"double"},"critiqueSummary":{"type":"string"},"editorialFieldsEditedAt":{"type":"number","format":"double"},"editorialFieldsEditedBy":{"type":"string"},"thesis":{"type":"string"},"readerPain":{"type":"string"},"productTieIn":{"type":"string"},"evidencePlan":{"items":{"type":"string"},"type":"array"},"originalityAngle":{"type":"string"},"avoidAngle":{"type":"string"},"primaryKeyword":{"type":"string","description":"Primary SEO keyword phrase."},"secondaryKeywords":{"items":{"type":"string"},"type":"array","description":"Secondary SEO keyword phrases."},"wordCountRange":{"$ref":"#/components/schemas/WordCountRange","description":"Optional article-length override. Takes precedence over the content-project default."},"status":{"$ref":"#/components/schemas/TopicStatus"},"archivedAt":{"type":"number","format":"double"},"archivedBy":{"type":"string"},"archivedFromStatus":{"$ref":"#/components/schemas/Exclude_TopicStatus.archived_"},"archivedByContentProjectId":{"type":"string"},"archiveReason":{"$ref":"#/components/schemas/ContentTopicArchiveReason"},"archiveNote":{"type":"string"},"scheduledDate":{"type":"string","description":"ISO date string, e.g. \"2026-04-15\""},"scheduleNote":{"type":"string","description":"Optional user note for this schedule entry"},"approvals":{"$ref":"#/components/schemas/ContentTopicApprovals"},"articleId":{"type":"string","description":"FK to MdhArticleV2 once outline/draft is committed"},"performanceTarget":{"$ref":"#/components/schemas/ContentTopicPerformanceTarget","description":"Cowrite-only published URL used as the source of truth for performance tracking."},"recommendedAction":{"$ref":"#/components/schemas/RecommendedAction","description":"Recommended content action based on SERP analysis and workspace content check."},"rankProximity":{"$ref":"#/components/schemas/RankProximity","description":"Domain ranking proximity for striking-distance detection (deep research mode)."},"agentRunId":{"type":"string","description":"Run that generated this topic"},"outlineRunId":{"type":"string","description":"Latest outline-stage run for this topic, including terminal runs (CoWrite)."},"draftRunId":{"type":"string","description":"Latest draft-stage run for this topic, including terminal runs (CoWrite)."},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"}},"required":["topicId","workspaceId","ownerId","title","targetAudience","estimatedIntent","priorityScore","priorityRationale","status","createdAt","updatedAt"],"type":"object","additionalProperties":false},"Record_TopicStatus.number_":{"properties":{"idea":{"type":"number","format":"double"},"shortlisted":{"type":"number","format":"double"},"outlined":{"type":"number","format":"double"},"drafted":{"type":"number","format":"double"},"archived":{"type":"number","format":"double"}},"required":["idea","shortlisted","outlined","drafted","archived"],"type":"object","description":"Construct a type with a set of properties K of type T"},"TopicStatusCounts":{"$ref":"#/components/schemas/Record_TopicStatus.number_"},"WorkspaceListTopicsResponse":{"properties":{"topics":{"items":{"$ref":"#/components/schemas/ContentTopic"},"type":"array"},"nextToken":{"type":"string"},"statusCounts":{"$ref":"#/components/schemas/TopicStatusCounts"}},"required":["topics"],"type":"object","additionalProperties":false},"WorkspaceCreateTopicResponse":{"properties":{"topicId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"status":{"$ref":"#/components/schemas/TopicStatus"},"createdAt":{"type":"number","format":"double"}},"required":["topicId","shortId","slug","status","createdAt"],"type":"object","additionalProperties":false},"TopicSuggestedSourceRequest":{"properties":{"url":{"type":"string"},"why":{"type":"string"}},"required":["url","why"],"type":"object","additionalProperties":false},"WorkspaceCreateTopicRequest":{"properties":{"title":{"type":"string"},"seoTitle":{"type":"string"},"articleType":{"$ref":"#/components/schemas/ArticleType","description":"New taxonomy (preferred)."},"articleFormat":{"$ref":"#/components/schemas/ArticleFormat"},"comparisonRecommendationMode":{"$ref":"#/components/schemas/ComparisonRecommendationMode"},"contentType":{"$ref":"#/components/schemas/ContentType","description":"Legacy taxonomy (accepted for now; will be migrated away)."},"targetAudience":{"type":"string"},"estimatedIntent":{"type":"string"},"priorityScore":{"type":"number","format":"double"},"priorityRationale":{"type":"string"},"cluster":{"type":"string"},"scheduledDate":{"type":"string"},"scheduleNote":{"type":"string"},"contentProjectId":{"type":"string"},"angles":{"items":{"type":"string"},"type":"array"},"mustInclude":{"items":{"type":"string"},"type":"array"},"suggestedSources":{"items":{"$ref":"#/components/schemas/TopicSuggestedSourceRequest"},"type":"array"},"primaryKeyword":{"type":"string"},"secondaryKeywords":{"items":{"type":"string"},"type":"array"},"contentGap":{"type":"string"},"thesis":{"type":"string"},"readerPain":{"type":"string"},"productTieIn":{"type":"string"},"evidencePlan":{"items":{"type":"string"},"type":"array"},"originalityAngle":{"type":"string"},"avoidAngle":{"type":"string"},"wordCountRange":{"properties":{"max":{"type":"number","format":"double"},"min":{"type":"number","format":"double"}},"required":["max","min"],"type":"object","description":"Article length contract for this topic. Highest-precedence input to\ngeneration: it overrides the content project's default range and the\noutline model's own recommendation. Omit to keep that fallback chain."}},"required":["title","targetAudience"],"type":"object","additionalProperties":false},"ClassifyArticleTypeResponse":{"properties":{"articleType":{"$ref":"#/components/schemas/ArticleType"},"articleFormat":{"$ref":"#/components/schemas/ArticleFormat"},"comparisonRecommendationMode":{"$ref":"#/components/schemas/ComparisonRecommendationMode"},"confidence":{"type":"string","enum":["high","medium","low"]},"rationale":{"type":"string"}},"required":["articleType","articleFormat","confidence","rationale"],"type":"object","additionalProperties":false},"ClassifyArticleTypeRequest":{"properties":{"title":{"type":"string"},"seedText":{"type":"string","description":"Optional seed/outline notes for extra context."}},"required":["title"],"type":"object","additionalProperties":false},"SeoDistributionGoal":{"type":"string","enum":["traditional_search","ai_search_visibility"]},"SeoSerpPattern":{"type":"string","enum":["comparison","guide","tutorial","reference","product","mixed"]},"SeoKeywordRole":{"type":"string","enum":["primary","close_variant","supporting"]},"TopicSeoKeywordMetrics":{"properties":{"marketVolume":{"type":"number","format":"double"},"globalVolume":{"type":"number","format":"double"},"difficulty":{"type":"number","format":"double"},"cpc":{"type":"number","format":"double"},"trend":{"items":{"type":"number","format":"double"},"type":"array"},"provider":{"type":"string"},"fetchedAt":{"type":"number","format":"double"}},"required":["provider","fetchedAt"],"type":"object","additionalProperties":false},"TopicSeoKeywordTarget":{"properties":{"keyword":{"type":"string"},"role":{"$ref":"#/components/schemas/SeoKeywordRole"},"intent":{"$ref":"#/components/schemas/SeoIntent"},"metrics":{"$ref":"#/components/schemas/TopicSeoKeywordMetrics"}},"required":["keyword","role","intent"],"type":"object","additionalProperties":false},"TopicSeoKeywordCluster":{"properties":{"clusterId":{"type":"string"},"label":{"type":"string"},"readerNeed":{"type":"string"},"intent":{"$ref":"#/components/schemas/SeoIntent"},"terms":{"items":{"$ref":"#/components/schemas/TopicSeoKeywordTarget"},"type":"array"},"combinedMarketVolume":{"type":"number","format":"double"},"combinedGlobalVolume":{"type":"number","format":"double"}},"required":["clusterId","label","readerNeed","intent","terms"],"type":"object","additionalProperties":false},"KeywordMarketLocale":{"type":"string","enum":["en-US","en-GB","en-CA","en-AU"]},"SeoCheckStatus":{"type":"string","enum":["pass","warning","fail","not_checked"]},"TopicSeoReviewFinding":{"properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["low","medium","high"]},"message":{"type":"string"},"location":{"type":"string"}},"required":["code","severity","message"],"type":"object","additionalProperties":false},"SerpContentBenchmarkStatus":{"type":"string","enum":["live","cached","stale","partial","unavailable"]},"SerpContentBenchmarkSource":{"properties":{"url":{"type":"string"},"title":{"type":"string"},"position":{"type":"number","format":"double"},"fetchedAt":{"type":"string"},"wordCount":{"type":"number","format":"double"},"headings":{"items":{"type":"string"},"type":"array"},"lexicalCoverage":{"type":"string","enum":["complete","partial"],"description":"Whether lexical coverage used the complete page or a bounded excerpt."}},"required":["url","title","position","fetchedAt","wordCount","headings"],"type":"object","additionalProperties":false},"SerpContentBenchmarkTerm":{"properties":{"term":{"type":"string"},"competitorPageCount":{"type":"number","format":"double"},"articleOccurrences":{"type":"number","format":"double"},"covered":{"type":"boolean"}},"required":["term","competitorPageCount","articleOccurrences","covered"],"type":"object","additionalProperties":false},"SerpContentBenchmarkEntity":{"properties":{"entity":{"type":"string"},"competitorPageCount":{"type":"number","format":"double"},"articleOccurrences":{"type":"number","format":"double"},"covered":{"type":"boolean"}},"required":["entity","competitorPageCount","articleOccurrences","covered"],"type":"object","additionalProperties":false},"SerpContentBenchmarkHeading":{"properties":{"heading":{"type":"string"},"competitorPageCount":{"type":"number","format":"double"},"sourceUrls":{"items":{"type":"string"},"type":"array"},"covered":{"type":"boolean"}},"required":["heading","competitorPageCount","sourceUrls","covered"],"type":"object","additionalProperties":false},"SerpContentBenchmarkQuestion":{"properties":{"question":{"type":"string"},"snippet":{"type":"string"}},"required":["question"],"type":"object","additionalProperties":false},"SerpContentBenchmarkFailedSource":{"description":"A ranking page that was requested but could not be used as a competitor\nsource, so a partial or short corpus can be diagnosed without re-running the\nbenchmark. Bounded in size; it is a diagnostic sample, not an audit log.","properties":{"url":{"type":"string"},"reason":{"type":"string"}},"required":["url","reason"],"type":"object","additionalProperties":false},"SerpContentBenchmarkReport":{"properties":{"schemaVersion":{"type":"number","enum":[1],"nullable":false},"query":{"type":"string"},"status":{"$ref":"#/components/schemas/SerpContentBenchmarkStatus"},"generatedAt":{"type":"string"},"provider":{"type":"string"},"sourceCount":{"type":"number","format":"double"},"minimumSourcesForGrade":{"type":"number","format":"double"},"competitiveScore":{"type":"number","format":"double"},"grade":{"type":"string","enum":["A","B","C","D","F"]},"statusReason":{"type":"string"},"lexicalCoverage":{"type":"string","enum":["complete","partial"],"description":"Aggregate completeness of term/entity/heading evidence."},"sources":{"items":{"$ref":"#/components/schemas/SerpContentBenchmarkSource"},"type":"array"},"terms":{"items":{"$ref":"#/components/schemas/SerpContentBenchmarkTerm"},"type":"array"},"entities":{"items":{"$ref":"#/components/schemas/SerpContentBenchmarkEntity"},"type":"array"},"headings":{"items":{"$ref":"#/components/schemas/SerpContentBenchmarkHeading"},"type":"array"},"questions":{"items":{"$ref":"#/components/schemas/SerpContentBenchmarkQuestion"},"type":"array","description":"Searcher questions from the SERP. Absent for providers that do not return them."},"failedSources":{"items":{"$ref":"#/components/schemas/SerpContentBenchmarkFailedSource"},"type":"array","description":"Candidates dropped during this fetch pass (hard fetch failures and pages\ntoo thin to be real ranking content). Present only on reports built from a\nlive fetch; cached, stale, and re-scored reports omit it because it would\ndescribe a fetch pass that did not just happen."},"wordCount":{"properties":{"competitorMax":{"type":"number","format":"double"},"competitorMin":{"type":"number","format":"double"},"competitorMedian":{"type":"number","format":"double"},"article":{"type":"number","format":"double"}},"required":["article"],"type":"object"}},"required":["schemaVersion","query","status","generatedAt","provider","sourceCount","minimumSourcesForGrade","sources","terms","entities","headings","wordCount"],"type":"object","additionalProperties":false},"ArticleScorecardStatus":{"type":"string","enum":["complete","unavailable"],"description":"Scores are graded on a 0-10 scale (one decimal place)."},"ArticleScorecardEvidence":{"properties":{"quote":{"type":"string","description":"Verbatim excerpt from the article, truncated for storage."},"location":{"type":"string","description":"Heading or section anchor the excerpt came from."}},"required":["quote"],"type":"object","additionalProperties":false},"ArticleScorecardDimension":{"properties":{"key":{"type":"string","description":"Stable rubric key (e.g. `thesis_delivery`)."},"label":{"type":"string","description":"Human-readable rubric label."},"score":{"type":"number","format":"double","description":"Score on the 0-10 scale declared by `scoreMax`."},"rationale":{"type":"string"},"evidence":{"items":{"$ref":"#/components/schemas/ArticleScorecardEvidence"},"type":"array","description":"Omitted on the compact copy stored in the topic review snapshot."}},"required":["key","label","score","rationale"],"type":"object","additionalProperties":false},"ArticleScorecardCoverage":{"description":"Compact restatement of the competitive benchmark the judge was given.","properties":{"status":{"type":"string"},"query":{"type":"string"},"sourceCount":{"type":"number","format":"double"},"grade":{"type":"string"},"competitiveScore":{"type":"number","format":"double"}},"required":["status","query","sourceCount"],"type":"object","additionalProperties":false},"ArticleScorecard":{"properties":{"schemaVersion":{"type":"number","format":"double"},"rubricVersion":{"type":"string","description":"Rubric identity — changes whenever dimensions or scoring guidance change."},"status":{"$ref":"#/components/schemas/ArticleScorecardStatus"},"reason":{"type":"string","description":"Why the scorecard is unavailable. Only set when `status` is 'unavailable'."},"runId":{"type":"string"},"stepName":{"type":"string"},"model":{"type":"string","description":"Model spec that produced the grade (provenance for regeneration history)."},"generatedAt":{"type":"string","description":"ISO-8601 timestamp."},"articleContentHash":{"type":"string","description":"SHA-256 of the graded article, so later content edits are detectable."},"scoreMax":{"type":"number","format":"double","description":"Upper bound of the score scale (10)."},"overallScore":{"type":"number","format":"double","description":"Mean of the dimension scores, one decimal place. Absent when unavailable."},"dimensions":{"items":{"$ref":"#/components/schemas/ArticleScorecardDimension"},"type":"array"},"topImprovements":{"items":{"type":"string"},"type":"array","description":"At most three prioritized improvements."},"coverage":{"allOf":[{"$ref":"#/components/schemas/ArticleScorecardCoverage"}],"nullable":true,"description":"Null when no competitive benchmark was available for this run."}},"required":["schemaVersion","rubricVersion","status","runId","stepName","model","generatedAt","articleContentHash","scoreMax","dimensions","topImprovements"],"type":"object","additionalProperties":false},"CodeVerificationReportStatus":{"type":"string","enum":["complete","unavailable"]},"Record_CodeVerificationStatus.number_":{"properties":{"parsed":{"type":"number","format":"double"},"parse_failed":{"type":"number","format":"double"},"skipped":{"type":"number","format":"double"}},"required":["parsed","parse_failed","skipped"],"type":"object","description":"Construct a type with a set of properties K of type T"},"CodeVerificationStatus":{"type":"string","enum":["parsed","parse_failed","skipped"]},"CodeVerificationSkipReason":{"type":"string","enum":["unsupported_language","empty_block","block_too_large","article_block_limit","parser_unavailable"]},"CodeParseDiagnostic":{"properties":{"message":{"type":"string"},"line":{"type":"number","format":"double","description":"1-indexed line within the code block, not within the article."},"column":{"type":"number","format":"double"}},"required":["message"],"type":"object","additionalProperties":false},"CodeBlockVerification":{"properties":{"index":{"type":"number","format":"double","description":"Position of the block within the article, 0-indexed in document order."},"lang":{"type":"string","description":"Normalized language tag, lowercased. Empty string for an untagged fence."},"rawLang":{"type":"string","nullable":true},"line":{"type":"number","format":"double","description":"1-indexed line in the article markdown where the block starts."},"charCount":{"type":"number","format":"double"},"status":{"$ref":"#/components/schemas/CodeVerificationStatus"},"skipReason":{"$ref":"#/components/schemas/CodeVerificationSkipReason","description":"Why the block was not verified at all. Only set when status is `skipped`."},"detail":{"type":"string"},"diagnostics":{"items":{"$ref":"#/components/schemas/CodeParseDiagnostic"},"type":"array"}},"required":["index","lang","rawLang","line","charCount","status"],"type":"object","additionalProperties":false},"CodeVerificationReport":{"properties":{"schemaVersion":{"type":"number","enum":[1],"nullable":false,"description":"Literal rather than `typeof CODE_VERIFICATION_SCHEMA_VERSION`: this type is\nreachable from a TSOA controller response, and TSOA cannot resolve a type query."},"status":{"$ref":"#/components/schemas/CodeVerificationReportStatus"},"reason":{"type":"string","description":"Present when status is `unavailable`; explains why no evidence exists."},"generatedAt":{"type":"string"},"articleContentHash":{"type":"string","description":"sha256 of the article the evidence describes, so stale evidence is detectable."},"blockCount":{"type":"number","format":"double"},"blocksOmitted":{"type":"number","format":"double","description":"Blocks beyond the per-article cap, reported rather than silently dropped."},"counts":{"$ref":"#/components/schemas/Record_CodeVerificationStatus.number_"},"blocks":{"items":{"$ref":"#/components/schemas/CodeBlockVerification"},"type":"array"}},"required":["schemaVersion","status","generatedAt","articleContentHash","blockCount","blocksOmitted","counts","blocks"],"type":"object","additionalProperties":false},"ClaimsLedgerStatus":{"type":"string","enum":["complete","unavailable"]},"ClaimsLedgerSummary":{"description":"Bounded summary for step metadata and the approval snapshot.\n\nThe full ledger stays authoritative in S3; DynamoDB carries only this, per the rule\nthe SERP benchmark established.","properties":{"artifactKey":{"type":"string"},"status":{"$ref":"#/components/schemas/ClaimsLedgerStatus"},"claimsStatus":{"$ref":"#/components/schemas/ClaimsLedgerStatus","description":"Whether the claim half ran, independent of the similarity half."},"total":{"type":"number","format":"double"},"verified":{"type":"number","format":"double"},"unverified":{"type":"number","format":"double"},"corrected":{"type":"number","format":"double"},"unanchored":{"type":"number","format":"double"},"verifiedCoverage":{"type":"number","format":"double","description":"Verified claims as a fraction of anchored claims, 0 to 1.\n\nAbsent when nothing was anchored: a coverage figure computed over zero claims\nwould render as 0% and read as a failure rather than as an absence."},"unverifiedAnchored":{"type":"number","format":"double","description":"Unverified claims that were actually located, excluding unanchored ones."},"similarityFindings":{"type":"number","format":"double"},"similarityStatus":{"$ref":"#/components/schemas/ClaimsLedgerStatus"},"similaritySourcesOmitted":{"type":"number","format":"double","description":"Fetched sources the corpus bound dropped before the scan ran.\n\nCarried so the approval screen cannot say \"no passage matches a fetched source\"\nabout a scan that never saw some of them."}},"required":["status","claimsStatus","total","verified","unverified","corrected","unanchored","unverifiedAnchored","similarityFindings","similarityStatus","similaritySourcesOmitted"],"type":"object","additionalProperties":false},"TopicSeoReviewSnapshot":{"properties":{"runId":{"type":"string"},"seoBriefRevision":{"type":"number","format":"double"},"reviewedAt":{"type":"number","format":"double"},"articleUpdatedAt":{"type":"number","format":"double"},"checks":{"properties":{"keywordRepetition":{"$ref":"#/components/schemas/SeoCheckStatus"},"headingStructure":{"$ref":"#/components/schemas/SeoCheckStatus"},"supportingCoverage":{"$ref":"#/components/schemas/SeoCheckStatus"},"primaryTargetPlacement":{"$ref":"#/components/schemas/SeoCheckStatus"},"intentAlignment":{"$ref":"#/components/schemas/SeoCheckStatus"}},"required":["keywordRepetition","headingStructure","supportingCoverage","primaryTargetPlacement","intentAlignment"],"type":"object"},"findings":{"items":{"$ref":"#/components/schemas/TopicSeoReviewFinding"},"type":"array"},"coverageBenchmark":{"$ref":"#/components/schemas/SerpContentBenchmarkReport"},"articleScorecard":{"$ref":"#/components/schemas/ArticleScorecard","description":"Latest article scorecard for this topic, carried on the SEO review snapshot\nso the approval screen needs no extra fetch. Evidence quotes are stripped\nhere; the full scorecard lives on the run artifact and in article history."},"codeVerification":{"$ref":"#/components/schemas/CodeVerificationReport","description":"Latest deterministic code verification for this topic, carried alongside the\nscorecard so the approval screen renders both from one read."},"claimsLedger":{"$ref":"#/components/schemas/ClaimsLedgerSummary","description":"Claim-verification coverage for this topic.\n\nThe summary rather than the full ledger: the approval screen needs the coverage\nfigure and the similarity count, and the claims themselves stay on the run\nartifact where they can be read at length."}},"required":["runId","seoBriefRevision","reviewedAt","checks","findings"],"type":"object","additionalProperties":false},"TopicSeoBrief":{"properties":{"topicId":{"type":"string"},"workspaceId":{"type":"string"},"contentProjectId":{"type":"string"},"schemaVersion":{"type":"number","enum":[1],"nullable":false},"revision":{"type":"number","format":"double"},"searchObjective":{"type":"string"},"distributionGoals":{"items":{"$ref":"#/components/schemas/SeoDistributionGoal"},"type":"array"},"intent":{"$ref":"#/components/schemas/SeoIntent"},"readerTask":{"type":"string"},"serpPattern":{"$ref":"#/components/schemas/SeoSerpPattern"},"primaryTargets":{"items":{"$ref":"#/components/schemas/TopicSeoKeywordTarget"},"type":"array"},"supportingClusters":{"items":{"$ref":"#/components/schemas/TopicSeoKeywordCluster"},"type":"array"},"usageGuidance":{"items":{"type":"string"},"type":"array"},"metricsContext":{"properties":{"status":{"type":"string","enum":["complete","partial","pending","unavailable"]},"fetchedAt":{"type":"number","format":"double"},"provider":{"type":"string"},"includeGlobalVolume":{"type":"boolean"},"marketLocale":{"$ref":"#/components/schemas/KeywordMarketLocale"}},"required":["status","provider","includeGlobalVolume","marketLocale"],"type":"object"},"latestReview":{"$ref":"#/components/schemas/TopicSeoReviewSnapshot"},"source":{"type":"string","enum":["topic_research","deep_topic_research","manual","legacy_projection"]},"sourceRunId":{"type":"string"},"generationQualityTier":{"$ref":"#/components/schemas/GenerationQualityTier"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"updatedBy":{"type":"string"}},"required":["topicId","workspaceId","schemaVersion","revision","searchObjective","distributionGoals","intent","readerTask","serpPattern","primaryTargets","supportingClusters","usageGuidance","metricsContext","source","createdAt","updatedAt","updatedBy"],"type":"object","additionalProperties":false},"TopicSeoFreshness":{"properties":{"outline":{"type":"string","enum":["current","stale","unknown","missing"]},"draft":{"type":"string","enum":["current","stale","unknown","missing"]},"review":{"type":"string","enum":["current","stale","unknown","missing"]}},"required":["outline","draft","review"],"type":"object","additionalProperties":false},"WorkspaceTopicSeoBriefResponse":{"properties":{"topicId":{"type":"string"},"brief":{"allOf":[{"$ref":"#/components/schemas/TopicSeoBrief"}],"nullable":true},"freshness":{"$ref":"#/components/schemas/TopicSeoFreshness"}},"required":["topicId","brief","freshness"],"type":"object","additionalProperties":false},"WorkspaceUpdateTopicSeoBriefRequest":{"properties":{"expectedRevision":{"type":"number","format":"double"},"searchObjective":{"type":"string"},"distributionGoals":{"items":{"$ref":"#/components/schemas/SeoDistributionGoal"},"type":"array"},"intent":{"type":"string","enum":["informational","commercial","navigational","transactional"]},"readerTask":{"type":"string"},"serpPattern":{"$ref":"#/components/schemas/SeoSerpPattern"},"primaryTargets":{"items":{"$ref":"#/components/schemas/TopicSeoKeywordTarget"},"type":"array"},"supportingClusters":{"items":{"$ref":"#/components/schemas/TopicSeoKeywordCluster"},"type":"array"},"usageGuidance":{"items":{"type":"string"},"type":"array"}},"required":["expectedRevision"],"type":"object","additionalProperties":false},"WorkspaceRefreshTopicSeoMetricsResponse":{"properties":{"topicId":{"type":"string"},"status":{"type":"string","enum":["queued"],"nullable":false},"jobId":{"type":"string"}},"required":["topicId","status","jobId"],"type":"object","additionalProperties":false},"WorkspaceTopicMessageResponse":{"properties":{"message":{"type":"string"},"topicId":{"type":"string"}},"required":["message","topicId"],"type":"object","additionalProperties":false},"WorkspaceUpdateTopicRequest":{"properties":{"title":{"type":"string"},"seoTitle":{"type":"string"},"articleType":{"$ref":"#/components/schemas/ArticleType"},"articleFormat":{"$ref":"#/components/schemas/ArticleFormat"},"comparisonRecommendationMode":{"$ref":"#/components/schemas/ComparisonRecommendationMode"},"contentType":{"$ref":"#/components/schemas/ContentType"},"targetAudience":{"type":"string"},"estimatedIntent":{"type":"string"},"priorityScore":{"type":"number","format":"double"},"priorityRationale":{"type":"string"},"cluster":{"type":"string"},"scheduledDate":{"type":"string"},"scheduleNote":{"type":"string"},"recommendedAction":{"$ref":"#/components/schemas/RecommendedAction"},"rankProximity":{"$ref":"#/components/schemas/RankProximity"},"angles":{"items":{"type":"string"},"type":"array"},"mustInclude":{"items":{"type":"string"},"type":"array"},"suggestedSources":{"items":{"$ref":"#/components/schemas/TopicSuggestedSourceRequest"},"type":"array"},"primaryKeyword":{"type":"string"},"secondaryKeywords":{"items":{"type":"string"},"type":"array"},"contentGap":{"type":"string"},"thesis":{"type":"string"},"readerPain":{"type":"string"},"productTieIn":{"type":"string"},"evidencePlan":{"items":{"type":"string"},"type":"array"},"originalityAngle":{"type":"string"},"avoidAngle":{"type":"string"},"wordCountRange":{"properties":{"max":{"type":"number","format":"double"},"min":{"type":"number","format":"double"}},"required":["max","min"],"type":"object","nullable":true}},"type":"object","additionalProperties":false},"WorkspacePerformanceTargetResponse":{"properties":{"topicId":{"type":"string"},"performanceTarget":{"$ref":"#/components/schemas/ContentTopicPerformanceTarget"}},"required":["topicId","performanceTarget"],"type":"object","additionalProperties":false},"WorkspaceUpdatePerformanceTargetRequest":{"properties":{"url":{"type":"string"},"title":{"type":"string"}},"required":["url"],"type":"object","additionalProperties":false},"WorkspaceVerifyPerformanceTargetResponse":{"properties":{"topicId":{"type":"string"},"performanceTarget":{"$ref":"#/components/schemas/ContentTopicPerformanceTarget"},"verificationStatus":{"type":"string","enum":["untracked","pending_connection","ready","needs_attention"]},"message":{"type":"string"}},"required":["topicId","performanceTarget","verificationStatus","message"],"type":"object","additionalProperties":false},"ContentPerformanceSummary":{"properties":{"clicks":{"type":"number","format":"double"},"impressions":{"type":"number","format":"double"},"ctr":{"type":"number","format":"double"},"averagePosition":{"type":"number","format":"double"}},"required":["clicks","impressions","ctr","averagePosition"],"type":"object","additionalProperties":false},"ContentPerformanceProvider":{"type":"string","enum":["google_search_console"],"nullable":false},"ContentPerformanceQueryMetric":{"properties":{"query":{"type":"string"},"clicks":{"type":"number","format":"double"},"impressions":{"type":"number","format":"double"},"ctr":{"type":"number","format":"double"},"averagePosition":{"type":"number","format":"double"}},"required":["query","clicks","impressions","ctr","averagePosition"],"type":"object","additionalProperties":false},"ContentPerformanceDailyMetric":{"properties":{"workspaceId":{"type":"string"},"topicId":{"type":"string"},"contentProjectId":{"type":"string"},"provider":{"$ref":"#/components/schemas/ContentPerformanceProvider"},"canonicalUrl":{"type":"string"},"date":{"type":"string"},"clicks":{"type":"number","format":"double"},"impressions":{"type":"number","format":"double"},"ctr":{"type":"number","format":"double"},"averagePosition":{"type":"number","format":"double"},"topQueries":{"items":{"$ref":"#/components/schemas/ContentPerformanceQueryMetric"},"type":"array"},"syncedAt":{"type":"number","format":"double"}},"required":["workspaceId","topicId","provider","canonicalUrl","date","clicks","impressions","ctr","averagePosition","syncedAt"],"type":"object","additionalProperties":false},"WorkspaceTopicPerformanceResponse":{"properties":{"topicId":{"type":"string"},"performanceTarget":{"$ref":"#/components/schemas/ContentTopicPerformanceTarget"},"summary":{"$ref":"#/components/schemas/ContentPerformanceSummary"},"dailyMetrics":{"items":{"$ref":"#/components/schemas/ContentPerformanceDailyMetric"},"type":"array"},"topQueries":{"items":{"$ref":"#/components/schemas/ContentPerformanceQueryMetric"},"type":"array"}},"required":["topicId","performanceTarget","dailyMetrics"],"type":"object","additionalProperties":false},"SyncTopicPerformanceResponse":{"properties":{"topicId":{"type":"string"},"status":{"$ref":"#/components/schemas/ContentPerformanceSyncStatus"},"message":{"type":"string"},"dailyMetricsSynced":{"type":"number","format":"double"}},"required":["topicId","status"],"type":"object","additionalProperties":false},"WorkspaceShortlistTopicResponse":{"properties":{"message":{"type":"string"},"topicId":{"type":"string"},"runId":{"type":"string"},"workflowId":{"type":"string"},"articleId":{"type":"string"}},"required":["message","topicId"],"type":"object","additionalProperties":false},"WorkspaceRunInstructionsRequest":{"properties":{"instructions":{"type":"string"},"styleProfileId":{"type":"string"}},"type":"object","additionalProperties":false},"ContentAuditEventType":{"type":"string","enum":["topic_created","topic_updated","topic_shortlisted","topic_archived","topic_restored","outline_generated","outline_approved","outline_changes_requested","draft_generated","draft_approved","draft_changes_requested","pipeline_stage_completed"],"description":"All possible audit event types for the content lifecycle.\n\nTopic lifecycle:\n  topic_created → topic_updated → topic_shortlisted → topic_archived → topic_restored\n\nOutline lifecycle:\n  outline_generated → outline_approved\n\nDraft lifecycle:\n  draft_generated → draft_approved"},"Record_string.unknown_":{"properties":{},"additionalProperties":{},"type":"object","description":"Construct a type with a set of properties K of type T"},"ContentAuditEvent":{"description":"An append-only audit event recording a state transition or action in the\ncontent lifecycle.  Stored in MdhContentAuditEvents.\n\n  PK: topicId  (string)\n  SK: eventAt  (number – Unix seconds)","properties":{"topicId":{"type":"string","description":"FK to MdhContentTopics"},"eventAt":{"type":"number","format":"double","description":"Unix seconds – also used as the DynamoDB sort key"},"eventId":{"type":"string","description":"Unique ID for idempotent writes (condition: attribute_not_exists(eventId))"},"eventType":{"$ref":"#/components/schemas/ContentAuditEventType","description":"The type of lifecycle event"},"actorId":{"type":"string","description":"User or system actor that triggered the event"},"articleId":{"type":"string","description":"FK to MdhArticleV2 – present for outline/draft events"},"metadata":{"$ref":"#/components/schemas/Record_string.unknown_","description":"Optional free-form payload (e.g. diff summary, section name)"}},"required":["topicId","eventAt","eventId","eventType","actorId"],"type":"object","additionalProperties":false},"WorkspaceEnsureTopicArticleResponse":{"properties":{"articleId":{"type":"string"},"created":{"type":"boolean"},"linked":{"type":"boolean"}},"required":["articleId","created","linked"],"type":"object","additionalProperties":false},"WorkspaceEnsureTopicArticleRequest":{"properties":{"articleId":{"type":"string"}},"type":"object","additionalProperties":false},"WorkspaceStartWorkflowResponse":{"properties":{"runId":{"type":"string"},"workflowId":{"type":"string"},"articleId":{"type":"string"},"topicId":{"type":"string"},"status":{"type":"string","enum":["queued"],"nullable":false}},"required":["runId","workflowId","articleId","topicId","status"],"type":"object","additionalProperties":false},"TopicPipelineShape":{"type":"string","enum":["staged","full"],"description":"Which pipeline shape a topic's workflow start requests.\n\n`staged` is the CoWrite default (an `outline` run, then a chained editorial\ndraft run). `full` runs `full_editorial_article` instead: one run that\nbenchmarks SERP coverage before researching and outlining. The coverage map\nlives in run-scoped state, so `full` is the only shape where the research and\noutline steps can read it."},"WorkspaceStartWorkflowRequest":{"properties":{"instructions":{"type":"string"},"styleProfileId":{"type":"string"},"pipeline":{"$ref":"#/components/schemas/TopicPipelineShape","description":"Shape of the pipeline to start. Defaults to `staged`.\n\n- `staged` — the CoWrite default: one `outline` run (research → thesis →\n  outline) now, with the editorial draft run chained after it. Each stage is\n  a separate run, so the outline is reviewable between them.\n- `full` — one `full_editorial_article` run that benchmarks SERP coverage\n  first and then researches, outlines and drafts inside that single run.\n  The coverage map is run-scoped state, so this is the only shape in which\n  the research and outline steps can see it.\n\nThe approval policy is unchanged by this choice: a content project with\n`requireOutlineApproval: false` still runs with `approvalMode: 'none'`."}},"type":"object","additionalProperties":false},"WorkspaceGenerateOutlineResponse":{"properties":{"runId":{"type":"string"},"articleId":{"type":"string"},"status":{"type":"string","enum":["queued"],"nullable":false},"conversationId":{"type":"string"}},"required":["runId","articleId","status"],"type":"object","additionalProperties":false},"WorkspaceGenerateOutlineRequest":{"properties":{"instructions":{"type":"string"},"styleProfileId":{"type":"string"}},"type":"object","additionalProperties":false},"WorkspaceGetOutlineResponse":{"properties":{"topicId":{"type":"string"},"articleId":{"type":"string"},"outline":{"type":"string"}},"required":["topicId","articleId","outline"],"type":"object","additionalProperties":false},"WorkspaceApproveOutlineResponse":{"properties":{"message":{"type":"string"},"topicId":{"type":"string"},"draftRunId":{"type":"string"},"articleId":{"type":"string"},"workflowId":{"type":"string"}},"required":["message","topicId"],"type":"object","additionalProperties":false},"WorkspaceApproveOutlineRequest":{"properties":{"note":{"type":"string"},"instructions":{"type":"string"},"styleProfileId":{"type":"string"}},"type":"object","additionalProperties":false},"WorkspaceOutlineRequestChangesRequest":{"properties":{"feedback":{"type":"string"},"styleProfileId":{"type":"string"}},"type":"object","additionalProperties":false},"WorkspaceGetDraftResponse":{"properties":{"topicId":{"type":"string"},"articleId":{"type":"string"},"draft":{"type":"string"}},"required":["topicId","articleId","draft"],"type":"object","additionalProperties":false},"WorkspaceApproveDraftRequest":{"properties":{"note":{"type":"string"}},"type":"object","additionalProperties":false},"WorkspaceDraftRequestChangesRequest":{"properties":{"feedback":{"type":"string"},"styleProfileId":{"type":"string"}},"type":"object","additionalProperties":false},"DraftAction":{"type":"string","enum":["create","update","optimize","rewrite"],"description":"Lifecycle action CoWrite can run against a topic's draft."},"WorkspaceRunDraftActionResponse":{"properties":{"runId":{"type":"string"},"articleId":{"type":"string"},"workflowId":{"type":"string"},"action":{"$ref":"#/components/schemas/DraftAction"},"status":{"type":"string","enum":["queued"],"nullable":false}},"required":["runId","articleId","workflowId","action","status"],"type":"object","additionalProperties":false},"WorkspaceRunDraftActionRequest":{"properties":{"action":{"$ref":"#/components/schemas/DraftAction"},"instructions":{"type":"string"},"styleProfileId":{"type":"string"}},"type":"object","additionalProperties":false},"CreateWorkspaceResponse":{"properties":{"workspaceId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"ownerUsername":{"type":"string"},"message":{"type":"string"}},"required":["workspaceId","name","type","ownerUsername","message"],"type":"object","additionalProperties":false},"CreateWorkspaceRequest":{"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["user","team"]},"settings":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["name","type"],"type":"object","additionalProperties":false},"Workspace":{"properties":{"workspaceId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["user","team"]},"ownerUsername":{"type":"string"},"effectivePermission":{"type":"string","enum":["read","write"],"description":"Effective access for the current caller on discovery responses."},"displayName":{"type":"string","description":"User-facing label for legacy duplicate personal workspaces."},"members":{"items":{"properties":{"role":{"type":"string","enum":["owner","admin","member"]},"username":{"type":"string"}},"required":["role","username"],"type":"object"},"type":"array"},"settings":{"$ref":"#/components/schemas/Record_string.unknown_"},"cowriteProjectCounter":{"type":"number","format":"double"},"cowriteBriefCounter":{"type":"number","format":"double"},"cowriteArticleCounter":{"type":"number","format":"double"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"}},"required":["workspaceId","name","type","ownerUsername","members","createdAt","updatedAt"],"type":"object","additionalProperties":false},"WorkspaceMessageResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"UpdateWorkspaceRequest":{"properties":{"name":{"type":"string"},"settings":{"$ref":"#/components/schemas/Record_string.unknown_"}},"type":"object","additionalProperties":false},"AddMemberRequest":{"properties":{"username":{"type":"string"},"role":{"type":"string","enum":["admin","member"]}},"required":["username","role"],"type":"object","additionalProperties":false},"WorkspaceMember":{"properties":{"username":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member"]},"type":{"type":"string","enum":["direct"],"nullable":false}},"required":["username","role","type"],"type":"object","additionalProperties":false},"WorkspaceCollaborator":{"properties":{"username":{"type":"string"},"permission":{"type":"string","enum":["read","write"]},"type":{"type":"string","enum":["invited"],"nullable":false},"acceptedAt":{"type":"number","format":"double"}},"required":["username","permission","type","acceptedAt"],"type":"object","additionalProperties":false},"WorkspaceCollaboratorResponse":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceMember"},{"$ref":"#/components/schemas/WorkspaceCollaborator"}]},"NodeJS.ReadableStream":{"properties":{"readable":{"type":"boolean"}},"required":["readable"],"type":"object","additionalProperties":false},"WorkflowSource":{"type":"string","enum":["system","workspace","folder"]},"WorkflowCostClass":{"type":"string","enum":["cheap","expensive"]},"WorkflowSummary":{"properties":{"id":{"type":"string","description":"\"standard_article\" | \"research\" | \"outline\" | \"draft\" or the workflow name for custom workflows"},"name":{"type":"string"},"title":{"type":"string","description":"Router/UI-facing display title. Falls back to a humanized `name` when no catalog copy exists."},"description":{"type":"string"},"source":{"$ref":"#/components/schemas/WorkflowSource"},"steps":{"items":{"type":"string"},"type":"array","description":"Step names in execution order"},"version":{"type":"string"},"userVisible":{"type":"boolean","description":"Whether this workflow should appear as a selectable option in generic pickers (chips, \"Change\" menu)."},"costClass":{"$ref":"#/components/schemas/WorkflowCostClass","description":"Drives propose-then-run vs run-with-visible-choice UX for agent runs."},"isDefault":{"type":"boolean","description":"True for the single workflow a client should preselect when the user hasn't chosen one."},"intentId":{"type":"string","description":"The TaskIntent this workflow fulfills, when it has been catalogued."}},"required":["id","name","title","description","source","steps","version","userVisible","costClass","isDefault"],"type":"object","additionalProperties":false},"ListWorkflowsResponse":{"properties":{"workflows":{"items":{"$ref":"#/components/schemas/WorkflowSummary"},"type":"array"}},"required":["workflows"],"type":"object","additionalProperties":false},"WorkflowStepType":{"type":"string","enum":["research","thesis","outline","draft","visual_planning","illustrate","review","custom","topic_research","deep_topic_research","seo_review","citation_enrichment","tech_review","editorial_review","draft_revision","article_validation","article_scorecard","quality_pass","serp_benchmark","code_verification","claims_audit"],"description":"Workflow step types supported by the system.\n\nDefined as an explicit string literal union rather than `z.infer<typeof WorkflowStepTypeSchema>`\nso that TSOA's type resolver can reflect on the type at build time.\nMust be kept in sync with the `WorkflowStepTypeSchema` enum values in\n`src/config/stepTypeConfig.ts`."},"Record_string.any_":{"properties":{},"additionalProperties":{},"type":"object","description":"Construct a type with a set of properties K of type T"},"ApprovalType":{"type":"string","enum":["required","optional","none"],"description":"Approval requirements for a workflow step.\n- 'required': Must pause and wait for user approval before continuing\n- 'optional': Can optionally pause for review but proceeds automatically\n- 'none': Runs automatically without pausing"},"WorkflowStep":{"description":"A single step within a workflow.","properties":{"name":{"type":"string","description":"Unique name for this step (e.g., \"research\", \"extract_examples\")"},"type":{"$ref":"#/components/schemas/WorkflowStepType","description":"Type of step - determines system prompt and output extraction"},"tools":{"items":{"type":"string"},"type":"array","description":"Names of tools available to this step (e.g., [\"search_resources\", \"web_search\"])"},"config":{"$ref":"#/components/schemas/Record_string.any_","description":"Step-specific configuration (e.g., { maxSources: 10, style: \"tutorial\" })"},"persistToArticle":{"properties":{"createAutoVersion":{"type":"boolean"},"file":{"type":"string","enum":["content.md","outline.md","research.md"]}},"required":["file"],"type":"object","description":"Optional persistence mapping for CoWrite: when present, the step's primary\nmarkdown output is written to an article-scoped file."},"approval":{"$ref":"#/components/schemas/ApprovalType","description":"Whether this step requires user approval before proceeding"}},"required":["name","type","tools","config","approval"],"type":"object","additionalProperties":false},"GetWorkflowResponse":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"source":{"type":"string","enum":["system","workspace","folder"]},"steps":{"items":{"$ref":"#/components/schemas/WorkflowStep"},"type":"array"}},"required":["id","name","description","version","source","steps"],"type":"object","additionalProperties":false},"CreateWorkflowRequest":{"properties":{"workspaceId":{"type":"string"},"folderId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"steps":{"items":{"$ref":"#/components/schemas/WorkflowStep"},"type":"array"}},"required":["workspaceId","name","description","steps"],"type":"object","additionalProperties":false},"UpdateWorkflowRequest":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"steps":{"items":{"$ref":"#/components/schemas/WorkflowStep"},"type":"array"}},"type":"object","additionalProperties":false},"WorkflowAuthorizationStatus":{"type":"string","enum":["connected","not_connected","needs_reconnect","pending","unknown"]},"WorkflowAuthorizationProviderRequirement":{"properties":{"providerKey":{"type":"string"},"label":{"type":"string"},"required":{"type":"boolean"},"status":{"$ref":"#/components/schemas/WorkflowAuthorizationStatus"},"missingToolkits":{"items":{"type":"string"},"type":"array","description":"Toolkits from this provider that are used in this workflow"},"connectPath":{"type":"string","description":"Relative Settings path to connect this provider"}},"required":["providerKey","label","required","status","missingToolkits","connectPath"],"type":"object","additionalProperties":false},"CreateVersionResponse":{"properties":{"uploadUrl":{"type":"string"},"versionId":{"type":"string"},"versionNumber":{"type":"number","format":"double"},"expiresIn":{"type":"number","format":"double"}},"required":["uploadUrl","versionId","versionNumber","expiresIn"],"type":"object","additionalProperties":false},"ResourceNotFoundErrorResponse":{"properties":{"error":{"properties":{"resourceId":{"type":"string"},"resourceType":{"type":"string"},"message":{"type":"string"},"type":{"type":"string","enum":["RESOURCE_NOT_FOUND"],"nullable":false}},"required":["resourceType","message","type"],"type":"object"}},"required":["error"],"type":"object","additionalProperties":false},"QuotaExceededErrorResponse":{"properties":{"error":{"properties":{"planDisplayName":{"type":"string"},"appKey":{"type":"string","enum":["mdedit","cowrite"]},"upgradeUrl":{"type":"string"},"upgradeTarget":{"type":"string","enum":["STANDARD","PREMIUM"]},"quota":{"properties":{"resourceId":{"type":"string"},"upgradeTarget":{"type":"string","enum":["STANDARD","PREMIUM"]},"resetAt":{"type":"number","format":"double"},"period":{"type":"string","enum":["daily","monthly","yearly","user"]},"limitLevel":{"type":"string"},"planDisplayName":{"type":"string"},"tier":{"type":"string"},"remaining":{"type":"number","format":"double"},"current":{"type":"number","format":"double"},"limit":{"type":"number","format":"double"}},"required":["period","limitLevel","tier","remaining","current","limit"],"type":"object"},"feature":{"type":"string"},"message":{"type":"string"},"type":{"type":"string","enum":["QUOTA_EXCEEDED"],"nullable":false}},"required":["upgradeUrl","quota","feature","message","type"],"type":"object"}},"required":["error"],"type":"object","additionalProperties":false},"CreateVersionRequest":{"properties":{"versionId":{"type":"string"},"versionNumber":{"type":"number","format":"double"},"contentHash":{"type":"string"},"changeNote":{"type":"string"},"type":{"type":"string","enum":["manual"],"nullable":false}},"required":["versionId","versionNumber","contentHash","type"],"type":"object","additionalProperties":false},"VersionListResponse":{"properties":{"versions":{"items":{"properties":{"contentHash":{"type":"string"},"changeNote":{"type":"string"},"type":{"type":"string","enum":["auto","manual"]},"createdBy":{"type":"string"},"createdAt":{"type":"number","format":"double"},"versionNumber":{"type":"number","format":"double"},"versionId":{"type":"string"}},"required":["type","createdBy","createdAt","versionNumber","versionId"],"type":"object"},"type":"array"},"metadata":{"properties":{"retention":{"properties":{"expired":{"type":"number","format":"double"},"showing":{"type":"number","format":"double"},"total":{"type":"number","format":"double"},"cutoffDate":{"type":"number","format":"double","nullable":true},"displayName":{"type":"string"},"days":{"type":"number","format":"double"},"tier":{"type":"string"}},"required":["expired","showing","total","cutoffDate","displayName","days","tier"],"type":"object"}},"required":["retention"],"type":"object"}},"required":["versions"],"type":"object","additionalProperties":false},"VersionContentResponse":{"properties":{"versionId":{"type":"string"},"versionNumber":{"type":"number","format":"double"},"content":{"type":"string"},"createdAt":{"type":"number","format":"double"},"createdBy":{"type":"string"}},"required":["versionId","versionNumber","content","createdAt","createdBy"],"type":"object","additionalProperties":false},"ReviewReconciliationSummary":{"properties":{"orphaned":{"type":"number","format":"double"},"restored":{"type":"number","format":"double"},"reanchored":{"type":"number","format":"double"}},"required":["orphaned","restored","reanchored"],"type":"object"},"ReviewId":{"type":"string"},"ReviewAnchorKind":{"type":"string","enum":["comment","highlight","insert","delete","replace"]},"ReviewAnchorScope":{"type":"string","enum":["inline","block"]},"ReviewAnchor":{"properties":{"blockPath":{"type":"string"},"textHash":{"type":"string"},"after":{"type":"string"},"before":{"type":"string"},"text":{"type":"string"},"to":{"type":"number","format":"double"},"from":{"type":"number","format":"double"},"scope":{"$ref":"#/components/schemas/ReviewAnchorScope"},"kind":{"$ref":"#/components/schemas/ReviewAnchorKind"}},"required":["scope","kind"],"type":"object"},"ReviewAuthor":{"properties":{"onBehalfOf":{"type":"string"},"agentName":{"type":"string"},"agentId":{"type":"string","description":"Opaque, server-attested identity for the API key acting as this agent."},"kind":{"type":"string","enum":["human","agent"]},"avatarUrl":{"type":"string"},"displayName":{"type":"string"},"userId":{"type":"string"}},"required":["displayName","userId"],"type":"object"},"ReviewReply":{"properties":{"deletedAt":{"type":"string"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"createdBy":{"$ref":"#/components/schemas/ReviewAuthor"},"body":{"type":"string"},"id":{"$ref":"#/components/schemas/ReviewId"}},"required":["createdAt","body","id"],"type":"object"},"ReviewCommentThread":{"properties":{"replies":{"items":{"$ref":"#/components/schemas/ReviewReply"},"type":"array"},"resolvedAt":{"type":"string"},"resolvedBy":{"$ref":"#/components/schemas/ReviewAuthor"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"assignedTo":{"$ref":"#/components/schemas/ReviewAuthor"},"createdBy":{"$ref":"#/components/schemas/ReviewAuthor"},"status":{"type":"string","enum":["open","resolved","reopened","orphaned"]},"body":{"type":"string"},"anchor":{"$ref":"#/components/schemas/ReviewAnchor"},"id":{"$ref":"#/components/schemas/ReviewId"}},"required":["createdAt","status","body","anchor","id"],"type":"object"},"Record_ReviewId.ReviewCommentThread_":{"properties":{},"additionalProperties":{"$ref":"#/components/schemas/ReviewCommentThread"},"type":"object","description":"Construct a type with a set of properties K of type T"},"ReviewSuggestion":{"properties":{"replies":{"items":{"$ref":"#/components/schemas/ReviewReply"},"type":"array"},"note":{"type":"string"},"decidedAt":{"type":"string"},"decidedBy":{"$ref":"#/components/schemas/ReviewAuthor"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"assignedTo":{"$ref":"#/components/schemas/ReviewAuthor"},"createdBy":{"$ref":"#/components/schemas/ReviewAuthor"},"status":{"type":"string","enum":["open","accepted","rejected","orphaned"]},"suggestedText":{"type":"string"},"originalText":{"type":"string"},"anchor":{"$ref":"#/components/schemas/ReviewAnchor","description":"Out-of-band source location. Optional only for legacy marker-backed data."},"kind":{"type":"string","enum":["insert","delete","replace"]},"id":{"$ref":"#/components/schemas/ReviewId"}},"required":["createdAt","status","kind","id"],"type":"object"},"Record_ReviewId.ReviewSuggestion_":{"properties":{},"additionalProperties":{"$ref":"#/components/schemas/ReviewSuggestion"},"type":"object","description":"Construct a type with a set of properties K of type T"},"ReviewHighlight":{"properties":{"note":{"type":"string"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"assignedTo":{"$ref":"#/components/schemas/ReviewAuthor"},"createdBy":{"$ref":"#/components/schemas/ReviewAuthor"},"status":{"type":"string","enum":["open","resolved","orphaned"]},"anchor":{"$ref":"#/components/schemas/ReviewAnchor"},"id":{"$ref":"#/components/schemas/ReviewId"}},"required":["createdAt","status","anchor","id"],"type":"object"},"Record_ReviewId.ReviewHighlight_":{"properties":{},"additionalProperties":{"$ref":"#/components/schemas/ReviewHighlight"},"type":"object","description":"Construct a type with a set of properties K of type T"},"ReviewTargetDocument":{"properties":{"updatedAt":{"type":"string"},"highlights":{"$ref":"#/components/schemas/Record_ReviewId.ReviewHighlight_"},"suggestions":{"$ref":"#/components/schemas/Record_ReviewId.ReviewSuggestion_"},"comments":{"$ref":"#/components/schemas/Record_ReviewId.ReviewCommentThread_"}},"type":"object"},"Record_ReviewTargetId.ReviewTargetDocument_":{"properties":{},"additionalProperties":{"$ref":"#/components/schemas/ReviewTargetDocument"},"type":"object","description":"Construct a type with a set of properties K of type T"},"ReviewTargetId":{"type":"string"},"ReviewHistoryEventType":{"type":"string","enum":["created","replied","resolved","reopened","accepted","rejected","orphaned","anchor_repaired","assigned","unassigned","deleted","reply_deleted"]},"ReviewHistoryEvent":{"properties":{"metadata":{"$ref":"#/components/schemas/Record_string.unknown_"},"at":{"type":"string"},"actor":{"$ref":"#/components/schemas/ReviewAuthor"},"type":{"$ref":"#/components/schemas/ReviewHistoryEventType"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"reviewId":{"$ref":"#/components/schemas/ReviewId"},"id":{"$ref":"#/components/schemas/ReviewId"}},"required":["at","type","targetId","reviewId","id"],"type":"object"},"ReviewCommandReceipt":{"properties":{"quotaOperationId":{"type":"string","description":"Attempt-scoped usage reservation finalized by receipt-aware retries."},"eventIds":{"items":{"$ref":"#/components/schemas/ReviewId"},"type":"array"},"appliedAt":{"type":"string"}},"required":["eventIds","appliedAt"],"type":"object"},"Record_string.ReviewCommandReceipt_":{"properties":{},"additionalProperties":{"$ref":"#/components/schemas/ReviewCommandReceipt"},"type":"object","description":"Construct a type with a set of properties K of type T"},"ReviewDocument":{"properties":{"updatedAt":{"type":"string"},"commandReceipts":{"$ref":"#/components/schemas/Record_string.ReviewCommandReceipt_","description":"Server-written receipts used to make command batches safe to replay."},"history":{"items":{"$ref":"#/components/schemas/ReviewHistoryEvent"},"type":"array"},"targets":{"$ref":"#/components/schemas/Record_ReviewTargetId.ReviewTargetDocument_"},"version":{"type":"number","enum":[1],"nullable":false}},"required":["targets","version"],"type":"object"},"RestoreVersionResponse":{"properties":{"message":{"type":"string"},"newVersionId":{"type":"string"},"restoredFromVersionId":{"type":"string"},"articleRevision":{"type":"number","format":"double"},"contentRevision":{"type":"number","format":"double"},"contentHash":{"type":"string"},"contentHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"reviewReconciliation":{"$ref":"#/components/schemas/ReviewReconciliationSummary"},"review":{"$ref":"#/components/schemas/ReviewDocument"},"contentS3Key":{"type":"string"},"contentUpdatedAt":{"type":"number","format":"double"}},"required":["message","newVersionId","restoredFromVersionId"],"type":"object","additionalProperties":false},"VersionDiffResponse":{"properties":{"fromVersion":{"properties":{"versionNumber":{"type":"number","format":"double"},"versionId":{"type":"string"}},"required":["versionNumber","versionId"],"type":"object"},"toVersion":{"properties":{"versionNumber":{"type":"number","format":"double"},"versionId":{"type":"string"}},"required":["versionNumber","versionId"],"type":"object"},"diff":{"items":{"properties":{"content":{"type":"string"},"line":{"type":"number","format":"double"},"type":{"type":"string","enum":["added","removed","unchanged"]}},"required":["content","line","type"],"type":"object"},"type":"array"}},"required":["fromVersion","toVersion","diff"],"type":"object","additionalProperties":false},"DeleteVersionResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"UploadResponse":{"properties":{"signedUrl":{"type":"string"},"expiresInSeconds":{"type":"number","format":"double"}},"required":["signedUrl","expiresInSeconds"],"type":"object","additionalProperties":false},"UploadErrorResponse":{"properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"],"type":"object","additionalProperties":false},"UploadRequest":{"properties":{"key":{"type":"string"},"action":{"type":"string","enum":["putObject"],"nullable":false},"contentType":{"type":"string"}},"required":["key","action"],"type":"object","additionalProperties":false},"MarkdownLinkifyResponse":{"properties":{"markdown":{"type":"string"}},"required":["markdown"],"type":"object","additionalProperties":false},"MarkdownLinkifyRequest":{"properties":{"markdown":{"type":"string"}},"required":["markdown"],"type":"object","additionalProperties":false},"ConversionResponse":{"description":"Conversion response","properties":{"jobId":{"type":"string"},"statusUrl":{"type":"string"},"conversion":{"properties":{"outputFormat":{"type":"string"},"inputFormat":{"type":"string"},"type":{"type":"string"}},"required":["outputFormat","inputFormat","type"],"type":"object"}},"required":["jobId","statusUrl","conversion"],"type":"object","additionalProperties":false},"ConversionType.PDF":{"enum":["pdf"],"type":"string"},"InputFormat.MARKDOWN":{"enum":["markdown"],"type":"string"},"InputFormat.HTML":{"enum":["html"],"type":"string"},"PdfConversionRequest":{"description":"PDF conversion request (markdown or html to PDF)","properties":{"inputKey":{"type":"string"},"outputFileName":{"type":"string"},"toolRunId":{"type":"string","description":"Client-side execution ID used only for cross-surface observability correlation."},"type":{"$ref":"#/components/schemas/ConversionType.PDF"},"inputFormat":{"anyOf":[{"$ref":"#/components/schemas/InputFormat.MARKDOWN"},{"$ref":"#/components/schemas/InputFormat.HTML"}]}},"required":["inputKey","type","inputFormat"],"type":"object","additionalProperties":false},"ConversionType.MP3":{"enum":["mp3"],"type":"string"},"Mp3ConversionRequest":{"description":"MP3 (text-to-speech) conversion request","properties":{"inputKey":{"type":"string"},"outputFileName":{"type":"string"},"toolRunId":{"type":"string","description":"Client-side execution ID used only for cross-surface observability correlation."},"type":{"$ref":"#/components/schemas/ConversionType.MP3"},"inputFormat":{"anyOf":[{"$ref":"#/components/schemas/InputFormat.MARKDOWN"},{"$ref":"#/components/schemas/InputFormat.HTML"}]},"voiceId":{"type":"string"}},"required":["inputKey","type","inputFormat"],"type":"object","additionalProperties":false},"ConversionType.ZIP":{"enum":["zip"],"type":"string"},"ZipConversionRequest":{"description":"ZIP conversion request (markdown to zip with assets)","properties":{"inputKey":{"type":"string"},"outputFileName":{"type":"string"},"toolRunId":{"type":"string","description":"Client-side execution ID used only for cross-surface observability correlation."},"type":{"$ref":"#/components/schemas/ConversionType.ZIP"},"inputFormat":{"$ref":"#/components/schemas/InputFormat.MARKDOWN"}},"required":["inputKey","type","inputFormat"],"type":"object","additionalProperties":false},"ConversionType.PANDOC":{"enum":["pandoc"],"type":"string"},"PandocConversionRequest":{"description":"Pandoc conversion request (generic format conversion)","properties":{"inputKey":{"type":"string"},"outputFileName":{"type":"string"},"toolRunId":{"type":"string","description":"Client-side execution ID used only for cross-surface observability correlation."},"type":{"$ref":"#/components/schemas/ConversionType.PANDOC"},"inputFormat":{"type":"string"},"outputFormat":{"type":"string"},"project":{"properties":{"entrypoint":{"type":"string"},"archiveFormat":{"type":"string","enum":["zip"],"nullable":false}},"required":["archiveFormat"],"type":"object","description":"Optional atomic LaTeX project archive. Only valid for LaTeX-to-PDF jobs."}},"required":["inputKey","type","inputFormat","outputFormat"],"type":"object","additionalProperties":false},"ConversionType.MARKITDOWN":{"enum":["markitdown"],"type":"string"},"MarkItDownConversionRequest":{"description":"MarkItDown conversion request (constrained document imports to Markdown)","properties":{"inputKey":{"type":"string"},"outputFileName":{"type":"string"},"toolRunId":{"type":"string","description":"Client-side execution ID used only for cross-surface observability correlation."},"type":{"$ref":"#/components/schemas/ConversionType.MARKITDOWN"},"inputFormat":{"type":"string"}},"required":["inputKey","type","inputFormat"],"type":"object","additionalProperties":false},"ConversionRequest":{"anyOf":[{"$ref":"#/components/schemas/PdfConversionRequest"},{"$ref":"#/components/schemas/Mp3ConversionRequest"},{"$ref":"#/components/schemas/ZipConversionRequest"},{"$ref":"#/components/schemas/PandocConversionRequest"},{"$ref":"#/components/schemas/MarkItDownConversionRequest"}],"description":"Discriminated union of all conversion request types"},"ConversionAccessResponse":{"properties":{"allowed":{"type":"boolean","enum":[true],"nullable":false},"conversion":{"properties":{"requiredFeatures":{"items":{"type":"string"},"type":"array"},"outputFormat":{"type":"string"},"inputFormat":{"type":"string"},"type":{"type":"string"}},"required":["requiredFeatures","outputFormat","inputFormat","type"],"type":"object"}},"required":["allowed","conversion"],"type":"object","additionalProperties":false},"PdfConversionAccessRequest":{"properties":{"inputFormat":{"anyOf":[{"$ref":"#/components/schemas/InputFormat.MARKDOWN"},{"$ref":"#/components/schemas/InputFormat.HTML"}]},"type":{"$ref":"#/components/schemas/ConversionType.PDF"}},"required":["inputFormat","type"],"type":"object","additionalProperties":false},"Mp3ConversionAccessRequest":{"properties":{"inputFormat":{"anyOf":[{"$ref":"#/components/schemas/InputFormat.MARKDOWN"},{"$ref":"#/components/schemas/InputFormat.HTML"}]},"type":{"$ref":"#/components/schemas/ConversionType.MP3"}},"required":["inputFormat","type"],"type":"object","additionalProperties":false},"ZipConversionAccessRequest":{"properties":{"inputFormat":{"$ref":"#/components/schemas/InputFormat.MARKDOWN"},"type":{"$ref":"#/components/schemas/ConversionType.ZIP"}},"required":["inputFormat","type"],"type":"object","additionalProperties":false},"PandocConversionAccessRequest":{"properties":{"inputFormat":{"type":"string"},"type":{"$ref":"#/components/schemas/ConversionType.PANDOC"},"outputFormat":{"type":"string"}},"required":["inputFormat","type","outputFormat"],"type":"object","additionalProperties":false},"MarkItDownConversionAccessRequest":{"properties":{"inputFormat":{"type":"string"},"type":{"$ref":"#/components/schemas/ConversionType.MARKITDOWN"}},"required":["inputFormat","type"],"type":"object","additionalProperties":false},"ConversionAccessRequest":{"anyOf":[{"$ref":"#/components/schemas/PdfConversionAccessRequest"},{"$ref":"#/components/schemas/Mp3ConversionAccessRequest"},{"$ref":"#/components/schemas/ZipConversionAccessRequest"},{"$ref":"#/components/schemas/PandocConversionAccessRequest"},{"$ref":"#/components/schemas/MarkItDownConversionAccessRequest"}]},"ToolJobStatusResponse":{"description":"Status of a queued conversion job, shared by the anonymous `/tools/jobs/{jobId}`\npolling route and the scoped `/conversions/{jobId}` route.","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"progress":{"type":"number","format":"double"},"createdAt":{"type":"string"},"processedAt":{"type":"string"},"finishedAt":{"type":"string"},"failedReason":{"type":"string"},"errorCode":{"type":"string"},"errorDetails":{"properties":{"candidateEntrypoints":{"items":{"type":"string"},"type":"array"}},"type":"object"},"downloadUrl":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"expiresAt":{"type":"string"}},"required":["jobId","status","progress","createdAt"],"type":"object","additionalProperties":false},"TemplateWithContentResponse":{"properties":{"templateId":{"type":"string"},"ownerUsername":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"category":{"type":"string","enum":["writing","documentation","planning","general","custom","resume"]},"description":{"type":"string"},"visibility":{"type":"string","enum":["private","workspace","public"]},"workspaceId":{"type":"string"},"s3Key":{"type":"string"},"contentHash":{"type":"string"},"version":{"type":"number","format":"double"},"tags":{"items":{"type":"string"},"type":"array"},"previewLines":{"type":"string"},"usageCount":{"type":"number","format":"double"},"lastUsedAt":{"type":"number","format":"double"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"content":{"type":"string"}},"required":["templateId","ownerUsername","name","slug","category","description","visibility","s3Key","version","tags","previewLines","createdAt","updatedAt","content"],"type":"object","additionalProperties":false},"Template":{"properties":{"templateId":{"type":"string"},"ownerUsername":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"category":{"type":"string","enum":["writing","documentation","planning","general","custom","resume"]},"description":{"type":"string"},"visibility":{"type":"string","enum":["private","workspace","public"]},"workspaceId":{"type":"string"},"s3Key":{"type":"string"},"contentHash":{"type":"string"},"version":{"type":"number","format":"double"},"tags":{"items":{"type":"string"},"type":"array"},"previewLines":{"type":"string"},"usageCount":{"type":"number","format":"double"},"lastUsedAt":{"type":"number","format":"double"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"}},"required":["templateId","ownerUsername","name","slug","category","description","visibility","s3Key","version","tags","previewLines","createdAt","updatedAt"],"type":"object","additionalProperties":false},"UpdateTemplateRequest":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"category":{"type":"string","enum":["writing","documentation","planning","general","custom"]},"content":{"type":"string"}},"type":"object","additionalProperties":false},"TemplateMessageResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"SaveArticleAsTemplateRequest":{"properties":{"name":{"type":"string"},"slug":{"type":"string"},"category":{"type":"string","enum":["writing","documentation","planning","general","custom"]},"description":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"visibility":{"type":"string","enum":["private","workspace"]}},"required":["name","slug","category","description","tags","visibility"],"type":"object","additionalProperties":false},"DeleteSubscriptionResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"CreateSubscriptionResponse":{"properties":{"id":{"type":"string"},"username":{"type":"string"},"message":{"type":"string"}},"required":["id","username","message"],"type":"object","additionalProperties":false},"ProductType":{"enum":["STANDARD_PLAN","PREMIUM_PLAN","UNKNOWN"],"type":"string"},"SubscriptionStatus":{"enum":["active","past_due","unpaid","canceled","incomplete","incomplete_expired","trialing","paused"],"type":"string"},"CreateSubscriptionRequest":{"properties":{"productType":{"$ref":"#/components/schemas/ProductType"},"status":{"$ref":"#/components/schemas/SubscriptionStatus"},"expiry":{"type":"number","format":"double"}},"required":["productType","status","expiry"],"type":"object","additionalProperties":false},"CancelSubscriptionResponse":{"properties":{"canceled":{"type":"boolean"}},"required":["canceled"],"type":"object","additionalProperties":false},"CheckoutSessionResponse":{"properties":{"sessionUrl":{"type":"string"}},"required":["sessionUrl"],"type":"object","additionalProperties":false},"CheckoutSessionRequest":{"properties":{"redirectBaseUrl":{"type":"string"},"planTier":{"type":"string","enum":["STANDARD_PLAN","PREMIUM_PLAN"]},"planType":{"type":"string","enum":["monthly","yearly"]},"offerId":{"type":"string"}},"required":["redirectBaseUrl","planTier","planType"],"type":"object","additionalProperties":false},"PortalSessionResponse":{"properties":{"sessionUrl":{"type":"string"}},"required":["sessionUrl"],"type":"object","additionalProperties":false},"PortalSessionRequest":{"properties":{"redirectBaseUrl":{"type":"string"}},"required":["redirectBaseUrl"],"type":"object","additionalProperties":false},"StyleProfileScopeType":{"type":"string","enum":["writer","project"],"description":"Type definitions for the RDS-backed style profile system.\n\nThese replace the legacy MdhStyleProfile (DynamoDB) with a richer two-layer model:\n  - StyleProfile     — baseline profile stored in style_profiles table\n  - StyleMemory      — dynamic fact stored in style_memories (pgvector)\n  - MergedStyleProfile — merged view used for prompt injection"},"Record_string.string_":{"properties":{},"additionalProperties":{"type":"string"},"type":"object","description":"Construct a type with a set of properties K of type T"},"StyleProfileVoiceExemplar":{"properties":{"excerpt":{"type":"string"},"sourceArticleId":{"type":"string"},"sourceResourceId":{"type":"string"},"sourceTitle":{"type":"string"}},"required":["excerpt"],"type":"object","additionalProperties":false},"StyleProfile":{"properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"scopeType":{"$ref":"#/components/schemas/StyleProfileScopeType"},"scopeId":{"type":"string"},"name":{"type":"string"},"tone":{"type":"string"},"audience":{"type":"string"},"seoIntent":{"type":"string"},"headingStyle":{"type":"string"},"openingStyle":{"type":"string"},"transitionStyle":{"type":"string"},"conceptIntroduction":{"type":"string"},"conclusionStyle":{"type":"string"},"sentenceLength":{"type":"string"},"vocabularyLevel":{"type":"string"},"patternsToAvoid":{"items":{"type":"string"},"type":"array"},"editorialPositions":{"$ref":"#/components/schemas/Record_string.string_"},"customInstructions":{"type":"string"},"styleBrief":{"type":"string"},"positiveExamples":{"items":{"type":"string"},"type":"array"},"negativeExamples":{"items":{"type":"string"},"type":"array"},"voiceExemplars":{"items":{"$ref":"#/components/schemas/StyleProfileVoiceExemplar"},"type":"array"},"projectBrief":{"type":"string"},"clientRequirements":{"type":"string"},"clientFeedback":{"type":"string"},"sourceArticleIds":{"items":{"type":"string"},"type":"array"},"sourceResourceIds":{"items":{"type":"string"},"type":"array"},"manualFields":{"items":{"type":"string"},"type":"array"},"provenance":{"$ref":"#/components/schemas/Record_string.unknown_"},"usageCount":{"type":"number","format":"double"},"lastUsedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","workspaceId","scopeType","scopeId","name","usageCount","createdAt","updatedAt"],"type":"object","additionalProperties":false},"ErrorResponse":{"description":"Standard error response format returned by the API for all HttpStatusError\ninstances. Frontend consumers should expect this shape for 4xx/5xx responses\nproduced by the agentic writing endpoints.","properties":{"error":{"type":"string","description":"Human-readable error message"},"statusCode":{"type":"number","format":"double","description":"HTTP status code"},"code":{"type":"string","description":"Machine-readable error code (e.g. \"RUN_NOT_FOUND\", \"QUOTA_EXCEEDED\")"},"details":{"description":"Additional context about the error (optional)"},"timestamp":{"type":"number","format":"double","description":"Unix timestamp (ms) when the error occurred"}},"required":["error","statusCode","timestamp"],"type":"object","additionalProperties":false},"CreateProfileBody":{"properties":{"workspaceId":{"type":"string"},"scopeType":{"type":"string","enum":["writer","project"]},"scopeId":{"type":"string"},"name":{"type":"string"},"tone":{"type":"string"},"audience":{"type":"string"},"seoIntent":{"type":"string"},"headingStyle":{"type":"string"},"openingStyle":{"type":"string"},"transitionStyle":{"type":"string"},"conceptIntroduction":{"type":"string"},"conclusionStyle":{"type":"string"},"sentenceLength":{"type":"string"},"vocabularyLevel":{"type":"string"},"patternsToAvoid":{"items":{"type":"string"},"type":"array"},"editorialPositions":{"$ref":"#/components/schemas/Record_string.string_"},"customInstructions":{"type":"string"},"styleBrief":{"type":"string"},"positiveExamples":{"items":{"type":"string"},"type":"array"},"negativeExamples":{"items":{"type":"string"},"type":"array"},"voiceExemplars":{"items":{"$ref":"#/components/schemas/StyleProfileVoiceExemplar"},"type":"array"},"projectBrief":{"type":"string"},"clientRequirements":{"type":"string"},"clientFeedback":{"type":"string"},"sourceResourceIds":{"items":{"type":"string"},"type":"array"}},"required":["workspaceId","scopeType","scopeId","name"],"type":"object","additionalProperties":false},"ExtractStyleProfileBody":{"properties":{"profileId":{"type":"string"},"articleIds":{"items":{"type":"string"},"type":"array"}},"required":["profileId","articleIds"],"type":"object","additionalProperties":false},"UpdateStyleProfileRequest":{"properties":{"name":{"type":"string"},"tone":{"type":"string"},"audience":{"type":"string"},"seoIntent":{"type":"string"},"headingStyle":{"type":"string"},"openingStyle":{"type":"string"},"transitionStyle":{"type":"string"},"conceptIntroduction":{"type":"string"},"conclusionStyle":{"type":"string"},"sentenceLength":{"type":"string"},"vocabularyLevel":{"type":"string"},"patternsToAvoid":{"items":{"type":"string"},"type":"array"},"editorialPositions":{"$ref":"#/components/schemas/Record_string.string_"},"customInstructions":{"type":"string"},"styleBrief":{"type":"string"},"positiveExamples":{"items":{"type":"string"},"type":"array"},"negativeExamples":{"items":{"type":"string"},"type":"array"},"voiceExemplars":{"items":{"$ref":"#/components/schemas/StyleProfileVoiceExemplar"},"type":"array"},"projectBrief":{"type":"string"},"clientRequirements":{"type":"string"},"clientFeedback":{"type":"string"},"sourceArticleIds":{"items":{"type":"string"},"type":"array"},"sourceResourceIds":{"items":{"type":"string"},"type":"array"},"manualFields":{"items":{"type":"string"},"type":"array"},"provenance":{"$ref":"#/components/schemas/Record_string.unknown_"}},"type":"object","additionalProperties":false},"ResourceScopeType":{"type":"string","enum":["workspace","folder","article"],"description":"AI Resource Type Definitions\nResources are attachable context items (URLs/files) scoped to workspace/folder/article."},"ResourceType":{"type":"string","enum":["url","file"]},"ResourceStatus":{"type":"string","enum":["pending","ingested","failed","pending_upload"]},"ResourceListItem":{"properties":{"resourceId":{"type":"string"},"scopeType":{"$ref":"#/components/schemas/ResourceScopeType"},"scopeId":{"type":"string"},"type":{"$ref":"#/components/schemas/ResourceType"},"uri":{"type":"string"},"title":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"priority":{"type":"number","format":"double"},"enabled":{"type":"boolean"},"status":{"$ref":"#/components/schemas/ResourceStatus"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"lastIngestedAt":{"type":"number","format":"double"},"errorMessage":{"type":"string"},"metadata":{"properties":{"fetchedAt":{"type":"number","format":"double"},"charCount":{"type":"number","format":"double"},"summary":{"type":"string"},"sizeBytes":{"type":"number","format":"double"},"contentType":{"type":"string"}},"type":"object"}},"required":["resourceId","scopeType","scopeId","type","uri","enabled","status","createdAt","updatedAt"],"type":"object","additionalProperties":false},"ListResourcesResponse":{"properties":{"resources":{"items":{"$ref":"#/components/schemas/ResourceListItem"},"type":"array"}},"required":["resources"],"type":"object","additionalProperties":false},"CreateUrlResourceBody":{"properties":{"scopeType":{"$ref":"#/components/schemas/ResourceScopeType"},"scopeId":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"enabled":{"type":"boolean"}},"required":["scopeType","scopeId","url"],"type":"object","additionalProperties":false},"CreateUploadUrlResponse":{"properties":{"resourceId":{"type":"string"},"uploadUrl":{"type":"string"},"s3Key":{"type":"string"},"expiresIn":{"type":"number","format":"double"}},"required":["resourceId","uploadUrl","s3Key","expiresIn"],"type":"object","additionalProperties":false},"CreateUploadUrlBody":{"properties":{"scopeType":{"$ref":"#/components/schemas/ResourceScopeType"},"scopeId":{"type":"string"},"fileName":{"type":"string"},"contentType":{"type":"string"},"title":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"enabled":{"type":"boolean"}},"required":["scopeType","scopeId","fileName","contentType"],"type":"object","additionalProperties":false},"UpdateResourceBody":{"properties":{"title":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"enabled":{"type":"boolean"}},"type":"object","additionalProperties":false},"RenderType":{"type":"string","enum":["diagram","code"]},"RenderFormat":{"type":"string","enum":["png","svg","webp","pdf"]},"RenderResponse":{"properties":{"success":{"type":"boolean"},"type":{"$ref":"#/components/schemas/RenderType"},"image":{"type":"string"},"format":{"$ref":"#/components/schemas/RenderFormat"},"width":{"type":"number","format":"double"},"height":{"type":"number","format":"double"},"errorKind":{"type":"string","enum":["user","infra"]},"metadata":{"properties":{"cacheHit":{"type":"boolean"},"renderTime":{"type":"number","format":"double"}},"required":["renderTime"],"type":"object"},"error":{"type":"string"},"details":{"type":"string"}},"required":["success"],"type":"object","additionalProperties":false},"MermaidRenderFormat":{"type":"string","enum":["png","svg","webp","pdf"]},"DiagramType":{"type":"string","enum":["mermaid","markmap","graphviz","dot","vega_lite","plotly","d3_scene"]},"VisualTheme":{"type":"string","enum":["pastel","pastel-dark","openhearted-v2","neo","neo-dark"]},"VisualLook":{"type":"string","enum":["classic","handdrawn"]},"VisualStyle":{"properties":{"look":{"$ref":"#/components/schemas/VisualLook"},"theme":{"$ref":"#/components/schemas/VisualTheme"}},"required":["look","theme"],"type":"object"},"DiagramOptions":{"properties":{"diagramType":{"$ref":"#/components/schemas/DiagramType"},"visualStyle":{"$ref":"#/components/schemas/VisualStyle"}},"required":["diagramType"],"type":"object","additionalProperties":false},"CommonOptions":{"properties":{"width":{"type":"number","format":"double"},"height":{"type":"number","format":"double"},"backgroundColor":{"type":"string"},"scale":{"type":"number","enum":[1,2,4]},"transparent":{"type":"boolean"}},"type":"object","additionalProperties":false},"MermaidDiagramRenderRequest":{"properties":{"content":{"type":"string"},"options":{"$ref":"#/components/schemas/CommonOptions"},"type":{"type":"string","enum":["diagram"],"nullable":false},"format":{"$ref":"#/components/schemas/MermaidRenderFormat"},"diagramOptions":{"allOf":[{"$ref":"#/components/schemas/DiagramOptions"},{"properties":{"diagramType":{"type":"string","enum":["mermaid"],"nullable":false}},"required":["diagramType"],"type":"object"}]}},"required":["content","type","diagramOptions"],"type":"object","additionalProperties":false},"DiagramRenderFormat":{"type":"string","enum":["png","svg","webp"]},"StandardDiagramType":{"type":"string","enum":["markmap","graphviz","dot","vega_lite","plotly","d3_scene"]},"StandardDiagramRenderRequest":{"properties":{"content":{"type":"string"},"options":{"$ref":"#/components/schemas/CommonOptions"},"type":{"type":"string","enum":["diagram"],"nullable":false},"format":{"$ref":"#/components/schemas/DiagramRenderFormat"},"diagramOptions":{"allOf":[{"$ref":"#/components/schemas/DiagramOptions"},{"properties":{"diagramType":{"$ref":"#/components/schemas/StandardDiagramType"}},"required":["diagramType"],"type":"object"}]}},"required":["content","type","diagramOptions"],"type":"object","additionalProperties":false},"CodeRenderFormat":{"type":"string","enum":["png","webp"]},"CodeMediaLanguage":{"type":"string","enum":["javascript","typescript","python","go","rust","java","cpp","csharp","html","css","sql","bash","text"]},"CodeMediaTheme":{"type":"string","enum":["dracula","github","nord","monokai","one-dark"]},"CodeMediaWindowChrome":{"type":"string","enum":["none","macos","windows","linux"]},"CodeOptions":{"properties":{"language":{"$ref":"#/components/schemas/CodeMediaLanguage"},"theme":{"$ref":"#/components/schemas/CodeMediaTheme"},"font":{"type":"string"},"fontSize":{"type":"number","format":"double"},"lineNumbers":{"type":"boolean"},"lineNumberStart":{"type":"number","format":"double"},"highlightLines":{"items":{"type":"number","format":"double"},"type":"array"},"highlightRanges":{"items":{"properties":{"end":{"type":"number","format":"double"},"start":{"type":"number","format":"double"}},"required":["end","start"],"type":"object"},"type":"array"},"windowChrome":{"$ref":"#/components/schemas/CodeMediaWindowChrome"},"windowTheme":{"type":"string","enum":["dark","light"]},"padding":{"anyOf":[{"type":"number","format":"double"},{"properties":{"left":{"type":"number","format":"double"},"bottom":{"type":"number","format":"double"},"right":{"type":"number","format":"double"},"top":{"type":"number","format":"double"}},"required":["left","bottom","right","top"],"type":"object"}]},"shadow":{"anyOf":[{"type":"boolean"},{"properties":{"color":{"type":"string"},"blur":{"type":"number","format":"double"},"y":{"type":"number","format":"double"},"x":{"type":"number","format":"double"}},"required":["color","blur","y","x"],"type":"object"}]},"watermark":{"anyOf":[{"type":"string"},{"properties":{"position":{"type":"string","enum":["bottom-right","bottom-left"]},"text":{"type":"string"}},"required":["position","text"],"type":"object"}]},"tabSize":{"type":"number","format":"double"},"lineHeight":{"type":"number","format":"double"},"borderRadius":{"type":"number","format":"double"},"scale":{"type":"number","enum":[1,2,4]},"tilt":{"anyOf":[{"type":"boolean"},{"properties":{"y":{"type":"number","format":"double"},"x":{"type":"number","format":"double"}},"required":["y","x"],"type":"object"}]},"overlay":{"properties":{"style":{"type":"string"},"position":{"type":"string","enum":["top-left","top-right","bottom-left","bottom-right"]},"icon":{"type":"string"},"text":{"type":"string"}},"type":"object"},"blockDecorations":{"items":{"properties":{"message":{"type":"string"},"type":{"type":"string","enum":["error","warning","info","success"]},"line":{"type":"number","format":"double"}},"required":["type","line"],"type":"object"},"type":"array"}},"type":"object","additionalProperties":false},"CodeRenderRequest":{"properties":{"content":{"type":"string"},"options":{"$ref":"#/components/schemas/CommonOptions"},"type":{"type":"string","enum":["code"],"nullable":false},"format":{"$ref":"#/components/schemas/CodeRenderFormat"},"codeOptions":{"$ref":"#/components/schemas/CodeOptions"}},"required":["content","type"],"type":"object","additionalProperties":false},"RenderApiRequest":{"anyOf":[{"$ref":"#/components/schemas/MermaidDiagramRenderRequest"},{"$ref":"#/components/schemas/StandardDiagramRenderRequest"},{"$ref":"#/components/schemas/CodeRenderRequest"}]},"PublicationMode":{"type":"string","enum":["snapshot","live"]},"PublicationSyncStatus":{"type":"string","enum":["idle","queued","syncing","succeeded","failed"]},"PublishStatusResponseBody":{"properties":{"isPublished":{"type":"boolean"},"publishId":{"type":"string"},"shortUrl":{"type":"string"},"fullUrl":{"type":"string"},"publishedAt":{"type":"number","format":"double"},"lastUpdated":{"type":"number","format":"double"},"viewCount":{"type":"number","format":"double"},"customSlug":{"type":"string"},"seoMetadata":{"properties":{"keywords":{"items":{"type":"string"},"type":"array"},"image":{"type":"string"},"description":{"type":"string"},"title":{"type":"string"}},"type":"object"},"mode":{"$ref":"#/components/schemas/PublicationMode"},"sourceArticleRevision":{"type":"number","format":"double"},"sourceContentRevision":{"type":"number","format":"double"},"sourcePackageRevision":{"type":"number","format":"double"},"sourceContentHash":{"type":"string"},"sourceVersionId":{"type":"string"},"lastSuccessfulSyncAt":{"type":"number","format":"double"},"syncStatus":{"$ref":"#/components/schemas/PublicationSyncStatus"},"syncError":{"type":"string"}},"required":["isPublished"],"type":"object","additionalProperties":false},"PublishResponseBody":{"properties":{"publishId":{"type":"string"},"shortUrl":{"type":"string"},"fullUrl":{"type":"string"},"publishedAt":{"type":"number","format":"double"},"mode":{"$ref":"#/components/schemas/PublicationMode"},"sourceArticleRevision":{"type":"number","format":"double"},"sourceContentRevision":{"type":"number","format":"double"},"sourcePackageRevision":{"type":"number","format":"double"},"sourceContentHash":{"type":"string"},"sourceVersionId":{"type":"string"},"lastSuccessfulSyncAt":{"type":"number","format":"double"},"syncStatus":{"$ref":"#/components/schemas/PublicationSyncStatus"}},"required":["publishId","shortUrl","fullUrl","publishedAt","mode","syncStatus"],"type":"object","additionalProperties":false},"PublishRequestBody":{"properties":{"customSlug":{"type":"string"},"seoMetadata":{"properties":{"keywords":{"items":{"type":"string"},"type":"array"},"image":{"type":"string"},"description":{"type":"string"},"title":{"type":"string"}},"type":"object"},"content":{"type":"string"},"mode":{"$ref":"#/components/schemas/PublicationMode"},"defaultModeIfUnpublished":{"$ref":"#/components/schemas/PublicationMode","description":"Used only when this request creates the article's first public link."}},"type":"object","additionalProperties":false},"ExternalPublishStatus":{"type":"string","enum":["draft","published"]},"ExternalPublishResponseBody":{"properties":{"platform":{"type":"string","enum":["devto","hashnode"]},"externalId":{"type":"string"},"url":{"type":"string"},"status":{"$ref":"#/components/schemas/ExternalPublishStatus"}},"required":["platform","status"],"type":"object","additionalProperties":false},"ExternalPublishRequestBody":{"properties":{"platform":{"type":"string"},"apiKey":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"canonicalUrl":{"type":"string"},"publishStatus":{"$ref":"#/components/schemas/ExternalPublishStatus"},"hashnodePublicationId":{"type":"string"}},"required":["platform","apiKey"],"type":"object","additionalProperties":false},"UnpublishResponseBody":{"properties":{"success":{"type":"boolean"},"publishId":{"type":"string"}},"required":["success","publishId"],"type":"object","additionalProperties":false},"PublishedListResponseBody":{"properties":{"publishedArticles":{"items":{"properties":{"syncError":{"type":"string"},"syncStatus":{"$ref":"#/components/schemas/PublicationSyncStatus"},"lastSuccessfulSyncAt":{"type":"number","format":"double"},"sourceVersionId":{"type":"string"},"sourceContentHash":{"type":"string"},"sourcePackageRevision":{"type":"number","format":"double"},"sourceContentRevision":{"type":"number","format":"double"},"sourceArticleRevision":{"type":"number","format":"double"},"mode":{"$ref":"#/components/schemas/PublicationMode"},"fullUrl":{"type":"string"},"shortUrl":{"type":"string"},"viewCount":{"type":"number","format":"double"},"lastUpdated":{"type":"number","format":"double"},"publishedAt":{"type":"number","format":"double"},"title":{"type":"string"},"articleId":{"type":"string"},"publishId":{"type":"string"}},"required":["syncStatus","mode","fullUrl","shortUrl","viewCount","lastUpdated","publishedAt","title","articleId","publishId"],"type":"object"},"type":"array"},"pagination":{"properties":{"limit":{"type":"number","format":"double"},"hasMore":{"type":"boolean"},"nextToken":{"type":"string"}},"required":["limit","hasMore"],"type":"object"}},"required":["publishedArticles","pagination"],"type":"object","additionalProperties":false},"AppKey":{"type":"string","enum":["mdedit","cowrite"]},"SeoMetadata":{"properties":{"title":{"type":"string"},"description":{"type":"string"},"image":{"type":"string"},"keywords":{"items":{"type":"string"},"type":"array"}},"type":"object","additionalProperties":false},"Pick_PublishedArticleRecord.Exclude_keyofPublishedArticleRecord.syncError-or-syncRequestedArticleRevision-or-syncRequestedContentHash__":{"properties":{"workspaceId":{"type":"string"},"publishId":{"type":"string"},"articleId":{"type":"string"},"userId":{"type":"string"},"appKey":{"$ref":"#/components/schemas/AppKey","description":"Multi-app scoping: which app domain this publish was created under.\nBackward compat: missing appKey implies `mdedit`."},"title":{"type":"string"},"content":{"type":"string"},"contentS3Key":{"type":"string"},"publishedAt":{"type":"number","format":"double"},"lastUpdated":{"type":"number","format":"double"},"viewCount":{"type":"number","format":"double"},"isActive":{"type":"boolean"},"customSlug":{"type":"string"},"seoMetadata":{"$ref":"#/components/schemas/SeoMetadata"},"mode":{"$ref":"#/components/schemas/PublicationMode","description":"Backward compatibility: a missing mode is an explicit snapshot."},"sourceArticleRevision":{"type":"number","format":"double"},"sourceContentRevision":{"type":"number","format":"double"},"sourcePackageRevision":{"type":"number","format":"double"},"sourceContentHash":{"type":"string"},"sourceVersionId":{"type":"string"},"lastSuccessfulSyncAt":{"type":"number","format":"double"},"syncStatus":{"$ref":"#/components/schemas/PublicationSyncStatus"}},"required":["workspaceId","publishId","articleId","userId","title","publishedAt","lastUpdated","viewCount","isActive"],"type":"object","description":"From T, pick a set of properties whose keys are in the union K"},"Omit_PublishedArticleRecord.syncError-or-syncRequestedArticleRevision-or-syncRequestedContentHash_":{"$ref":"#/components/schemas/Pick_PublishedArticleRecord.Exclude_keyofPublishedArticleRecord.syncError-or-syncRequestedArticleRevision-or-syncRequestedContentHash__","description":"Construct a type with the properties of T except for those in type K."},"PublicPublishedArticleRecord":{"$ref":"#/components/schemas/Omit_PublishedArticleRecord.syncError-or-syncRequestedArticleRevision-or-syncRequestedContentHash_"},"SavePreferencesResponse":{"properties":{"success":{"type":"boolean"}},"required":["success"],"type":"object","additionalProperties":false},"DeletePreferencesResponse":{"properties":{"success":{"type":"boolean"}},"required":["success"],"type":"object","additionalProperties":false},"EmailPreferenceCategories":{"properties":{"product_updates":{"type":"boolean"},"lifecycle_nudges":{"type":"boolean"},"research":{"type":"boolean"}},"required":["product_updates","lifecycle_nudges","research"],"type":"object","additionalProperties":false},"EmailConsentBasis":{"type":"string","enum":["signup_checkbox","legitimate_interest","explicit_optin"]},"EmailPreferenceChangeSource":{"type":"string","enum":["settings","unsubscribe_link","one_click_header","admin"]},"EmailPreferences":{"description":"The read model returned by `GET /preferences/email` and consumed by the\neligibility service. Identical to {@link StoredEmailPreferences} except that\n`sendsTrailing30d` is derived from `recentMarketingSendAts` at read time.","properties":{"categories":{"$ref":"#/components/schemas/EmailPreferenceCategories"},"unsubscribedAllAt":{"type":"number","format":"double","nullable":true},"consentBasis":{"$ref":"#/components/schemas/EmailConsentBasis"},"consentRecordedAt":{"type":"number","format":"double"},"lastMarketingSendAt":{"type":"number","format":"double","nullable":true,"description":"Epoch seconds of the most recent marketing send, or null if never sent to."},"recentMarketingSendAts":{"items":{"type":"number","format":"double"},"type":"array","description":"Epoch-second timestamps of marketing sends inside the trailing 30 day window."},"sourceOfLastChange":{"$ref":"#/components/schemas/EmailPreferenceChangeSource"},"sendsTrailing30d":{"type":"number","format":"double"}},"required":["categories","unsubscribedAllAt","consentBasis","consentRecordedAt","lastMarketingSendAt","recentMarketingSendAts","sourceOfLastChange","sendsTrailing30d"],"type":"object","additionalProperties":false},"Partial_EmailPreferenceCategories_":{"properties":{"product_updates":{"type":"boolean"},"lifecycle_nudges":{"type":"boolean"},"research":{"type":"boolean"}},"type":"object","description":"Make all properties in T optional"},"UpdateEmailPreferencesRequest":{"description":"Body of `PUT /preferences/email`.\n\nThere is deliberately no `source` field: the change source is stamped\nserver-side (`settings` for this authenticated endpoint, `unsubscribe_link`\nor `one_click_header` for the unauthenticated unsubscribe routes) so a\nclient cannot claim to be an admin action.","properties":{"categories":{"$ref":"#/components/schemas/Partial_EmailPreferenceCategories_"},"unsubscribeAll":{"type":"boolean","description":"When true, turns every category off and stamps `unsubscribedAllAt`."}},"type":"object","additionalProperties":false},"Permission":{"properties":{"resourceId":{"type":"string"},"resourceType":{"type":"string","enum":["article","folder","workspace"]},"username":{"type":"string"},"permission":{"type":"string","enum":["read","write","owner"]},"acceptedAt":{"type":"number","format":"double"}},"required":["resourceId","username","permission","acceptedAt"],"type":"object","additionalProperties":false},"UpdatePermissionResponse":{"properties":{"message":{"type":"string"},"username":{"type":"string"},"permission":{"type":"string"}},"required":["message","username","permission"],"type":"object","additionalProperties":false},"UpdatePermissionRequest":{"properties":{"permission":{"type":"string","enum":["read","write","owner"]}},"required":["permission"],"type":"object","additionalProperties":false},"DeletePermissionResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"OAuthConnectionStatus":{"type":"string","enum":["active","revoked"]},"ConnectedOAuthHost":{"properties":{"clientId":{"type":"string"},"firstUsedAt":{"type":"string"},"hostName":{"type":"string"},"lastUsedAt":{"type":"string"},"resource":{"type":"string"},"scopes":{"items":{"type":"string"},"type":"array"},"status":{"$ref":"#/components/schemas/OAuthConnectionStatus"},"revokedAt":{"type":"string"}},"required":["clientId","firstUsedAt","hostName","lastUsedAt","resource","scopes","status"],"type":"object","additionalProperties":false},"ListConnectedOAuthHostsResponse":{"properties":{"connections":{"items":{"$ref":"#/components/schemas/ConnectedOAuthHost"},"type":"array"},"revocation":{"properties":{"perHostSupported":{"type":"boolean","enum":[false],"nullable":false},"granularity":{"type":"string","enum":["all-mdedit-sessions"],"nullable":false},"accessTokenResidualLifetimeMinutes":{"type":"number","enum":[15],"nullable":false}},"required":["perHostSupported","granularity","accessTokenResidualLifetimeMinutes"],"type":"object"}},"required":["connections","revocation"],"type":"object","additionalProperties":false},"RevokeAllOAuthHostsResponse":{"properties":{"affectedConnections":{"type":"number","format":"double"},"message":{"type":"string"},"residualAccessMinutes":{"type":"number","enum":[15],"nullable":false}},"required":["affectedConnections","message","residualAccessMinutes"],"type":"object","additionalProperties":false},"LifecycleMarketingWorkflowId":{"type":"string","enum":["launch_announcement","monthly_product_update","checkout_recovery","feedback_checkin"]},"LifecycleMarketingDryRunResponse":{"properties":{"success":{"type":"boolean"},"dry_run":{"type":"boolean","enum":[true],"nullable":false},"workflow_id":{"$ref":"#/components/schemas/LifecycleMarketingWorkflowId"},"subject":{"type":"string"},"preheader":{"type":"string"},"text_body":{"type":"string"},"html_body":{"type":"string"},"feedback_survey_url":{"type":"string"},"analytics_events":{"items":{"type":"string"},"type":"array"}},"required":["success","dry_run","workflow_id","subject","preheader","text_body","html_body","analytics_events"],"type":"object","additionalProperties":false},"LifecycleMarketingPreviewMetadata":{"properties":{"headline":{"type":"string"},"summary":{"type":"string"},"cta_label":{"type":"string"},"cta_url":{"type":"string"},"product_area":{"type":"string"},"plan_name":{"type":"string"}},"type":"object","additionalProperties":false},"LifecycleMarketingDryRunRequest":{"properties":{"workflow_id":{"$ref":"#/components/schemas/LifecycleMarketingWorkflowId"},"segment":{"type":"string"},"trigger_event":{"type":"string"},"cadence":{"type":"string"},"consent_basis":{"type":"string"},"route":{"type":"string"},"survey_id":{"type":"string"},"preview":{"$ref":"#/components/schemas/LifecycleMarketingPreviewMetadata"}},"required":["workflow_id","segment","trigger_event","cadence","consent_basis"],"type":"object","additionalProperties":false},"JobResponse":{"properties":{"jobId":{"type":"string"},"status":{"type":"string"},"progress":{"anyOf":[{"type":"number","format":"double"},{"type":"string"},{"type":"boolean"},{"$ref":"#/components/schemas/Record_string.unknown_"}]},"createdAt":{"type":"string"},"processedAt":{"type":"string"},"finishedAt":{"type":"string"},"failedReason":{"type":"string"},"result":{}},"required":["jobId","status","progress","createdAt"],"type":"object","additionalProperties":false},"JobNotFoundError":{"properties":{"error":{"type":"string"},"jobId":{"type":"string"}},"required":["error","jobId"],"type":"object","additionalProperties":false},"InviteUserResponse":{"properties":{"message":{"type":"string"},"email":{"type":"string"},"permission":{"type":"string"}},"required":["message","email","permission"],"type":"object","additionalProperties":false},"InviteUserRequest":{"properties":{"email":{"type":"string"},"permission":{"type":"string","enum":["read","write"]}},"required":["email","permission"],"type":"object","additionalProperties":false},"Invitation":{"properties":{"resourceId":{"type":"string"},"resourceType":{"type":"string","enum":["article","folder","workspace"]},"resourceName":{"type":"string"},"appKey":{"$ref":"#/components/schemas/AppKey","description":"Multi-app scoping (mdedit vs cowrite).\nBackward compat: missing appKey implies `mdedit`."},"email":{"type":"string"},"permission":{"type":"string","enum":["read","write"]},"invitedBy":{"type":"string"},"invitedAt":{"type":"number","format":"double"},"expiresAt":{"type":"number","format":"double"},"status":{"type":"string","enum":["pending","accepted","rejected"]},"acceptedAt":{"type":"number","format":"double"},"rejectedAt":{"type":"number","format":"double"}},"required":["resourceId","email","permission","invitedBy","invitedAt"],"type":"object","additionalProperties":false},"DeleteInvitationResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"UpdateInvitationResponse":{"properties":{"message":{"type":"string"},"email":{"type":"string"},"permission":{"type":"string","enum":["read","write"]}},"required":["message","email","permission"],"type":"object","additionalProperties":false},"UpdateInvitationRequest":{"properties":{"permission":{"type":"string","enum":["read","write"]}},"required":["permission"],"type":"object","additionalProperties":false},"AcceptInvitationResponse":{"properties":{"message":{"type":"string"},"resourceId":{"type":"string"},"permission":{"type":"string"},"status":{"type":"string"},"workspaceId":{"type":"string"}},"required":["message","resourceId","permission","status"],"type":"object","additionalProperties":false},"AcceptInvitationRequest":{"properties":{"resourceId":{"type":"string"}},"required":["resourceId"],"type":"object","additionalProperties":false},"RejectInvitationResponse":{"properties":{"message":{"type":"string"},"resourceId":{"type":"string"}},"required":["message","resourceId"],"type":"object","additionalProperties":false},"RejectInvitationRequest":{"properties":{"resourceId":{"type":"string"}},"required":["resourceId"],"type":"object","additionalProperties":false},"ImageResult":{"properties":{"id":{"type":"string"},"url":{"type":"string"},"thumbnailUrl":{"type":"string"},"width":{"type":"number","format":"double"},"height":{"type":"number","format":"double"},"alt":{"type":"string"},"attribution":{"properties":{"sourceName":{"type":"string"},"sourceUrl":{"type":"string"},"authorUrl":{"type":"string"},"authorName":{"type":"string"}},"type":"object"},"metadata":{"properties":{"contentType":{"type":"string","enum":["photo","gif"]},"tags":{"items":{"type":"string"},"type":"array"}},"type":"object"}},"required":["id","url"],"type":"object","additionalProperties":false},"ImageSearchResponse":{"properties":{"query":{"type":"string"},"provider":{"type":"string"},"total":{"type":"number","format":"double"},"images":{"items":{"$ref":"#/components/schemas/ImageResult"},"type":"array"}},"required":["query","provider","total","images"],"type":"object","additionalProperties":false},"ProviderResults":{"properties":{"total":{"type":"number","format":"double"},"images":{"items":{"$ref":"#/components/schemas/ImageResult"},"type":"array"},"error":{"type":"string"}},"required":["total","images"],"type":"object","additionalProperties":false},"MultiProviderImageSearchResponse":{"properties":{"query":{"type":"string"},"totalResults":{"type":"number","format":"double"},"providers":{"items":{"type":"string"},"type":"array"},"results":{"properties":{"pixabay":{"$ref":"#/components/schemas/ProviderResults"},"giphy":{"$ref":"#/components/schemas/ProviderResults"},"unsplash":{"$ref":"#/components/schemas/ProviderResults"}},"required":["pixabay","giphy","unsplash"],"type":"object"}},"required":["query","totalResults","providers","results"],"type":"object","additionalProperties":false},"ImageProvider":{"type":"string","enum":["unsplash","giphy","pixabay"]},"ImageSize":{"type":"string","enum":["small","medium","large"]},"ImageSearchRequest":{"properties":{"query":{"type":"string"},"provider":{"$ref":"#/components/schemas/ImageProvider"},"limit":{"type":"number","format":"double"},"size":{"$ref":"#/components/schemas/ImageSize"}},"required":["query"],"type":"object","additionalProperties":false},"GoogleDriveSyncConfig":{"properties":{"connectionId":{"type":"string"},"rootFolderId":{"type":"string"},"rootFolderName":{"type":"string"},"paused":{"type":"boolean"},"initialSyncComplete":{"type":"boolean"},"lastSyncAt":{"type":"number","format":"double"},"lastError":{"type":"string"}},"required":["connectionId","paused","initialSyncComplete"],"type":"object","additionalProperties":false},"GoogleDriveFolder":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"parentId":{"type":"string"},"modifiedTime":{"type":"string"}},"required":["id","name"],"type":"object","additionalProperties":false},"GoogleDriveFolderListResponse":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/GoogleDriveFolder"},"type":"array"},"nextPageToken":{"type":"string"}},"required":["folders"],"type":"object","additionalProperties":false},"GoogleDriveRootPreview":{"properties":{"folderId":{"type":"string"},"folderName":{"type":"string"},"markdownFiles":{"type":"number","format":"double"},"assetFiles":{"type":"number","format":"double"},"nestedFolders":{"type":"number","format":"double"},"unknownFiles":{"type":"number","format":"double"},"samplePaths":{"items":{"type":"string"},"type":"array"}},"required":["folderId","folderName","markdownFiles","assetFiles","nestedFolders","unknownFiles","samplePaths"],"type":"object","additionalProperties":false},"GoogleDriveRootRequest":{"properties":{"folderId":{"type":"string"}},"required":["folderId"],"type":"object","additionalProperties":false},"GoogleDrivePauseRequest":{"properties":{"paused":{"type":"boolean"}},"required":["paused"],"type":"object","additionalProperties":false},"GoogleDriveDocumentSnapshot":{"properties":{"remoteId":{"type":"string"},"articleId":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"parentRemoteId":{"type":"string"},"revision":{"type":"string"},"modifiedAt":{"type":"number","format":"double"},"trashed":{"type":"boolean"}},"required":["remoteId","articleId","title","content","revision","modifiedAt"],"type":"object","additionalProperties":false},"GoogleDriveFolderSnapshot":{"properties":{"remoteId":{"type":"string"},"folderId":{"type":"string"},"name":{"type":"string"},"parentRemoteId":{"type":"string"},"revision":{"type":"string"},"modifiedAt":{"type":"number","format":"double"},"trashed":{"type":"boolean"}},"required":["remoteId","folderId","name","revision","modifiedAt"],"type":"object","additionalProperties":false},"GoogleDriveAssetSnapshot":{"properties":{"remoteId":{"type":"string"},"articleId":{"type":"string"},"assetId":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"contentBase64":{"type":"string"},"revision":{"type":"string"},"modifiedAt":{"type":"number","format":"double"},"trashed":{"type":"boolean"}},"required":["remoteId","articleId","assetId","filename","mimeType","contentBase64","revision","modifiedAt"],"type":"object","additionalProperties":false},"GoogleDrivePullResponse":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/GoogleDriveDocumentSnapshot"},"type":"array"},"folders":{"items":{"$ref":"#/components/schemas/GoogleDriveFolderSnapshot"},"type":"array"},"assets":{"items":{"$ref":"#/components/schemas/GoogleDriveAssetSnapshot"},"type":"array"},"deletedRemoteIds":{"items":{"type":"string"},"type":"array"},"deletedRemoteRevisions":{"$ref":"#/components/schemas/Record_string.string_"},"cursor":{"type":"string"},"hasMore":{"type":"boolean"}},"required":["documents","folders","assets","deletedRemoteIds","hasMore"],"type":"object","additionalProperties":false},"GoogleDrivePullRequest":{"properties":{"cursor":{"type":"string"},"fullScan":{"type":"boolean","description":"Ignore the workspace checkpoint and materialize the complete selected folder for a new device."}},"type":"object","additionalProperties":false},"GoogleDriveCursorAckRequest":{"properties":{"cursor":{"type":"string"}},"required":["cursor"],"type":"object","additionalProperties":false},"GoogleDrivePushReceipt":{"properties":{"mutationId":{"type":"string"},"remoteId":{"type":"string"},"revision":{"type":"string"},"appliedAt":{"type":"number","format":"double"}},"required":["mutationId","remoteId","revision","appliedAt"],"type":"object","additionalProperties":false},"GoogleDriveMutation":{"anyOf":[{"properties":{"restoreDeleted":{"type":"boolean"},"baseRevision":{"type":"string"},"remoteId":{"type":"string"},"folderId":{"type":"string","nullable":true},"content":{"type":"string"},"title":{"type":"string"},"articleId":{"type":"string"},"kind":{"type":"string","enum":["document-upsert"],"nullable":false},"rootFolderId":{"type":"string"},"mutationId":{"type":"string"}},"required":["content","title","articleId","kind","rootFolderId","mutationId"],"type":"object"},{"properties":{"baseRevision":{"type":"string"},"remoteId":{"type":"string"},"articleId":{"type":"string"},"kind":{"type":"string","enum":["document-delete"],"nullable":false},"rootFolderId":{"type":"string"},"mutationId":{"type":"string"}},"required":["articleId","kind","rootFolderId","mutationId"],"type":"object"},{"properties":{"baseRevision":{"type":"string"},"remoteId":{"type":"string"},"parentFolderId":{"type":"string","nullable":true},"name":{"type":"string"},"folderId":{"type":"string"},"kind":{"type":"string","enum":["folder-upsert"],"nullable":false},"rootFolderId":{"type":"string"},"mutationId":{"type":"string"}},"required":["name","folderId","kind","rootFolderId","mutationId"],"type":"object"},{"properties":{"baseRevision":{"type":"string"},"remoteId":{"type":"string"},"folderId":{"type":"string"},"kind":{"type":"string","enum":["folder-delete"],"nullable":false},"rootFolderId":{"type":"string"},"mutationId":{"type":"string"}},"required":["folderId","kind","rootFolderId","mutationId"],"type":"object"},{"properties":{"baseRevision":{"type":"string"},"remoteId":{"type":"string"},"contentBase64":{"type":"string"},"mimeType":{"type":"string"},"filename":{"type":"string"},"assetId":{"type":"string"},"articleId":{"type":"string"},"kind":{"type":"string","enum":["asset-upsert"],"nullable":false},"rootFolderId":{"type":"string"},"mutationId":{"type":"string"}},"required":["contentBase64","mimeType","filename","assetId","articleId","kind","rootFolderId","mutationId"],"type":"object"},{"properties":{"baseRevision":{"type":"string"},"remoteId":{"type":"string"},"assetId":{"type":"string"},"articleId":{"type":"string"},"kind":{"type":"string","enum":["asset-delete"],"nullable":false},"rootFolderId":{"type":"string"},"mutationId":{"type":"string"}},"required":["assetId","articleId","kind","rootFolderId","mutationId"],"type":"object"}]},"GithubTokenResponse":{"properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"scope":{"type":"string"},"error":{"type":"string"},"error_description":{"type":"string"},"error_uri":{"type":"string"}},"type":"object","additionalProperties":false},"GithubUserInfoResponse":{"properties":{"sub":{"type":"number","format":"double"},"login":{"type":"string"},"id":{"type":"number","format":"double"},"node_id":{"type":"string"},"avatar_url":{"type":"string"},"gravatar_id":{"type":"string"},"url":{"type":"string"},"html_url":{"type":"string"},"followers_url":{"type":"string"},"following_url":{"type":"string"},"gists_url":{"type":"string"},"starred_url":{"type":"string"},"subscriptions_url":{"type":"string"},"organizations_url":{"type":"string"},"repos_url":{"type":"string"},"events_url":{"type":"string"},"received_events_url":{"type":"string"},"type":{"type":"string"},"site_admin":{"type":"boolean"},"name":{"type":"string"},"company":{"type":"string"},"blog":{"type":"string"},"location":{"type":"string"},"email":{"type":"string"},"hireable":{"type":"boolean"},"bio":{"type":"string"},"twitter_username":{"type":"string"},"public_repos":{"type":"number","format":"double"},"public_gists":{"type":"number","format":"double"},"followers":{"type":"number","format":"double"},"following":{"type":"number","format":"double"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["sub","login","id"],"type":"object","additionalProperties":false},"UpdateFolderPermissionResponse":{"properties":{"message":{"type":"string"},"username":{"type":"string"},"permission":{"type":"string","enum":["read","write"]}},"required":["message","username","permission"],"type":"object","additionalProperties":false},"DeleteFolderPermissionResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"CreateFolderInvitationResponse":{"properties":{"message":{"type":"string"},"email":{"type":"string"},"permission":{"type":"string","enum":["read","write"]}},"required":["message","email","permission"],"type":"object","additionalProperties":false},"CreateFolderInvitationRequest":{"properties":{"email":{"type":"string"},"permission":{"type":"string","enum":["read","write"]}},"required":["email","permission"],"type":"object","additionalProperties":false},"DeleteFolderInvitationResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"CreateFolderResponse":{"properties":{"folderId":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"parentFolderId":{"type":"string"},"message":{"type":"string"}},"required":["folderId","workspaceId","name","message"],"type":"object","additionalProperties":false},"CreateFolderRequest":{"properties":{"folderId":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"parentId":{"type":"string","nullable":true},"parentFolderId":{"type":"string","nullable":true}},"required":["name"],"type":"object","additionalProperties":false},"FolderType":{"type":"string","enum":["normal","content_project"]},"SeoEnforcement":{"type":"string","enum":["default","strict"]},"ApprovalPolicy":{"description":"Configures which CoWrite steps require explicit user approval before the\nnext step is triggered.  Defined at the project level; can be overridden\nat topic level in the future.\n\nAll flags default to `false` (no approval gate) when omitted.","properties":{"requireOutlineApproval":{"type":"boolean","description":"If true, outline must be approved before draft generation can start."},"requireDraftApproval":{"type":"boolean","description":"If true, draft must be approved before export/share actions are available."}},"type":"object","additionalProperties":false},"AeoProfile":{"type":"string","enum":["off","balanced","aggressive"],"description":"Project-level answer-engine-optimization profile."},"ContentProjectMetadata":{"properties":{"productName":{"type":"string","description":"Canonical product identity for topic research and briefs.\n\nThis must be a stable product name (e.g. \"Auth0 Android SDK\"), not a\nmarketing goal statement. Topic research uses this field as the primary\nidentity anchor to prevent \"generic SDK\" drift."},"productDescription":{"type":"string"},"targetAudience":{"type":"string"},"primaryUseCase":{"type":"string"},"siteUrl":{"type":"string","description":"Client's website URL (e.g. \"https://neo4j.com\"). Used by the citation_enrichment\nagent to run site:-scoped searches for relevant internal backlinks. Must be HTTPS."},"competitorUrls":{"items":{"type":"string"},"type":"array"},"toneGuide":{"type":"string"},"existingContentUrls":{"items":{"type":"string"},"type":"array"},"styleProfileId":{"type":"string"},"seoIntent":{"$ref":"#/components/schemas/SeoIntent"},"seoEnforcement":{"$ref":"#/components/schemas/SeoEnforcement","description":"Project-level SEO enforcement override.\n\ndefault: tier decides (fast = strict, deep = advisory)\nstrict: always apply strict SEO enforcement, including deep-tier runs"},"platformKeywords":{"items":{"type":"string"},"type":"array","description":"Optional platform or ecosystem keywords to enforce in topic research\n(e.g. [\"android\", \"kotlin\"])."},"desiredKeywords":{"items":{"type":"string"},"type":"array","description":"Keywords the selected article brief set should cover when good candidates exist.\n\nThese are portfolio coverage goals, not title stuffing requirements."},"keywordMarket":{"properties":{"includeGlobalVolume":{"type":"boolean"},"locale":{"type":"string","enum":["en-US","en-GB","en-CA","en-AU"]}},"required":["includeGlobalVolume","locale"],"type":"object","description":"Search market used for keyword-volume enrichment."},"generationQualityTier":{"$ref":"#/components/schemas/GenerationQualityTier","description":"Project-level quality/cost tier for CoWrite pipeline generation."},"visualStyle":{"$ref":"#/components/schemas/VisualStyle","description":"Project-level visual style used by Cowrite illustration workflows."},"approvalPolicy":{"$ref":"#/components/schemas/ApprovalPolicy","description":"Optional approval policy for CoWrite steps."},"defaultWordCountRange":{"$ref":"#/components/schemas/WordCountRange","description":"Project-level default article length used by briefs unless a topic overrides it."},"aeoProfile":{"$ref":"#/components/schemas/AeoProfile","description":"Answer-engine-optimization profile. Missing/legacy values resolve to 'off',\nwhich is the exact pre-AEO behaviour."}},"required":["productName","productDescription","targetAudience","primaryUseCase"],"type":"object","additionalProperties":false},"Folder":{"properties":{"workspaceId":{"type":"string"},"folderId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"parentFolderId":{"type":"string"},"folderType":{"$ref":"#/components/schemas/FolderType"},"contentProject":{"$ref":"#/components/schemas/ContentProjectMetadata"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"deletedAt":{"type":"number","format":"double"},"deletedBy":{"type":"string"}},"required":["workspaceId","folderId","name","createdAt","updatedAt"],"type":"object","additionalProperties":false},"FolderMessageResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"UpdateFolderRequest":{"properties":{"name":{"type":"string"},"parentId":{"type":"string","nullable":true},"parentFolderId":{"type":"string","nullable":true}},"type":"object","additionalProperties":false},"ExternalPublicationDestinationType":{"type":"string","enum":["github_repo","wordpress","ghost","forem","hashnode","x_article","webhook"]},"ExternalAuthType":{"type":"string","enum":["oauth2","api_key","personal_access_token","basic","app_password","github_app","webhook_secret","none"]},"PublicationDestination":{"properties":{"destinationId":{"type":"string"},"workspaceId":{"type":"string"},"destinationType":{"$ref":"#/components/schemas/ExternalPublicationDestinationType"},"displayName":{"type":"string"},"externalConnectionId":{"type":"string"},"resourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/Record_string.unknown_"},"status":{"type":"string","enum":["active","needs_attention","disabled"]},"lastTestAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."},"lastTestStatus":{"type":"string","enum":["success","failed"]},"lastTestMessage":{"type":"string"},"provider":{"type":"string","enum":["github","wordpress","ghost","forem","hashnode","x","custom"]},"authType":{"$ref":"#/components/schemas/ExternalAuthType"},"createdAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."},"updatedAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."},"createdBy":{"type":"string"}},"required":["destinationId","workspaceId","destinationType","displayName","externalConnectionId","status","createdAt","updatedAt","createdBy"],"type":"object","additionalProperties":false},"CreatePublicationDestinationRequest":{"properties":{"destinationType":{"$ref":"#/components/schemas/ExternalPublicationDestinationType"},"displayName":{"type":"string"},"externalConnectionId":{"type":"string"},"resourceId":{"type":"string"},"authType":{"$ref":"#/components/schemas/ExternalAuthType"},"config":{"$ref":"#/components/schemas/Record_string.unknown_"},"credentials":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["destinationType","displayName"],"type":"object","additionalProperties":false},"UpdatePublicationDestinationRequest":{"properties":{"destinationType":{"$ref":"#/components/schemas/ExternalPublicationDestinationType"},"displayName":{"type":"string"},"externalConnectionId":{"type":"string"},"resourceId":{"type":"string"},"authType":{"$ref":"#/components/schemas/ExternalAuthType"},"config":{"$ref":"#/components/schemas/Record_string.unknown_"},"credentials":{"$ref":"#/components/schemas/Record_string.unknown_"}},"type":"object","additionalProperties":false},"GitHubPublicationInstallInfo":{"properties":{"configured":{"type":"boolean"},"appSlug":{"type":"string"},"installUrl":{"type":"string"}},"required":["configured"],"type":"object","additionalProperties":false},"ExternalPublicationErrorCode":{"type":"string","enum":["AUTH_FAILED","PERMISSION_DENIED","VALIDATION_FAILED","RATE_LIMITED","TEMPORARY_UNAVAILABLE","EXTERNAL_RESOURCE_NOT_FOUND","UNKNOWN_DESTINATION_ERROR"]},"TestPublicationDestinationResponse":{"properties":{"success":{"type":"boolean"},"destinationType":{"$ref":"#/components/schemas/ExternalPublicationDestinationType"},"status":{"type":"string","enum":["active","needs_attention","disabled"]},"message":{"type":"string"},"errorCode":{"$ref":"#/components/schemas/ExternalPublicationErrorCode"},"metadata":{"$ref":"#/components/schemas/Record_string.unknown_"},"testedAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."}},"required":["success","destinationType","status","testedAt"],"type":"object","additionalProperties":false},"GitHubRepositorySummary":{"properties":{"fullName":{"type":"string"},"private":{"type":"boolean"},"defaultBranch":{"type":"string"}},"required":["fullName","private"],"type":"object","additionalProperties":false},"GitHubPublicationPage_GitHubRepositorySummary_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/GitHubRepositorySummary"},"type":"array"},"page":{"type":"number","format":"double"},"perPage":{"type":"number","format":"double"},"hasMore":{"type":"boolean"},"nextPage":{"type":"number","format":"double"},"totalCount":{"type":"number","format":"double"}},"required":["items","page","perPage","hasMore"],"type":"object","additionalProperties":false},"GitHubBranchSummary":{"properties":{"name":{"type":"string"},"sha":{"type":"string"}},"required":["name"],"type":"object","additionalProperties":false},"GitHubPublicationPage_GitHubBranchSummary_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/GitHubBranchSummary"},"type":"array"},"page":{"type":"number","format":"double"},"perPage":{"type":"number","format":"double"},"hasMore":{"type":"boolean"},"nextPage":{"type":"number","format":"double"},"totalCount":{"type":"number","format":"double"}},"required":["items","page","perPage","hasMore"],"type":"object","additionalProperties":false},"GitHubPublicationProfile":{"type":"string","enum":["generic_markdown","hugo","astro","nextra","nextjs_mdx"]},"GitHubRepositoryDetectionResult":{"description":"What the repository itself says about how it publishes, so the connect flow\ncan preselect a framework instead of asking the writer to recognise one.","properties":{"profile":{"$ref":"#/components/schemas/GitHubPublicationProfile"},"directory":{"type":"string","description":"Suggested content folder, omitted when the repository has no Markdown at\nall. An empty string means the posts live at the repository root."},"extension":{"type":"string","enum":["md","mdx"],"description":"What that folder is written in, for the frameworks that accept both, so a\nrepository of .md posts is not handed the profile's .mdx default."},"siteRoot":{"type":"string","description":"The folder the site itself is rooted at, set only when the match was found\nbelow the repository root (for example \"apps/site\"). Everything else the\nresult names is repository-relative, so this is what a path the profile\nsupplies has to be moved under to land inside the site."}},"required":["profile"],"type":"object","additionalProperties":false},"ExternalPublicationStatus":{"type":"string","enum":["draft","scheduled","live","handoff","failed","needs_attention","unknown"]},"Partial_GitHubPublicationFrontmatterFields_":{"properties":{"title":{"type":"string"},"description":{"type":"string"},"tags":{"type":"string"},"publishedAt":{"type":"string"},"updatedAt":{"type":"string"},"draft":{"type":"string"}},"type":"object","description":"Make all properties in T optional"},"GitHubPublicationTagFormat":{"type":"string","enum":["yaml_block","yaml_inline"]},"GitHubRepositoryPublicationConfig":{"properties":{"githubProfile":{"$ref":"#/components/schemas/GitHubPublicationProfile"},"repoFullName":{"type":"string"},"baseBranch":{"type":"string"},"mode":{"type":"string","enum":["pull_request","direct_commit"]},"directory":{"type":"string"},"slug":{"type":"string"},"extension":{"type":"string","enum":["md","mdx"]},"filenamePattern":{"type":"string"},"frontmatterTemplate":{"type":"string"},"frontmatterFields":{"$ref":"#/components/schemas/Partial_GitHubPublicationFrontmatterFields_"},"tagFormat":{"$ref":"#/components/schemas/GitHubPublicationTagFormat"},"contentDraft":{"type":"boolean"},"assetDirectory":{"type":"string"},"assetPathTemplate":{"type":"string"},"assetPublicPathTemplate":{"type":"string"},"branchName":{"type":"string"},"pullRequestTitle":{"type":"string"},"pullRequestBody":{"type":"string"}},"required":["repoFullName","baseBranch","mode","directory","slug","extension"],"type":"object","additionalProperties":false},"WordPressPublicationConfig":{"properties":{"siteUrl":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","publish","future"]},"excerpt":{"type":"string"},"categoryIds":{"items":{"type":"number","format":"double"},"type":"array"},"tagIds":{"items":{"type":"number","format":"double"},"type":"array"},"canonicalUrl":{"type":"string"}},"required":["siteUrl"],"type":"object","additionalProperties":false},"GhostPublicationConfig":{"properties":{"apiUrl":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","published","scheduled"]},"metaTitle":{"type":"string"},"metaDescription":{"type":"string"},"canonicalUrl":{"type":"string"},"tagNames":{"items":{"type":"string"},"type":"array"},"featuredImageUrl":{"type":"string"}},"required":["apiUrl"],"type":"object","additionalProperties":false},"ForemPublicationConfig":{"properties":{"apiUrl":{"type":"string"},"slug":{"type":"string"},"published":{"type":"boolean"},"tags":{"items":{"type":"string"},"type":"array"},"canonicalUrl":{"type":"string"},"series":{"type":"string"},"mainImage":{"type":"string"},"organizationId":{"type":"number","format":"double"}},"type":"object","additionalProperties":false},"HashnodePublicationConfig":{"properties":{"apiUrl":{"type":"string"},"publicationId":{"type":"string"},"slug":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"canonicalUrl":{"type":"string"},"coverImageUrl":{"type":"string"},"subtitle":{"type":"string"}},"required":["publicationId"],"type":"object","additionalProperties":false},"XArticlePublicationConfig":{"properties":{"apiUrl":{"type":"string"}},"type":"object","additionalProperties":false},"WebhookPublicationConfig":{"properties":{"endpointUrl":{"type":"string"},"eventType":{"type":"string"},"payloadVersion":{"type":"string"},"customHeaders":{"$ref":"#/components/schemas/Record_string.string_"},"externalStatusPath":{"type":"string"},"externalUrlPath":{"type":"string"},"externalIdPath":{"type":"string"}},"required":["endpointUrl"],"type":"object","additionalProperties":false},"ExternalPublicationConfig":{"anyOf":[{"$ref":"#/components/schemas/GitHubRepositoryPublicationConfig"},{"$ref":"#/components/schemas/WordPressPublicationConfig"},{"$ref":"#/components/schemas/GhostPublicationConfig"},{"$ref":"#/components/schemas/ForemPublicationConfig"},{"$ref":"#/components/schemas/HashnodePublicationConfig"},{"$ref":"#/components/schemas/XArticlePublicationConfig"},{"$ref":"#/components/schemas/WebhookPublicationConfig"},{"$ref":"#/components/schemas/Record_string.unknown_"}]},"ExternalPublicationOperation":{"type":"string","enum":["create","update","publish"]},"PublicationCapabilityId":{"type":"string","enum":["content.markdown","content.html","metadata.title","metadata.description","metadata.canonical_url","metadata.tags","metadata.published_at","metadata.updated_at","metadata.structured_data","asset.image","embed.link","embed.interactive","schedule.native","schedule.delayed","lifecycle.create","lifecycle.update","lifecycle.refresh","lifecycle.archive","lifecycle.unpublish","lifecycle.delete"]},"CapabilitySupport":{"type":"string","enum":["native","transformed","externalized","linked","unsupported"]},"PublicationReceiptOutcome":{"anyOf":[{"$ref":"#/components/schemas/CapabilitySupport"},{"type":"string","enum":["failed"]}]},"PublicationReceiptItemV1":{"properties":{"capability":{"$ref":"#/components/schemas/PublicationCapabilityId"},"source":{"type":"string"},"outcome":{"$ref":"#/components/schemas/PublicationReceiptOutcome"},"destinationField":{"type":"string"},"outputUrl":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["capability","source","outcome"],"type":"object","additionalProperties":false},"PublicationDegradationReceiptV1":{"properties":{"version":{"type":"number","enum":[1],"nullable":false},"destinationType":{"$ref":"#/components/schemas/ExternalPublicationDestinationType"},"declarationVersion":{"type":"number","enum":[1],"nullable":false},"operation":{"$ref":"#/components/schemas/ExternalPublicationOperation"},"complete":{"type":"boolean"},"items":{"items":{"$ref":"#/components/schemas/PublicationReceiptItemV1"},"type":"array"}},"required":["version","destinationType","declarationVersion","operation","complete","items"],"type":"object","additionalProperties":false},"ExternalPublication":{"properties":{"publicationId":{"type":"string"},"workspaceId":{"type":"string"},"articleId":{"type":"string"},"destinationId":{"type":"string"},"externalConnectionId":{"type":"string"},"destinationType":{"$ref":"#/components/schemas/ExternalPublicationDestinationType"},"status":{"$ref":"#/components/schemas/ExternalPublicationStatus"},"isPrimary":{"type":"boolean"},"externalId":{"type":"string"},"externalUrl":{"type":"string"},"externalSlug":{"type":"string"},"externalStatus":{"type":"string"},"publishAt":{"type":"string"},"config":{"$ref":"#/components/schemas/ExternalPublicationConfig"},"lastJobId":{"type":"string"},"lastSentContentHash":{"type":"string"},"lastSentAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."},"lastCapabilityReceipt":{"$ref":"#/components/schemas/PublicationDegradationReceiptV1","description":"Latest completed asset/capability accounting for this publication."},"createdAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."},"updatedAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."},"createdBy":{"type":"string"}},"required":["publicationId","workspaceId","articleId","destinationId","externalConnectionId","destinationType","status","isPrimary","config","createdAt","updatedAt","createdBy"],"type":"object","additionalProperties":false},"PublishArtifactAsset":{"properties":{"url":{"type":"string"},"alt":{"type":"string"},"localPath":{"type":"string"}},"required":["url"],"type":"object","additionalProperties":false},"DraftJsRawInlineStyleRange":{"properties":{"offset":{"type":"number","format":"double"},"length":{"type":"number","format":"double"},"style":{"type":"string"}},"required":["offset","length","style"],"type":"object","additionalProperties":false},"DraftJsRawEntityRange":{"properties":{"offset":{"type":"number","format":"double"},"length":{"type":"number","format":"double"},"key":{"type":"number","format":"double"}},"required":["offset","length","key"],"type":"object","additionalProperties":false},"DraftJsRawBlock":{"properties":{"key":{"type":"string"},"text":{"type":"string"},"type":{"type":"string"},"depth":{"type":"number","format":"double"},"inlineStyleRanges":{"items":{"$ref":"#/components/schemas/DraftJsRawInlineStyleRange"},"type":"array"},"entityRanges":{"items":{"$ref":"#/components/schemas/DraftJsRawEntityRange"},"type":"array"},"data":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["key","text","type","depth","inlineStyleRanges","entityRanges","data"],"type":"object","additionalProperties":false},"DraftJsRawEntity":{"properties":{"type":{"type":"string"},"mutability":{"type":"string","enum":["MUTABLE","IMMUTABLE","SEGMENTED"]},"data":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["type","mutability","data"],"type":"object","additionalProperties":false},"Record_string.DraftJsRawEntity_":{"properties":{},"additionalProperties":{"$ref":"#/components/schemas/DraftJsRawEntity"},"type":"object","description":"Construct a type with a set of properties K of type T"},"DraftJsRawContentState":{"properties":{"blocks":{"items":{"$ref":"#/components/schemas/DraftJsRawBlock"},"type":"array"},"entityMap":{"$ref":"#/components/schemas/Record_string.DraftJsRawEntity_"}},"required":["blocks","entityMap"],"type":"object","additionalProperties":false},"PublishArtifactBodyFormats":{"properties":{"draftjsRaw":{"$ref":"#/components/schemas/DraftJsRawContentState"}},"type":"object","additionalProperties":false},"PublishBodyFormat":{"type":"string","enum":["draftjs_raw"],"nullable":false},"PublishBodyFormatWarningSource":{"properties":{"nodeType":{"type":"string"},"line":{"type":"number","format":"double"},"column":{"type":"number","format":"double"}},"type":"object","additionalProperties":false},"PublishBodyFormatWarning":{"properties":{"format":{"$ref":"#/components/schemas/PublishBodyFormat"},"code":{"type":"string"},"message":{"type":"string"},"source":{"$ref":"#/components/schemas/PublishBodyFormatWarningSource"}},"required":["format","code","message"],"type":"object","additionalProperties":false},"PublishArtifact":{"properties":{"title":{"type":"string"},"slug":{"type":"string"},"markdown":{"type":"string"},"html":{"type":"string"},"excerpt":{"type":"string"},"metaTitle":{"type":"string"},"metaDescription":{"type":"string"},"canonicalUrl":{"type":"string"},"coverImage":{"properties":{"alt":{"type":"string"},"url":{"type":"string"}},"required":["url"],"type":"object"},"tags":{"items":{"type":"string"},"type":"array"},"authors":{"items":{"type":"string"},"type":"array"},"requestedStatus":{"type":"string","enum":["draft","live","scheduled"]},"publishAt":{"type":"string"},"publishedAt":{"type":"string","description":"Stable lifecycle timestamp owned by the external publication."},"updatedAt":{"type":"string","description":"Timestamp for the publication operation that produced this artifact."},"frontmatter":{"$ref":"#/components/schemas/Record_string.unknown_"},"assets":{"items":{"$ref":"#/components/schemas/PublishArtifactAsset"},"type":"array"},"contentHash":{"type":"string"},"bodyFormats":{"$ref":"#/components/schemas/PublishArtifactBodyFormats"},"bodyFormatWarnings":{"items":{"$ref":"#/components/schemas/PublishBodyFormatWarning"},"type":"array"}},"required":["title","slug","markdown","html","tags","authors","requestedStatus","frontmatter","assets","contentHash"],"type":"object","additionalProperties":false},"PreviewExternalPublicationResponse":{"properties":{"artifact":{"$ref":"#/components/schemas/PublishArtifact"},"renderedContent":{"type":"string"},"destinationPath":{"type":"string"},"preparedFiles":{"items":{"properties":{"encoding":{"type":"string","enum":["utf-8","base64"]},"path":{"type":"string"}},"required":["encoding","path"],"type":"object"},"type":"array"},"capabilityReceipt":{"$ref":"#/components/schemas/PublicationDegradationReceiptV1"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["artifact","warnings"],"type":"object","additionalProperties":false},"PreviewExternalPublicationRequest":{"properties":{"destinationId":{"type":"string"},"requestedStatus":{"type":"string","enum":["draft","live","scheduled"]},"publishAt":{"type":"string"},"config":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["destinationId","requestedStatus"],"type":"object","additionalProperties":false},"ExternalPublicationJobStatus":{"type":"string","enum":["queued","running","succeeded","failed"]},"ExternalPublicationJob":{"properties":{"jobId":{"type":"string"},"workspaceId":{"type":"string"},"articleId":{"type":"string"},"publicationId":{"type":"string"},"destinationId":{"type":"string"},"externalConnectionId":{"type":"string"},"destinationType":{"$ref":"#/components/schemas/ExternalPublicationDestinationType"},"operation":{"$ref":"#/components/schemas/ExternalPublicationOperation"},"status":{"$ref":"#/components/schemas/ExternalPublicationJobStatus"},"requestedStatus":{"type":"string","enum":["draft","live","scheduled"]},"publishAt":{"type":"string"},"artifactHash":{"type":"string"},"externalUrl":{"type":"string"},"externalId":{"type":"string"},"errorMessage":{"type":"string"},"errorCode":{"$ref":"#/components/schemas/ExternalPublicationErrorCode"},"retryable":{"type":"boolean"},"capabilityReceipt":{"$ref":"#/components/schemas/PublicationDegradationReceiptV1","description":"Immutable accounting for the fields/assets attempted by this job."},"createdAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."},"updatedAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."},"createdBy":{"type":"string"},"startedAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."},"finishedAt":{"type":"number","format":"double","description":"Epoch milliseconds at the public API boundary."}},"required":["jobId","workspaceId","articleId","publicationId","destinationId","externalConnectionId","destinationType","operation","status","requestedStatus","createdAt","updatedAt","createdBy"],"type":"object","additionalProperties":false},"EnqueueExternalPublicationResponse":{"properties":{"publication":{"$ref":"#/components/schemas/ExternalPublication"},"job":{"$ref":"#/components/schemas/ExternalPublicationJob"}},"required":["publication","job"],"type":"object","additionalProperties":false},"CreateExternalPublicationRequest":{"properties":{"destinationId":{"type":"string"},"requestedStatus":{"type":"string","enum":["draft","live","scheduled"]},"publishAt":{"type":"string"},"makePrimary":{"type":"boolean"},"config":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["destinationId","requestedStatus"],"type":"object","additionalProperties":false},"RefreshExternalPublicationResponse":{"properties":{"publication":{"$ref":"#/components/schemas/ExternalPublication"},"changed":{"type":"boolean"}},"required":["publication","changed"],"type":"object","additionalProperties":false},"ExternalProvider":{"type":"string","enum":["google","google_drive","bing","github","wordpress","webflow","ghost","forem","hashnode","x","hubspot","custom"]},"ExternalConnectionCapability":{"type":"string","enum":["performance.read","documents.sync","analytics.read","ai_visibility.read","publish.article","repo.read","repo.write","gist.write","cms.read","cms.write"]},"ExternalConnectionStatus":{"type":"string","enum":["active","reauth_required","error","disabled"]},"ExternalResourceType":{"type":"string","enum":["gsc_domain_property","gsc_url_prefix_property","ga4_property","bing_site","github_installation","github_user","github_org","github_repo","github_gist","drive_folder","wordpress_site","ghost_site","forem_site","hashnode_publication","x_account","webhook_endpoint","cms_site","cms_collection","unknown"]},"ExternalConnectionResource":{"properties":{"resourceId":{"type":"string"},"type":{"$ref":"#/components/schemas/ExternalResourceType"},"displayName":{"type":"string"},"url":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Record_string.unknown_"},"discoveredAt":{"type":"number","format":"double"}},"required":["resourceId","type","displayName","discoveredAt"],"type":"object","additionalProperties":false},"ExternalConnection":{"properties":{"connectionId":{"type":"string"},"workspaceId":{"type":"string"},"provider":{"$ref":"#/components/schemas/ExternalProvider"},"authType":{"$ref":"#/components/schemas/ExternalAuthType"},"capabilities":{"items":{"$ref":"#/components/schemas/ExternalConnectionCapability"},"type":"array"},"displayName":{"type":"string"},"externalAccountId":{"type":"string"},"externalAccountEmail":{"type":"string"},"externalAccountUsername":{"type":"string"},"status":{"$ref":"#/components/schemas/ExternalConnectionStatus"},"scopes":{"items":{"type":"string"},"type":"array"},"resources":{"items":{"$ref":"#/components/schemas/ExternalConnectionResource"},"type":"array"},"lastResourceRefreshAt":{"type":"number","format":"double"},"lastResourceRefreshStatus":{"type":"string","enum":["success","failed"]},"lastError":{"type":"string"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"createdBy":{"type":"string"}},"required":["connectionId","workspaceId","provider","authType","capabilities","displayName","status","scopes","createdAt","updatedAt","createdBy"],"type":"object","additionalProperties":false},"CreateExternalConnectionRequest":{"properties":{"provider":{"$ref":"#/components/schemas/ExternalProvider"},"authType":{"$ref":"#/components/schemas/ExternalAuthType"},"capabilities":{"items":{"$ref":"#/components/schemas/ExternalConnectionCapability"},"type":"array"},"displayName":{"type":"string"},"credentials":{"$ref":"#/components/schemas/Record_string.unknown_"},"resources":{"items":{"$ref":"#/components/schemas/ExternalConnectionResource"},"type":"array"},"externalAccountId":{"type":"string"},"externalAccountEmail":{"type":"string"},"externalAccountUsername":{"type":"string"},"scopes":{"items":{"type":"string"},"type":"array"}},"required":["provider","authType","capabilities","displayName"],"type":"object","additionalProperties":false},"ExternalConnectionOAuthStartResponse":{"properties":{"authorizationUrl":{"type":"string"},"state":{"type":"string"}},"required":["authorizationUrl","state"],"type":"object","additionalProperties":false},"ExternalConnectionOAuthStartRequest":{"properties":{"capability":{"$ref":"#/components/schemas/ExternalConnectionCapability"},"returnTo":{"type":"string"}},"required":["capability"],"type":"object","additionalProperties":false},"GoogleDriveExternalConnectionOAuthStartRequest":{"properties":{"capability":{"$ref":"#/components/schemas/ExternalConnectionCapability"},"returnTo":{"type":"string"},"reconnectConnectionId":{"type":"string","description":"Reauthorize this exact saved Drive connection without changing its account or selected root."}},"required":["capability"],"type":"object","additionalProperties":false},"XExternalConnectionOAuthStartRequest":{"properties":{"capability":{"$ref":"#/components/schemas/ExternalConnectionCapability"},"returnTo":{"type":"string"},"reconnectConnectionId":{"type":"string","description":"Reauthorize this saved connection instead of relying on provider identity matching."}},"required":["capability"],"type":"object","additionalProperties":false},"GitHubAppInstallStartResponse":{"properties":{"installUrl":{"type":"string"}},"required":["installUrl"],"type":"object","additionalProperties":false},"GitHubAppInstallStartRequest":{"properties":{"returnTo":{"type":"string"},"reconnectConnectionId":{"type":"string"}},"type":"object","additionalProperties":false},"ExternalConnectionOAuthCallbackResponse":{"properties":{"connection":{"$ref":"#/components/schemas/ExternalConnection"},"returnTo":{"type":"string"}},"required":["connection"],"type":"object","additionalProperties":false},"UpdateExternalConnectionRequest":{"properties":{"displayName":{"type":"string"},"authType":{"$ref":"#/components/schemas/ExternalAuthType"},"capabilities":{"items":{"$ref":"#/components/schemas/ExternalConnectionCapability"},"type":"array"},"credentials":{"$ref":"#/components/schemas/Record_string.unknown_"},"resources":{"items":{"$ref":"#/components/schemas/ExternalConnectionResource"},"type":"array"},"externalAccountId":{"type":"string"},"externalAccountEmail":{"type":"string"},"externalAccountUsername":{"type":"string"},"scopes":{"items":{"type":"string"},"type":"array"}},"type":"object","additionalProperties":false},"GitHubGistResponse":{"properties":{"id":{"type":"string"},"html_url":{"type":"string"},"owner":{"properties":{"login":{"type":"string"}},"type":"object"},"files":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["id","html_url"],"type":"object","additionalProperties":false},"CreateGitHubGistRequest":{"properties":{"content":{"type":"string"},"filename":{"type":"string"},"description":{"type":"string"},"public":{"type":"boolean"},"connectionId":{"type":"string"}},"required":["content","filename"],"type":"object","additionalProperties":false},"EntitlementPlan":{"type":"string","enum":["FREE","STANDARD","PREMIUM"]},"EntitlementAccessState":{"type":"string","enum":["active","subscription_required"]},"EntitlementFairUseStatus":{"properties":{"resetAt":{"type":"string"},"reason":{"type":"string"},"state":{"type":"string","enum":["ok","approaching","exceeded"]}},"required":["state"],"type":"object"},"EntitlementFundingMode":{"type":"string","enum":["managed","byok"]},"Record_string._costCredits_63_-number--fundingModes-EntitlementFundingMode-Array--defaultModelId_63_-string--upgradeTarget_63_-STANDARD-or-PREMIUM__":{"properties":{},"additionalProperties":{"properties":{"upgradeTarget":{"type":"string","enum":["STANDARD","PREMIUM"]},"defaultModelId":{"type":"string"},"fundingModes":{"items":{"$ref":"#/components/schemas/EntitlementFundingMode"},"type":"array"},"costCredits":{"type":"number","format":"double"}},"required":["fundingModes"],"type":"object"},"type":"object","description":"Construct a type with a set of properties K of type T"},"EntitlementOperationType":{"type":"string","enum":["text","image"]},"EntitlementModelConfig":{"properties":{"id":{"type":"string"},"provider":{"type":"string"},"operationTypes":{"items":{"$ref":"#/components/schemas/EntitlementOperationType"},"type":"array"},"managedEligiblePlans":{"items":{"$ref":"#/components/schemas/EntitlementPlan"},"type":"array"},"byokEligiblePlans":{"items":{"$ref":"#/components/schemas/EntitlementPlan"},"type":"array"},"requiredProviderKey":{"type":"string"},"creditCost":{"type":"number","format":"double"},"defaultForFreeManaged":{"type":"boolean"}},"required":["id","provider","operationTypes","managedEligiblePlans","byokEligiblePlans"],"type":"object","additionalProperties":false},"EntitlementMeterState":{"type":"string","enum":["available","approaching","exceeded","unavailable","subscription_required"]},"QuotaLimitLevel":{"type":"string","enum":["user","article","workspace","team"]},"Record_string._type-usage-or-credit--state-EntitlementMeterState--used_63_-number--limit_63_-number--remaining_63_-number--period_63_-daily-or-monthly-or-yearly-or-user--resetAt_63_-string--limitLevel_63_-QuotaLimitLevel--upgradeTarget_63_-STANDARD-or-PREMIUM__":{"properties":{},"additionalProperties":{"properties":{"upgradeTarget":{"type":"string","enum":["STANDARD","PREMIUM"]},"limitLevel":{"$ref":"#/components/schemas/QuotaLimitLevel"},"resetAt":{"type":"string"},"period":{"type":"string","enum":["daily","monthly","yearly","user"]},"remaining":{"type":"number","format":"double"},"limit":{"type":"number","format":"double"},"used":{"type":"number","format":"double"},"state":{"$ref":"#/components/schemas/EntitlementMeterState"},"type":{"type":"string","enum":["usage","credit"]}},"required":["state","type"],"type":"object"},"type":"object","description":"Construct a type with a set of properties K of type T"},"EntitlementsStatusResponse":{"properties":{"appKey":{"$ref":"#/components/schemas/AppKey"},"user":{"properties":{"byokAllowed":{"type":"boolean"},"managedAiAllowed":{"type":"boolean"},"subscriptionStatus":{"type":"string"},"planDisplayName":{"type":"string"},"hasActiveSubscription":{"type":"boolean"},"accessState":{"$ref":"#/components/schemas/EntitlementAccessState"},"plan":{"$ref":"#/components/schemas/EntitlementPlan"}},"required":["byokAllowed","managedAiAllowed","planDisplayName","hasActiveSubscription","accessState","plan"],"type":"object"},"ai":{"properties":{"models":{"items":{"$ref":"#/components/schemas/EntitlementModelConfig"},"type":"array"},"operations":{"$ref":"#/components/schemas/Record_string._costCredits_63_-number--fundingModes-EntitlementFundingMode-Array--defaultModelId_63_-string--upgradeTarget_63_-STANDARD-or-PREMIUM__"},"fairUse":{"$ref":"#/components/schemas/EntitlementFairUseStatus"},"credits":{"properties":{"state":{"type":"string","enum":["available","exhausted","expired","none"]},"expiresAt":{"type":"string"},"granted":{"type":"number","format":"double"},"balance":{"type":"number","format":"double"}},"required":["state","granted","balance"],"type":"object"}},"required":["models","operations"],"type":"object"},"meters":{"$ref":"#/components/schemas/Record_string._type-usage-or-credit--state-EntitlementMeterState--used_63_-number--limit_63_-number--remaining_63_-number--period_63_-daily-or-monthly-or-yearly-or-user--resetAt_63_-string--limitLevel_63_-QuotaLimitLevel--upgradeTarget_63_-STANDARD-or-PREMIUM__"},"catalogVersion":{"type":"string"},"generatedAt":{"type":"string"}},"required":["appKey","user","ai","meters","catalogVersion","generatedAt"],"type":"object","additionalProperties":false},"SendEmailResponse":{"properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"],"type":"object","additionalProperties":false},"EmailTemplateKey":{"type":"string","enum":["welcome","collaboration-invitation","fraud-refund","dispute-created","renewal-reminder","trial-ending","payment-issue","trial-welcome","cancellation-confirmation","agent-run-warning","agent-run-abandoned","agent-run-action-required","topics-ready","outline-ready","draft-ready","feedback-alert","product-update"]},"SendEmailRequest":{"properties":{"appKey":{"type":"string","enum":["mdedit","cowrite"]},"mailClass":{"type":"string","enum":["transactional","marketing"]},"templateKey":{"$ref":"#/components/schemas/EmailTemplateKey"},"recipient":{"type":"string"},"locale":{"type":"string"},"variables":{"$ref":"#/components/schemas/Record_string.unknown_"},"idempotencyKey":{"type":"string"}},"required":["appKey","mailClass","templateKey","recipient","variables","idempotencyKey"],"type":"object","additionalProperties":false},"ContentPerformanceHealth":{"properties":{"tracked":{"type":"number","format":"double"},"needsSetup":{"type":"number","format":"double"},"needsAttention":{"type":"number","format":"double"},"waitingForData":{"type":"number","format":"double"},"notPublished":{"type":"number","format":"double","description":"Non-archived briefs excluded from the rollup because no article/URL exists yet."},"lastSuccessfulSyncAt":{"type":"number","format":"double"}},"required":["tracked","needsSetup","needsAttention","waitingForData"],"type":"object","additionalProperties":false},"ContentPerformanceRollupStatus":{"type":"string","enum":["tracking_active","needs_setup","needs_attention","waiting_for_data"]},"ContentPerformanceDelta":{"properties":{"clicks":{"type":"number","format":"double"},"impressions":{"type":"number","format":"double"},"ctr":{"type":"number","format":"double"},"averagePosition":{"type":"number","format":"double"}},"required":["clicks","impressions","ctr","averagePosition"],"type":"object","additionalProperties":false},"ContentPerformanceComparison":{"properties":{"previous":{"$ref":"#/components/schemas/ContentPerformanceSummary"},"delta":{"$ref":"#/components/schemas/ContentPerformanceDelta"},"deltaPercent":{"$ref":"#/components/schemas/ContentPerformanceDelta"}},"required":["previous","delta","deltaPercent"],"type":"object","additionalProperties":false},"ContentPerformanceTrend":{"type":"string","enum":["up","down","flat","new","none"]},"ContentPerformanceBriefRollup":{"properties":{"topicId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"contentProjectId":{"type":"string"},"projectName":{"type":"string"},"url":{"type":"string"},"domain":{"type":"string"},"status":{"$ref":"#/components/schemas/ContentPerformanceRollupStatus"},"statusLabel":{"type":"string"},"statusReason":{"type":"string"},"summary":{"$ref":"#/components/schemas/ContentPerformanceSummary"},"comparison":{"$ref":"#/components/schemas/ContentPerformanceComparison"},"trend":{"$ref":"#/components/schemas/ContentPerformanceTrend"}},"required":["topicId","title","status","statusLabel","summary","trend"],"type":"object","additionalProperties":false},"ContentPerformanceQueryBrief":{"properties":{"topicId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"contentProjectId":{"type":"string"},"projectName":{"type":"string"},"clicks":{"type":"number","format":"double"},"impressions":{"type":"number","format":"double"},"ctr":{"type":"number","format":"double"},"averagePosition":{"type":"number","format":"double"}},"required":["topicId","title","clicks","impressions","ctr","averagePosition"],"type":"object","additionalProperties":false},"ContentPerformanceQueryRollup":{"properties":{"query":{"type":"string"},"clicks":{"type":"number","format":"double"},"impressions":{"type":"number","format":"double"},"ctr":{"type":"number","format":"double"},"averagePosition":{"type":"number","format":"double"},"briefs":{"items":{"$ref":"#/components/schemas/ContentPerformanceQueryBrief"},"type":"array"}},"required":["query","clicks","impressions","ctr","averagePosition","briefs"],"type":"object","additionalProperties":false},"ContentPerformanceOpportunityType":{"type":"string","enum":["high_impressions_low_ctr","positions_4_to_20","declining_clicks","newly_gaining_traction"]},"ContentPerformanceOpportunity":{"properties":{"type":{"$ref":"#/components/schemas/ContentPerformanceOpportunityType"},"label":{"type":"string"},"description":{"type":"string"},"briefs":{"items":{"$ref":"#/components/schemas/ContentPerformanceBriefRollup"},"type":"array"}},"required":["type","label","description","briefs"],"type":"object","additionalProperties":false},"ContentPerformanceAppliedFilters":{"properties":{"contentProjectId":{"type":"string"},"domain":{"type":"string"},"status":{"$ref":"#/components/schemas/ContentPerformanceRollupStatus"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"type":"object","additionalProperties":false},"ContentPerformanceProjectFilter":{"properties":{"contentProjectId":{"type":"string"},"name":{"type":"string"}},"required":["contentProjectId","name"],"type":"object","additionalProperties":false},"ContentPerformanceDomainFilter":{"properties":{"domain":{"type":"string"}},"required":["domain"],"type":"object","additionalProperties":false},"ContentPerformanceStatusFilter":{"properties":{"status":{"$ref":"#/components/schemas/ContentPerformanceRollupStatus"},"label":{"type":"string"}},"required":["status","label"],"type":"object","additionalProperties":false},"ContentPerformanceAvailableFilters":{"properties":{"projects":{"items":{"$ref":"#/components/schemas/ContentPerformanceProjectFilter"},"type":"array"},"domains":{"items":{"$ref":"#/components/schemas/ContentPerformanceDomainFilter"},"type":"array"},"statuses":{"items":{"$ref":"#/components/schemas/ContentPerformanceStatusFilter"},"type":"array"}},"required":["projects","domains","statuses"],"type":"object","additionalProperties":false},"ContentPerformanceRollupFilters":{"properties":{"applied":{"$ref":"#/components/schemas/ContentPerformanceAppliedFilters"},"available":{"$ref":"#/components/schemas/ContentPerformanceAvailableFilters"}},"required":["applied","available"],"type":"object","additionalProperties":false},"ContentPerformanceRollupDetails":{"properties":{"health":{"$ref":"#/components/schemas/ContentPerformanceHealth"},"briefs":{"items":{"$ref":"#/components/schemas/ContentPerformanceBriefRollup"},"type":"array"},"topQueries":{"items":{"$ref":"#/components/schemas/ContentPerformanceQueryRollup"},"type":"array"},"opportunities":{"items":{"$ref":"#/components/schemas/ContentPerformanceOpportunity"},"type":"array"},"comparison":{"$ref":"#/components/schemas/ContentPerformanceComparison"},"filters":{"$ref":"#/components/schemas/ContentPerformanceRollupFilters"}},"required":["health","briefs","topQueries","opportunities","filters"],"type":"object","additionalProperties":false},"ContentProjectPerformanceResponse":{"properties":{"contentProjectId":{"type":"string"},"summary":{"$ref":"#/components/schemas/ContentPerformanceSummary"},"trackedTopicCount":{"type":"number","format":"double"},"dailyMetrics":{"items":{"$ref":"#/components/schemas/ContentPerformanceDailyMetric"},"type":"array"},"rollup":{"$ref":"#/components/schemas/ContentPerformanceRollupDetails"}},"required":["contentProjectId","summary","trackedTopicCount","dailyMetrics"],"type":"object","additionalProperties":false},"WorkspacePerformanceOverviewResponse":{"properties":{"workspaceId":{"type":"string"},"summary":{"$ref":"#/components/schemas/ContentPerformanceSummary"},"trackedTopicCount":{"type":"number","format":"double"},"dailyMetrics":{"items":{"$ref":"#/components/schemas/ContentPerformanceDailyMetric"},"type":"array"},"rollup":{"$ref":"#/components/schemas/ContentPerformanceRollupDetails"}},"required":["workspaceId","summary","trackedTopicCount","dailyMetrics"],"type":"object","additionalProperties":false},"ToolUploadResponse":{"properties":{"signedUrl":{"type":"string"},"expiresInSeconds":{"type":"number","format":"double"}},"required":["signedUrl","expiresInSeconds"],"type":"object","additionalProperties":false},"ToolUploadRequest":{"properties":{"key":{"type":"string"},"action":{"type":"string","enum":["putObject"],"nullable":false},"contentType":{"type":"string"}},"required":["key","action"],"type":"object","additionalProperties":false},"ConversationSummary":{"properties":{"conversationId":{"type":"string"},"title":{"type":"string"},"articleId":{"type":"string"},"scopeType":{"type":"string"},"scopeId":{"type":"string"},"messageCount":{"type":"number","format":"double"},"lastMessage":{"type":"string"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"}},"required":["conversationId","title","messageCount","lastMessage","createdAt","updatedAt"],"type":"object","additionalProperties":false},"ScopedConversationsResponse":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/ConversationSummary"},"type":"array"},"nextToken":{"type":"string"}},"required":["conversations"],"type":"object","additionalProperties":false},"ChatRole":{"type":"string","enum":["user","assistant","system"]},"AIResultKind":{"type":"string","enum":["analysis","replace_selection","insert"]},"AIIntent":{"type":"string","enum":["ask","edit","create","agent","writing","visual"],"description":"What the user intends to accomplish with this message."},"AIOutputKind":{"type":"string","enum":["text","code","image","chart","diagram","animation"],"description":"The kind of output to produce for `create` intent."},"AIPreviewKind":{"type":"string","enum":["diff","none"]},"ChatMessageAnchor":{"properties":{"kind":{"type":"string","enum":["selection","text"]},"selectedText":{"type":"string"},"from":{"type":"number","format":"double"},"to":{"type":"number","format":"double"},"textHash":{"type":"string"},"before":{"type":"string"},"after":{"type":"string"}},"required":["kind"],"type":"object","additionalProperties":false},"AssistantResponseFormat":{"type":"string","enum":["plain_text","markdown","markdown_code_block","json","json_code_block"]},"AssistantResponseContract":{"properties":{"format":{"$ref":"#/components/schemas/AssistantResponseFormat"},"codeFenceLanguage":{"type":"string"},"stripCodeFence":{"type":"boolean"},"normalizeReplaceSelection":{"type":"boolean"},"trimTrailingAssistantPhrases":{"type":"boolean"}},"required":["format"],"type":"object","additionalProperties":false},"AgentTimelineKind":{"type":"string","enum":["agent.run_started","agent.step_started","agent.step_completed","agent.paused_for_approval","agent.approval_resolved","agent.artifact_created","agent.run_completed","agent.run_failed","agent.run_cancelled"]},"AgentTimelineApprovalResolution":{"type":"string","enum":["approved","rejected","cancelled"]},"AgentArtifactPresentation":{"type":"string","enum":["document","report","topics","links"]},"AgentTimelineMetadata":{"properties":{"kind":{"$ref":"#/components/schemas/AgentTimelineKind"},"runId":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"stepName":{"type":"string","description":"Step name, when the event is step-scoped."},"correlationId":{"type":"string","description":"Stable key to correlate events (e.g. approvals) across reloads."},"durationMs":{"type":"number","format":"double","description":"Duration for completed step events."},"summary":{"type":"string","description":"Short human-readable summary for completed steps."},"nextStep":{"type":"string","description":"Pause/approval context"},"reviewStepName":{"type":"string","description":"Step whose output the user should review before approving (typically the\nmost recently completed workflow step)."},"resolution":{"$ref":"#/components/schemas/AgentTimelineApprovalResolution"},"resolutionNote":{"type":"string"},"artifactStepName":{"type":"string","description":"Artifact pointer (content fetched via agent-run artifact endpoint)."},"artifactPresentation":{"$ref":"#/components/schemas/AgentArtifactPresentation","description":"Declares how the UI should present the artifact and which actions are safe."},"artifactWordCount":{"type":"number","format":"double"},"citationsCount":{"type":"number","format":"double"}},"required":["kind","runId"],"type":"object","additionalProperties":false},"CowriteProposalMetadata":{"properties":{"type":{"type":"string","enum":["content_topic","content_project"]},"status":{"type":"string","enum":["draft","ready","created","failed"]},"title":{"type":"string"},"summary":{"type":"string"},"fields":{"$ref":"#/components/schemas/Record_string.unknown_"},"missingFields":{"items":{"type":"string"},"type":"array"},"confidence":{"type":"number","format":"double"},"created":{"properties":{"href":{"type":"string"},"slug":{"type":"string"},"shortId":{"type":"string"},"id":{"type":"string"}},"type":"object"},"error":{"type":"string"}},"required":["type","fields"],"type":"object","additionalProperties":false},"TurnIntent":{"type":"string","enum":["ask","edit","create","agent_task"],"description":"Phase 4 (Auto mode) Level-1 turn classification. Distinct from `AIIntent`:\n`agent_task` never gets written to `ChatMessageMetadata.intent` — it\nresolves to a proposed agent run instead (see `ai:agent-plan-proposed`)."},"Record_string.number_":{"properties":{},"additionalProperties":{"type":"number","format":"double"},"type":"object","description":"Construct a type with a set of properties K of type T"},"ChatMessageMetadata":{"properties":{"action":{"type":"string"},"resultKind":{"$ref":"#/components/schemas/AIResultKind","deprecated":true},"intent":{"$ref":"#/components/schemas/AIIntent","description":"User intent — replaces the old client-side `inputMode` and server-side `resultKind` inference."},"outputKind":{"$ref":"#/components/schemas/AIOutputKind","description":"Output kind for `create` intent only. Server-derived processing path; client supplies as a hint."},"outputParams":{"properties":{"renderer":{"type":"string"}},"type":"object","description":"Renderer hints for `create` intent. workspaceId/articleId from client are IGNORED — always from auth session."},"selectedText":{"type":"string"},"instruction":{"type":"string"},"codeLanguage":{"type":"string"},"cursorPosition":{"type":"number","format":"double"},"insertedAt":{"type":"number","format":"double"},"previewKind":{"$ref":"#/components/schemas/AIPreviewKind"},"autoPreview":{"type":"boolean"},"anchor":{"$ref":"#/components/schemas/ChatMessageAnchor"},"assistantContract":{"$ref":"#/components/schemas/AssistantResponseContract"},"agent":{"$ref":"#/components/schemas/AgentTimelineMetadata","description":"Agent timeline metadata.\nWhen present, this chat message is part of an agent run timeline and should\nbe rendered inline in the chat transcript (run started, step progress,\napprovals, artifacts, etc.)."},"cowriteProposal":{"$ref":"#/components/schemas/CowriteProposalMetadata"},"aiExecution":{"properties":{"status":{"type":"string","enum":["completed","failed"]},"latencyMs":{"type":"number","format":"double"},"endpointProvider":{"type":"string"},"modelName":{"type":"string"},"provider":{"type":"string"},"route":{"type":"string"}},"type":"object"},"idempotencyKey":{"type":"string"},"clientRequestId":{"type":"string"},"requestMetadata":{"properties":{"providerMode":{"type":"string","enum":["managed","byok","local"]},"source":{"type":"string"},"operation":{"type":"string"},"clientRequestId":{"type":"string"},"idempotencyKey":{"type":"string"}},"type":"object"},"autoRouting":{"properties":{"rationale":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"resolvedIntent":{"$ref":"#/components/schemas/TurnIntent"}},"required":["rationale","confidence","resolvedIntent"],"type":"object","description":"Auto mode (Phase 4) telemetry: the Level-1 turn router's decision, set\nserver-side in `aiAssistantSocket.ts` whenever `intent` was omitted by\nthe client. Passive — never read by downstream dispatch logic, which\nalways keys off the resolved `intent` field above instead."},"storage":{"properties":{"truncatedFields":{"$ref":"#/components/schemas/Record_string.number_"},"truncatedContentLength":{"type":"number","format":"double"},"originalContentLength":{"type":"number","format":"double"},"truncated":{"type":"boolean"}},"type":"object","description":"Server-side storage hints (e.g., truncated fields to fit DynamoDB limits).\nThe client may ignore these fields."}},"type":"object","additionalProperties":false},"ChatMessage":{"properties":{"role":{"$ref":"#/components/schemas/ChatRole"},"content":{"type":"string"},"timestamp":{"type":"number","format":"double"},"metadata":{"$ref":"#/components/schemas/ChatMessageMetadata"}},"required":["role","content","timestamp"],"type":"object","additionalProperties":false},"AIConversation":{"properties":{"conversationId":{"type":"string"},"title":{"type":"string"},"articleId":{"type":"string"},"workspaceId":{"type":"string"},"username":{"type":"string"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"expiresAt":{"type":"number","format":"double"},"scopeType":{"type":"string"},"scopeId":{"type":"string"},"scopeTypeId":{"type":"string"}},"required":["conversationId","workspaceId","username","messages","createdAt","updatedAt","expiresAt"],"type":"object","additionalProperties":false},"ConversationDetailResponse":{"properties":{"conversation":{"allOf":[{"$ref":"#/components/schemas/AIConversation"},{"properties":{"title":{"type":"string"}},"required":["title"],"type":"object"}]}},"required":["conversation"],"type":"object","additionalProperties":false},"AppendConversationMessagesRequest":{"properties":{"scopeType":{"type":"string"},"scopeId":{"type":"string"},"articleId":{"type":"string"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array"},"execution":{"properties":{"status":{"type":"string","enum":["completed","failed"]},"latencyMs":{"type":"number","format":"double"},"endpointProvider":{"type":"string"},"modelName":{"type":"string"},"provider":{"type":"string"},"route":{"type":"string"}},"type":"object"}},"required":["scopeType","scopeId","messages"],"type":"object","additionalProperties":false},"GenerateTopicsResponse":{"properties":{"runId":{"type":"string"},"status":{"type":"string","enum":["queued"],"nullable":false}},"required":["runId","status"],"type":"object","additionalProperties":false},"GenerateTopicsRequest":{"properties":{"regenerate":{"type":"boolean","description":"If true, regenerate the selected set using the project's current quality tier."}},"type":"object","additionalProperties":false},"ProjectPrefillResponse":{"properties":{"jobId":{"type":"string"}},"required":["jobId"],"type":"object","additionalProperties":false},"ProjectPrefillRequest":{"properties":{"url":{"type":"string"}},"required":["url"],"type":"object","additionalProperties":false},"CreateContentProjectResponse":{"properties":{"contentProjectId":{"type":"string"},"folderId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"number","format":"double"}},"required":["contentProjectId","folderId","shortId","slug","createdAt"],"type":"object","additionalProperties":false},"CreateContentProjectRequest":{"properties":{"workspaceId":{"type":"string"},"name":{"type":"string"},"parentFolderId":{"type":"string"},"productName":{"type":"string"},"productDescription":{"type":"string"},"targetAudience":{"type":"string"},"primaryUseCase":{"type":"string"},"siteUrl":{"type":"string"},"seoIntent":{"$ref":"#/components/schemas/SeoIntent"},"seoEnforcement":{"$ref":"#/components/schemas/SeoEnforcement"},"toneGuide":{"type":"string"},"styleProfileId":{"type":"string"},"existingContentUrls":{"items":{"type":"string"},"type":"array"},"competitorUrls":{"items":{"type":"string"},"type":"array"},"platformKeywords":{"items":{"type":"string"},"type":"array"},"desiredKeywords":{"items":{"type":"string"},"type":"array"},"generationQualityTier":{"$ref":"#/components/schemas/GenerationQualityTier"},"visualStyle":{"$ref":"#/components/schemas/VisualStyle"},"approvalPolicy":{"$ref":"#/components/schemas/ApprovalPolicy"},"defaultWordCountRange":{"$ref":"#/components/schemas/WordCountRange"},"aeoProfile":{"$ref":"#/components/schemas/AeoProfile"},"keywordMarket":{"properties":{"includeGlobalVolume":{"type":"boolean"},"locale":{"$ref":"#/components/schemas/KeywordMarketLocale"}},"required":["includeGlobalVolume","locale"],"type":"object"}},"required":["workspaceId","name","productName","productDescription","targetAudience","primaryUseCase"],"type":"object","additionalProperties":false},"ContentProjectFolder":{"properties":{"workspaceId":{"type":"string"},"folderId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"parentFolderId":{"type":"string"},"folderType":{"type":"string","enum":["content_project"],"nullable":false},"contentProject":{"$ref":"#/components/schemas/ContentProjectMetadata"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"deletedAt":{"type":"number","format":"double"},"deletedBy":{"type":"string"}},"required":["workspaceId","folderId","name","createdAt","updatedAt","folderType","contentProject"],"type":"object","additionalProperties":false},"ContentProjectMessageResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"UpdateContentProjectRequest":{"properties":{"name":{"type":"string"},"parentFolderId":{"type":"string"},"productName":{"type":"string"},"productDescription":{"type":"string"},"targetAudience":{"type":"string"},"primaryUseCase":{"type":"string"},"siteUrl":{"type":"string"},"seoIntent":{"$ref":"#/components/schemas/SeoIntent"},"seoEnforcement":{"$ref":"#/components/schemas/SeoEnforcement"},"toneGuide":{"type":"string"},"styleProfileId":{"type":"string"},"existingContentUrls":{"items":{"type":"string"},"type":"array"},"competitorUrls":{"items":{"type":"string"},"type":"array"},"platformKeywords":{"items":{"type":"string"},"type":"array"},"desiredKeywords":{"items":{"type":"string"},"type":"array"},"generationQualityTier":{"$ref":"#/components/schemas/GenerationQualityTier"},"visualStyle":{"$ref":"#/components/schemas/VisualStyle"},"approvalPolicy":{"$ref":"#/components/schemas/ApprovalPolicy"},"defaultWordCountRange":{"allOf":[{"$ref":"#/components/schemas/WordCountRange"}],"nullable":true},"aeoProfile":{"$ref":"#/components/schemas/AeoProfile"},"keywordMarket":{"properties":{"includeGlobalVolume":{"type":"boolean"},"locale":{"$ref":"#/components/schemas/KeywordMarketLocale"}},"required":["includeGlobalVolume","locale"],"type":"object"}},"type":"object","additionalProperties":false},"ArchiveContentProjectResponse":{"properties":{"contentProjectId":{"type":"string"},"archivedAt":{"type":"number","format":"double"},"archivedTopics":{"type":"number","format":"double"}},"required":["contentProjectId","archivedAt","archivedTopics"],"type":"object","additionalProperties":false},"RestoreContentProjectResponse":{"properties":{"contentProjectId":{"type":"string"},"restoredTopics":{"type":"number","format":"double"}},"required":["contentProjectId","restoredTopics"],"type":"object","additionalProperties":false},"DeleteContentProjectResponse":{"properties":{"contentProjectId":{"type":"string"},"deletedAt":{"type":"number","format":"double"}},"required":["contentProjectId","deletedAt"],"type":"object","additionalProperties":false},"ArcadeConnectionStatus":{"type":"string","enum":["connected","not_connected","needs_reconnect","pending","disabled","unknown"]},"ConnectedAccountProvider":{"properties":{"providerKey":{"type":"string"},"label":{"type":"string"},"enabled":{"type":"boolean","description":"Whether Arcade integrations are enabled for the workspace/user"},"status":{"$ref":"#/components/schemas/ArcadeConnectionStatus"},"connectionId":{"type":"string","description":"Arcade connection record ID — used to disconnect via DELETE /connected-accounts/:connectionId"},"providerId":{"type":"string","description":"Arcade internal provider ID"},"statusReason":{"type":"string","description":"Reason for non-connected statuses, e.g. \"Token expired\" or \"Arcade unavailable\""},"toolkits":{"items":{"type":"string"},"type":"array","description":"All Arcade toolkits associated with this provider"},"connectedAt":{"type":"string"},"providerUserInfo":{"properties":{"avatarUrl":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"type":"object"},"connectPath":{"type":"string"},"disclosure":{"type":"string"},"requiredForWorkflowIds":{"items":{"type":"string"},"type":"array"}},"required":["providerKey","label","enabled","status","toolkits","connectPath","disclosure","requiredForWorkflowIds"],"type":"object","additionalProperties":false},"ListConnectedAccountsResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/ConnectedAccountProvider"},"type":"array"}},"required":["providers"],"type":"object","additionalProperties":false},"StartAuthorizationResult":{"properties":{"providerKey":{"type":"string"},"status":{"type":"string","enum":["completed","pending","not_started","failed"]},"authorizationUrl":{"type":"string"},"authorizationId":{"type":"string"},"expiresAt":{"type":"number","format":"double"}},"required":["providerKey","status"],"type":"object","additionalProperties":false},"StartAuthorizationRequest":{"properties":{"returnTo":{"type":"string","description":"Relative path to redirect to after OAuth completes (must start with \"/\")"},"runId":{"type":"string","description":"Agent run ID that triggered this authorization (embedded in the returnTo flow)"}},"type":"object","additionalProperties":false},"CollaborationStatusResponse":{"properties":{"collaborative":{"type":"boolean"},"articleId":{"type":"string"},"workspaceId":{"type":"string"},"targetId":{"type":"string","enum":["content.md"],"nullable":false},"canEdit":{"type":"boolean"},"canWrite":{"type":"boolean"},"permission":{"type":"string","enum":["read","write","workspace_member","owner",null],"nullable":true},"websocketPath":{"type":"string","enum":["/collaboration"],"nullable":false},"roomEpoch":{"type":"number","format":"double"},"presenceIdentity":{"properties":{"onBehalfOf":{"type":"string"},"agentName":{"type":"string"},"kind":{"type":"string","enum":["agent"],"nullable":false}},"required":["onBehalfOf","agentName","kind"],"type":"object"},"yjsRevision":{"type":"number","format":"double"},"lastStoredAt":{"type":"number","format":"double"},"lastCheckpointAt":{"type":"number","format":"double"},"packageRevision":{"type":"number","format":"double"}},"required":["collaborative","articleId","workspaceId","targetId","canEdit","canWrite","permission","websocketPath","roomEpoch"],"type":"object","additionalProperties":false},"CollaborationEnableResponse":{"properties":{"collaborative":{"type":"boolean"},"articleId":{"type":"string"},"workspaceId":{"type":"string"},"targetId":{"type":"string","enum":["content.md"],"nullable":false},"canEdit":{"type":"boolean"},"canWrite":{"type":"boolean"},"permission":{"type":"string","enum":["read","write","workspace_member","owner",null],"nullable":true},"websocketPath":{"type":"string","enum":["/collaboration"],"nullable":false},"roomEpoch":{"type":"number","format":"double"},"presenceIdentity":{"properties":{"onBehalfOf":{"type":"string"},"agentName":{"type":"string"},"kind":{"type":"string","enum":["agent"],"nullable":false}},"required":["onBehalfOf","agentName","kind"],"type":"object"},"yjsRevision":{"type":"number","format":"double"},"lastStoredAt":{"type":"number","format":"double"},"lastCheckpointAt":{"type":"number","format":"double"},"packageRevision":{"type":"number","format":"double"},"enabledAt":{"type":"number","format":"double"},"alreadyEnabled":{"type":"boolean"}},"required":["collaborative","articleId","workspaceId","targetId","canEdit","canWrite","permission","websocketPath","roomEpoch","enabledAt","alreadyEnabled"],"type":"object","additionalProperties":false},"CollaborationCheckpointResponse":{"properties":{"collaborative":{"type":"boolean"},"articleId":{"type":"string"},"workspaceId":{"type":"string"},"targetId":{"type":"string","enum":["content.md"],"nullable":false},"canEdit":{"type":"boolean"},"canWrite":{"type":"boolean"},"permission":{"type":"string","enum":["read","write","workspace_member","owner",null],"nullable":true},"websocketPath":{"type":"string","enum":["/collaboration"],"nullable":false},"roomEpoch":{"type":"number","format":"double"},"presenceIdentity":{"properties":{"onBehalfOf":{"type":"string"},"agentName":{"type":"string"},"kind":{"type":"string","enum":["agent"],"nullable":false}},"required":["onBehalfOf","agentName","kind"],"type":"object"},"yjsRevision":{"type":"number","format":"double"},"lastStoredAt":{"type":"number","format":"double"},"lastCheckpointAt":{"type":"number","format":"double"},"packageRevision":{"type":"number","format":"double"},"checkpointedAt":{"type":"number","format":"double"},"changed":{"type":"boolean"},"changedTargets":{"items":{"type":"string"},"type":"array"},"reviewChanged":{"type":"boolean"},"targetHashes":{"$ref":"#/components/schemas/Record_string.string_"},"reviewHash":{"type":"string"},"lastPackageRevision":{"type":"number","format":"double"}},"required":["collaborative","articleId","workspaceId","targetId","canEdit","canWrite","permission","websocketPath","roomEpoch","checkpointedAt","changed","changedTargets","reviewChanged","targetHashes"],"type":"object","additionalProperties":false},"CodeTypingAnimationStartResponse":{"properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["queued"],"nullable":false},"statusUrl":{"type":"string"}},"required":["jobId","status","statusUrl"],"type":"object","additionalProperties":false},"CodeTypingAnimationRequest":{"properties":{"code":{"type":"string"},"language":{"$ref":"#/components/schemas/CodeMediaLanguage"},"theme":{"$ref":"#/components/schemas/CodeMediaTheme"},"typingSpeedCps":{"type":"number","format":"double"},"pauseAtEndMs":{"type":"number","format":"double"},"windowChrome":{"$ref":"#/components/schemas/CodeMediaWindowChrome"}},"required":["code"],"type":"object","additionalProperties":false},"CodeTypingAnimationArtifactFormat":{"type":"string","enum":["mp4","gif","poster"]},"CodeTypingAnimationArtifact":{"properties":{"format":{"$ref":"#/components/schemas/CodeTypingAnimationArtifactFormat"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"downloadUrl":{"type":"string"}},"required":["format","fileName","mimeType","downloadUrl"],"type":"object","additionalProperties":false},"CodeTypingAnimationJobStatusResponse":{"properties":{"jobId":{"type":"string"},"status":{"type":"string"},"progress":{"type":"number","format":"double"},"createdAt":{"type":"string"},"processedAt":{"type":"string"},"finishedAt":{"type":"string"},"failedReason":{"type":"string"},"artifacts":{"items":{"$ref":"#/components/schemas/CodeTypingAnimationArtifact"},"type":"array"}},"required":["jobId","status","progress","createdAt"],"type":"object","additionalProperties":false},"CodeTypingAnimationDownloadResponse":{"properties":{"url":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"expiresAt":{"type":"string"}},"required":["url","fileName","mimeType","expiresAt"],"type":"object","additionalProperties":false},"CalendarEntry":{"properties":{"topicId":{"type":"string"},"scheduledDate":{"type":"string"},"note":{"type":"string"}},"required":["topicId"],"type":"object","additionalProperties":false},"GenerateCalendarResult":{"properties":{"calendarId":{"type":"string"},"entries":{"items":{"$ref":"#/components/schemas/CalendarEntry"},"type":"array"}},"required":["calendarId","entries"],"type":"object","additionalProperties":false},"CalendarCadence":{"type":"string","enum":["weekly","biweekly","monthly"]},"FunnelMix":{"properties":{"tofu":{"type":"number","format":"double"},"mofu":{"type":"number","format":"double"},"bofu":{"type":"number","format":"double"}},"required":["tofu","mofu","bofu"],"type":"object","additionalProperties":false},"GenerateCalendarRequest":{"properties":{"topicIds":{"items":{"type":"string"},"type":"array","description":"Topic IDs to schedule (max 25 per call)."},"cadence":{"$ref":"#/components/schemas/CalendarCadence","description":"Spacing between consecutive slots."},"startDate":{"type":"string","description":"ISO date of the first slot, e.g. \"2026-04-15\"."},"targetFunnelMix":{"$ref":"#/components/schemas/FunnelMix","description":"Target funnel distribution (percentages, must sum to 100 ±1).\nOmit to use the default 45% TOFU / 30% MOFU / 25% BOFU mix."}},"required":["topicIds","cadence","startDate"],"type":"object","additionalProperties":false},"UpdateCalendarEntryRequest":{"properties":{"scheduledDate":{"type":"string","nullable":true,"description":"New ISO date for the topic slot, or null to clear."},"scheduleNote":{"type":"string","nullable":true,"description":"Optional note for the slot, or null to clear."}},"type":"object","additionalProperties":false},"AssistantStyleRule":{"properties":{"type":{"type":"string"},"description":{"type":"string"},"value":{}},"required":["type"],"type":"object","additionalProperties":false},"AssistantAttachedResource":{"properties":{"resourceId":{"type":"string"},"type":{"type":"string","enum":["url","file"]},"uri":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"excerpt":{"type":"string"},"score":{"type":"number","format":"double"}},"required":["resourceId","type","uri"],"type":"object","additionalProperties":false},"AssistantHeading":{"properties":{"level":{"type":"number","format":"double"},"text":{"type":"string"}},"required":["level","text"],"type":"object","additionalProperties":false},"AssistantSection":{"properties":{"heading":{"type":"string"},"level":{"type":"number","format":"double"},"content":{"type":"string"}},"required":["heading"],"type":"object","additionalProperties":false},"Iterable_string_":{"properties":{},"type":"object","additionalProperties":false},"AssistantCodeBlock":{"properties":{"language":{"type":"string"},"content":{"type":"string"}},"type":"object","additionalProperties":false},"AssistantContext":{"properties":{"articleId":{"type":"string"},"workspaceId":{"type":"string"},"folderId":{"type":"string"},"articleTitle":{"type":"string"},"documentType":{"type":"string"},"audience":{"type":"string"},"tone":{"type":"string"},"customInstructions":{"type":"string"},"stylePrompt":{"type":"string"},"styleGuide":{"items":{"$ref":"#/components/schemas/AssistantStyleRule"},"type":"array"},"attachedResources":{"items":{"$ref":"#/components/schemas/AssistantAttachedResource"},"type":"array"},"headings":{"items":{"$ref":"#/components/schemas/AssistantHeading"},"type":"array"},"currentSection":{"$ref":"#/components/schemas/AssistantSection"},"precedingText":{"type":"string"},"technicalTerms":{"anyOf":[{"$ref":"#/components/schemas/Iterable_string_"},{"items":{"type":"string"},"type":"array"}]},"detectedLibraries":{"items":{"type":"string"},"type":"array"},"selectedText":{"type":"string"},"cursorPosition":{"type":"number","format":"double"},"localDocumentText":{"type":"string"},"surroundingCode":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/AssistantCodeBlock"},"type":"array"}]}},"type":"object","additionalProperties":false},"ResolveAssistantContextResponse":{"properties":{"context":{"$ref":"#/components/schemas/AssistantContext"},"resolutionMeta":{"properties":{"estimatedTokens":{"type":"number","format":"double"},"resourceCount":{"type":"number","format":"double"},"degradeReason":{"type":"string","enum":["offline","unavailable","not_found","forbidden"]},"degraded":{"type":"boolean"},"usedResources":{"type":"boolean"}},"required":["resourceCount","degraded","usedResources"],"type":"object"}},"required":["context","resolutionMeta"],"type":"object","additionalProperties":false},"AssistantIntent":{"type":"string","enum":["ask","edit","create","writing","visual"]},"AssistantSurface":{"type":"string","enum":["chat","quick_action","writing_dialog","visual_dialog","backend_assistant"]},"ResolveAssistantContextRequestBody":{"properties":{"workspaceId":{"type":"string"},"articleId":{"type":"string"},"folderId":{"type":"string"},"scopeType":{"type":"string","enum":["article","workspace","folder"]},"scopeId":{"type":"string"},"intent":{"$ref":"#/components/schemas/AssistantIntent"},"surface":{"$ref":"#/components/schemas/AssistantSurface"},"action":{"type":"string"},"userQuery":{"type":"string"},"selectedText":{"type":"string"},"cursorPosition":{"type":"number","format":"double"},"localDocumentHints":{"properties":{"nextLine":{"type":"string"},"previousLine":{"type":"string"},"currentLine":{"type":"string"},"surroundingText":{"type":"string"},"documentText":{"type":"string"}},"type":"object"},"includeResources":{"type":"boolean"},"includeDocumentAnalysis":{"type":"boolean"},"includeStyleContext":{"type":"boolean"}},"required":["workspaceId","intent","surface","userQuery"],"type":"object","additionalProperties":false},"ApiReviewDocument":{"properties":{"updatedAt":{"type":"string"},"history":{"items":{},"type":"array"},"targets":{"$ref":"#/components/schemas/Record_string.unknown_"},"version":{"type":"number","enum":[1],"nullable":false}},"required":["targets","version"],"type":"object"},"GetArticleReviewResponse":{"properties":{"articleId":{"type":"string"},"review":{"$ref":"#/components/schemas/ApiReviewDocument"},"reviewHash":{"type":"string"},"reviewHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"reviewRevision":{"type":"number","format":"double"},"packageRevision":{"type":"number","format":"double"}},"required":["articleId","review"],"type":"object","additionalProperties":false},"ArticleReviewUploadUrlResponse":{"properties":{"operationId":{"type":"string"},"uploadId":{"type":"string"},"uploadUrl":{"type":"string"},"expiresIn":{"type":"number","format":"double"}},"required":["operationId","uploadId","uploadUrl","expiresIn"],"type":"object","additionalProperties":false},"ArticleReviewUploadUrlRequest":{"properties":{"operationId":{"type":"string"},"reviewHash":{"type":"string"},"contentLength":{"type":"number","format":"double"}},"required":["operationId","reviewHash"],"type":"object","additionalProperties":false},"Record_PackageReviewTargetId.string_":{"properties":{},"additionalProperties":{"type":"string"},"type":"object","description":"Construct a type with a set of properties K of type T"},"Record_PackageReviewTargetId.number_":{"properties":{},"additionalProperties":{"type":"number","format":"double"},"type":"object","description":"Construct a type with a set of properties K of type T"},"ArticlePackageCommitResponse":{"properties":{"message":{"type":"string"},"targetHashes":{"$ref":"#/components/schemas/Record_PackageReviewTargetId.string_"},"targetRevisions":{"$ref":"#/components/schemas/Record_PackageReviewTargetId.number_"},"reviewHash":{"type":"string"},"reviewHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"reviewRevision":{"type":"number","format":"double"},"packageRevision":{"type":"number","format":"double"},"articleRevision":{"type":"number","format":"double"},"shortId":{"type":"string"},"slug":{"type":"string"},"autoVersionCreated":{"type":"boolean"},"versionId":{"type":"string"},"versionNumber":{"type":"number","format":"double"},"reviewReconciliation":{"properties":{"orphaned":{"type":"number","format":"double"},"restored":{"type":"number","format":"double"},"reanchored":{"type":"number","format":"double"}},"required":["orphaned","restored","reanchored"],"type":"object"},"review":{"$ref":"#/components/schemas/ApiReviewDocument"}},"required":["message"],"type":"object","additionalProperties":false},"ArticleReviewCommitRequest":{"properties":{"operationId":{"type":"string"},"uploadId":{"type":"string"},"reviewHash":{"type":"string"},"baseReviewHash":{"type":"string"},"baseReviewRevision":{"type":"number","format":"double"},"basePackageRevision":{"type":"number","format":"double"}},"required":["operationId","uploadId","reviewHash"],"type":"object","additionalProperties":false},"Record_ReviewTargetId.string_":{"properties":{},"additionalProperties":{"type":"string"},"type":"object","description":"Construct a type with a set of properties K of type T"},"Record_ReviewTargetId.number_":{"properties":{},"additionalProperties":{"type":"number","format":"double"},"type":"object","description":"Construct a type with a set of properties K of type T"},"ArticleReviewCommandsResponse":{"properties":{"review":{"$ref":"#/components/schemas/ReviewDocument","description":"Present when server-side reconciliation changed the canonical review."},"reviewReconciliation":{"$ref":"#/components/schemas/ReviewReconciliationSummary"},"articleRevision":{"type":"number","format":"double"},"packageRevision":{"type":"number","format":"double"},"reviewRevision":{"type":"number","format":"double"},"reviewHash":{"type":"string"},"targetRevisions":{"$ref":"#/components/schemas/Record_ReviewTargetId.number_"},"targetHashes":{"$ref":"#/components/schemas/Record_ReviewTargetId.string_"},"events":{"items":{"$ref":"#/components/schemas/ReviewHistoryEvent"},"type":"array"},"applied":{"type":"boolean"},"commandId":{"type":"string"}},"required":["events","applied","commandId"],"type":"object"},"EditorSelection":{"properties":{"text":{"type":"string"},"to":{"type":"number","format":"double"},"from":{"type":"number","format":"double"}},"required":["text","to","from"],"type":"object"},"ReviewQuoteContext":{"properties":{"after":{"type":"string"},"before":{"type":"string"}},"type":"object"},"ReviewQuoteAnchor":{"properties":{"context":{"$ref":"#/components/schemas/ReviewQuoteContext"},"occurrence":{"type":"number","format":"double","description":"One-based occurrence after context filtering."},"quote":{"type":"string"}},"required":["quote"],"type":"object"},"ReviewInlineCommandLocation":{"anyOf":[{"properties":{"anchor":{},"range":{"$ref":"#/components/schemas/EditorSelection"}},"required":["range"],"type":"object"},{"properties":{"range":{},"anchor":{"$ref":"#/components/schemas/ReviewQuoteAnchor"}},"required":["anchor"],"type":"object"}]},"ReviewHeadingAnchor":{"anyOf":[{"properties":{"beforeHeading":{"type":"string"}},"required":["beforeHeading"],"type":"object"},{"properties":{"afterHeading":{"type":"string"}},"required":["afterHeading"],"type":"object"},{"properties":{"inSection":{"type":"string"}},"required":["inSection"],"type":"object"}]},"ReviewBlockCommandLocation":{"anyOf":[{"properties":{"anchor":{},"blockOffset":{"type":"number","format":"double"}},"required":["blockOffset"],"type":"object"},{"properties":{"blockOffset":{},"anchor":{"$ref":"#/components/schemas/ReviewHeadingAnchor"}},"required":["anchor"],"type":"object"}]},"ReviewSuggestionInput":{"anyOf":[{"properties":{"suggestedText":{"type":"string"},"kind":{"type":"string","enum":["insert"],"nullable":false}},"required":["suggestedText","kind"],"type":"object"},{"properties":{"originalText":{"type":"string"},"kind":{"type":"string","enum":["delete"],"nullable":false}},"required":["originalText","kind"],"type":"object"},{"properties":{"suggestedText":{"type":"string"},"originalText":{"type":"string"},"kind":{"type":"string","enum":["replace"],"nullable":false}},"required":["suggestedText","originalText","kind"],"type":"object"}]},"ReviewCommand":{"anyOf":[{"allOf":[{"properties":{"body":{"type":"string"},"reviewId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["add-comment"],"nullable":false}},"required":["body","targetId","type"],"type":"object"},{"$ref":"#/components/schemas/ReviewInlineCommandLocation"}]},{"allOf":[{"properties":{"body":{"type":"string"},"blockPath":{"type":"string"},"reviewId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["add-block-comment"],"nullable":false}},"required":["body","targetId","type"],"type":"object"},{"$ref":"#/components/schemas/ReviewBlockCommandLocation"}]},{"allOf":[{"properties":{"note":{"type":"string"},"reviewId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["add-highlight"],"nullable":false}},"required":["targetId","type"],"type":"object"},{"$ref":"#/components/schemas/ReviewInlineCommandLocation"}]},{"allOf":[{"properties":{"note":{"type":"string"},"blockPath":{"type":"string"},"reviewId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["add-block-highlight"],"nullable":false}},"required":["targetId","type"],"type":"object"},{"$ref":"#/components/schemas/ReviewBlockCommandLocation"}]},{"allOf":[{"properties":{"note":{"type":"string"},"suggestion":{"$ref":"#/components/schemas/ReviewSuggestionInput"},"reviewId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["add-suggestion"],"nullable":false}},"required":["suggestion","targetId","type"],"type":"object"},{"$ref":"#/components/schemas/ReviewInlineCommandLocation"}]},{"properties":{"body":{"type":"string"},"replyId":{"$ref":"#/components/schemas/ReviewId"},"threadId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["reply"],"nullable":false}},"required":["body","threadId","targetId","type"],"type":"object"},{"properties":{"replyId":{"$ref":"#/components/schemas/ReviewId"},"reviewId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["delete-reply"],"nullable":false}},"required":["replyId","reviewId","targetId","type"],"type":"object"},{"properties":{"threadId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["resolve"],"nullable":false}},"required":["threadId","targetId","type"],"type":"object"},{"properties":{"threadId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["reopen"],"nullable":false}},"required":["threadId","targetId","type"],"type":"object"},{"properties":{"suggestionId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["accept-suggestion"],"nullable":false}},"required":["suggestionId","targetId","type"],"type":"object"},{"properties":{"suggestionId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["reject-suggestion"],"nullable":false}},"required":["suggestionId","targetId","type"],"type":"object"},{"properties":{"assignedTo":{"$ref":"#/components/schemas/ReviewAuthor"},"reviewId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["assign-review-item"],"nullable":false}},"required":["reviewId","targetId","type"],"type":"object"},{"properties":{"reviewId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["delete-review-item"],"nullable":false}},"required":["reviewId","targetId","type"],"type":"object"},{"allOf":[{"properties":{"reviewId":{"$ref":"#/components/schemas/ReviewId"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["repair-anchor"],"nullable":false}},"required":["reviewId","targetId","type"],"type":"object"},{"$ref":"#/components/schemas/ReviewInlineCommandLocation"}]},{"properties":{"text":{"type":"string"},"to":{"type":"number","format":"double"},"from":{"type":"number","format":"double"},"targetId":{"$ref":"#/components/schemas/ReviewTargetId"},"type":{"type":"string","enum":["remove-review-marker"],"nullable":false}},"required":["to","from","targetId","type"],"type":"object"}]},"ArticleReviewCommandsRequest":{"properties":{"commands":{"items":{"$ref":"#/components/schemas/ReviewCommand"},"type":"array"},"commandId":{"type":"string","description":"Client-generated id shared by every retry of this batch."}},"required":["commands","commandId"],"type":"object"},"GetArticlePackageResponse":{"properties":{"articleId":{"type":"string"},"targets":{"$ref":"#/components/schemas/Record_PackageReviewTargetId.string_"},"review":{"$ref":"#/components/schemas/ApiReviewDocument"},"targetHashes":{"$ref":"#/components/schemas/Record_PackageReviewTargetId.string_"},"targetRevisions":{"$ref":"#/components/schemas/Record_PackageReviewTargetId.number_"},"reviewHash":{"type":"string"},"reviewRevision":{"type":"number","format":"double"},"articleRevision":{"type":"number","format":"double"},"packageRevision":{"type":"number","format":"double"}},"required":["articleId","targets","review","targetHashes","targetRevisions"],"type":"object","additionalProperties":false},"Record_PackageReviewTargetId._uploadUrl-string--uploadId-string__":{"properties":{},"additionalProperties":{"properties":{"uploadId":{"type":"string"},"uploadUrl":{"type":"string"}},"required":["uploadId","uploadUrl"],"type":"object"},"type":"object","description":"Construct a type with a set of properties K of type T"},"ArticlePackageUploadUrlsResponse":{"properties":{"operationId":{"type":"string"},"expiresIn":{"type":"number","format":"double"},"targetUploadUrls":{"$ref":"#/components/schemas/Record_PackageReviewTargetId._uploadUrl-string--uploadId-string__"},"reviewUploadUrl":{"properties":{"uploadId":{"type":"string"},"uploadUrl":{"type":"string"}},"required":["uploadId","uploadUrl"],"type":"object"}},"required":["operationId","expiresIn"],"type":"object","additionalProperties":false},"PackageReviewTargetId":{"type":"string"},"ArticlePackageMutation":{"properties":{"createIfMissing":{"type":"boolean"},"title":{"type":"string"},"preview":{"type":"string"},"wordCount":{"type":"number","format":"double"},"folderId":{"type":"string","nullable":true},"isPinned":{"type":"boolean"},"isArchived":{"type":"boolean"},"articleSettings":{"$ref":"#/components/schemas/Record_string.unknown_"},"tags":{"items":{"type":"string"},"type":"array","nullable":true},"collaborative":{"type":"boolean"},"baseArticleRevision":{"type":"number","format":"double"}},"type":"object","additionalProperties":false},"ArticlePackageUploadUrlsRequest":{"properties":{"operationId":{"type":"string"},"changedTargets":{"items":{"$ref":"#/components/schemas/PackageReviewTargetId"},"type":"array"},"reviewChanged":{"type":"boolean"},"articleMutation":{"$ref":"#/components/schemas/ArticlePackageMutation"}},"required":["operationId"],"type":"object","additionalProperties":false},"ArticlePackageCommitRequest":{"properties":{"operationId":{"type":"string"},"changedTargets":{"items":{"$ref":"#/components/schemas/PackageReviewTargetId"},"type":"array"},"reviewChanged":{"type":"boolean"},"targetUploadIds":{"$ref":"#/components/schemas/Record_PackageReviewTargetId.string_"},"reviewUploadId":{"type":"string"},"targetHashes":{"$ref":"#/components/schemas/Record_PackageReviewTargetId.string_"},"reviewHash":{"type":"string"},"baseTargetHashes":{"$ref":"#/components/schemas/Record_PackageReviewTargetId.string_"},"baseTargetRevisions":{"$ref":"#/components/schemas/Record_PackageReviewTargetId.number_"},"baseReviewHash":{"type":"string"},"baseReviewRevision":{"type":"number","format":"double"},"basePackageRevision":{"type":"number","format":"double"},"articleMutation":{"$ref":"#/components/schemas/ArticlePackageMutation"}},"required":["operationId"],"type":"object","additionalProperties":false},"ArticleMediaUrlsResponse":{"properties":{"urls":{"items":{"properties":{"expiresIn":{"type":"number","format":"double"},"proxyUrl":{"type":"string"},"source":{"type":"string"}},"required":["expiresIn","proxyUrl","source"],"type":"object"},"type":"array"}},"required":["urls"],"type":"object","additionalProperties":false},"ArticleMediaUrlsRequest":{"properties":{"urls":{"items":{"type":"string"},"type":"array"}},"required":["urls"],"type":"object","additionalProperties":false},"SafeGistFile":{"properties":{"fileName":{"type":"string"},"language":{"type":"string"},"content":{"type":"string"}},"required":["fileName","content"],"type":"object","additionalProperties":false},"SafeGist":{"properties":{"source":{"type":"string"},"description":{"type":"string"},"files":{"items":{"$ref":"#/components/schemas/SafeGistFile"},"type":"array"}},"required":["source","files"],"type":"object","additionalProperties":false},"ArticleGistsResponse":{"properties":{"gists":{"items":{"$ref":"#/components/schemas/SafeGist"},"type":"array"}},"required":["gists"],"type":"object","additionalProperties":false},"ArticleGistsRequest":{"properties":{"urls":{"items":{"type":"string"},"type":"array"}},"required":["urls"],"type":"object","additionalProperties":false},"CreateArticleResponse":{"properties":{"articleId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"workspaceId":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"}},"required":["articleId","shortId","slug","workspaceId","title","message"],"type":"object","additionalProperties":false},"ArticleCoverImageSource":{"type":"string","enum":["generated","uploaded","external","markdown"]},"ArticleCoverImage":{"properties":{"url":{"type":"string"},"alt":{"type":"string"},"assetKey":{"type":"string"},"source":{"$ref":"#/components/schemas/ArticleCoverImageSource"},"generatedFromRunId":{"type":"string"},"updatedAt":{"type":"number","format":"double"},"updatedBy":{"type":"string"}},"required":["url","source","updatedAt"],"type":"object","additionalProperties":false},"ArticleSeoMetadata":{"properties":{"title":{"type":"string"},"description":{"type":"string"},"image":{"type":"string"},"keywords":{"items":{"type":"string"},"type":"array"}},"type":"object","additionalProperties":false},"CreateArticleRequest":{"properties":{"articleId":{"type":"string"},"title":{"type":"string"},"folderId":{"type":"string","nullable":true},"collaborative":{"type":"boolean"},"tags":{"items":{"type":"string"},"type":"array"},"coverImage":{"$ref":"#/components/schemas/ArticleCoverImage"},"seoMetadata":{"$ref":"#/components/schemas/ArticleSeoMetadata"},"articleSettings":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["articleId","title"],"type":"object","additionalProperties":false},"Record_string._updatedAt-number--updatedBy-string--fileName-string--hash_63_-string--hashAlg_63_-sha256--revision_63_-number--s3Key_63_-string__":{"properties":{},"additionalProperties":{"properties":{"s3Key":{"type":"string"},"revision":{"type":"number","format":"double"},"hashAlg":{"type":"string","enum":["sha256"],"nullable":false},"hash":{"type":"string"},"fileName":{"type":"string"},"updatedBy":{"type":"string"},"updatedAt":{"type":"number","format":"double"}},"required":["fileName","updatedBy","updatedAt"],"type":"object"},"type":"object","description":"Construct a type with a set of properties K of type T"},"GeneratedWordCountRange":{"properties":{"min":{"type":"number","format":"double"},"max":{"type":"number","format":"double"},"extractedAt":{"type":"number","format":"double"},"source":{"type":"string"}},"required":["min","max","extractedAt","source"],"type":"object","additionalProperties":false},"GeneratedKeywordSet":{"properties":{"values":{"items":{"type":"string"},"type":"array"},"extractedAt":{"type":"number","format":"double"},"source":{"type":"string"}},"required":["values","extractedAt","source"],"type":"object","additionalProperties":false},"GeneratedArtifactMeta":{"properties":{"recommendedWordCount":{"$ref":"#/components/schemas/GeneratedWordCountRange"},"targetKeywords":{"$ref":"#/components/schemas/GeneratedKeywordSet"}},"type":"object","additionalProperties":{}},"Article":{"properties":{"workspaceId":{"type":"string"},"articleId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"preview":{"type":"string"},"wordCount":{"type":"number","format":"double"},"username":{"type":"string"},"folderId":{"type":"string"},"collaborative":{"type":"boolean"},"isPinned":{"type":"boolean"},"isArchived":{"type":"boolean"},"tags":{"items":{"type":"string"},"type":"array","description":"Free-form article tags. Always sanitized before write (trimmed,\nde-duplicated case-insensitively, max 64 chars per tag, max 25 tags)."},"coverImage":{"$ref":"#/components/schemas/ArticleCoverImage"},"seoMetadata":{"$ref":"#/components/schemas/ArticleSeoMetadata"},"articleSettings":{"$ref":"#/components/schemas/Record_string.unknown_"},"markdownFiles":{"$ref":"#/components/schemas/Record_string._updatedAt-number--updatedBy-string--fileName-string--hash_63_-string--hashAlg_63_-sha256--revision_63_-number--s3Key_63_-string__","description":"Known markdown files for this article (multi-file support).\n\nThis is updated on:\n- user edit/sync flows that request upload URLs for article markdown files\n- agent writes (outline/research/content)\n\nIt is NOT a guarantee the object exists in S3 (upload may not have completed)."},"articleRevision":{"type":"number","format":"double"},"contentRevision":{"type":"number","format":"double"},"contentHash":{"type":"string"},"contentHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"contentS3Key":{"type":"string"},"contentUpdatedAt":{"type":"number","format":"double"},"reviewS3Key":{"type":"string"},"reviewHash":{"type":"string"},"reviewHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"reviewRevision":{"type":"number","format":"double"},"reviewUpdatedAt":{"type":"number","format":"double"},"reviewUpdatedBy":{"type":"string"},"reviewAuthorityVersion":{"type":"number","format":"double","description":"Server-only marker: package review authors were sanitized after cutover."},"packageRevision":{"type":"number","format":"double"},"publicPublicationId":{"type":"string","description":"Stable owner-side identity for the article's hosted public link.\n\nThis is the strongly consistent coordination point for first publication;\nthe public publication record remains the source of truth for rendered\ncontent and status."},"publicPublicationMode":{"type":"string","enum":["snapshot","live"]},"livePublicationId":{"type":"string"},"collaboration":{"properties":{"updatedAt":{"type":"number","format":"double"},"createdAt":{"type":"number","format":"double"},"lastReviewHash":{"type":"string"},"lastTargetHashes":{"$ref":"#/components/schemas/Record_string.string_"},"lastPackageRevision":{"type":"number","format":"double"},"lastCheckpointAt":{"type":"number","format":"double"},"lastStoredAt":{"type":"number","format":"double"},"updateCountSinceSnapshot":{"type":"number","format":"double"},"yjsRevision":{"type":"number","format":"double"},"lastRecoverySnapshotAt":{"type":"number","format":"double"},"recoverySnapshotByteLength":{"type":"number","format":"double"},"recoverySnapshotSha256":{"type":"string"},"recoverySnapshotEtag":{"type":"string"},"recoverySnapshotStorage":{"type":"string","enum":["collaboration-state-v1"],"nullable":false},"recoverySnapshotKey":{"type":"string"},"previousSnapshotExpiresAt":{"type":"number","format":"double"},"previousSnapshotByteLength":{"type":"number","format":"double"},"previousSnapshotSha256":{"type":"string"},"previousSnapshotEtag":{"type":"string"},"previousSnapshotStorage":{"type":"string","enum":["legacy-workspace-bucket","collaboration-state-v1"]},"previousSnapshotKey":{"type":"string"},"snapshotByteLength":{"type":"number","format":"double"},"snapshotSha256":{"type":"string"},"snapshotEtag":{"type":"string"},"snapshotStorage":{"type":"string","enum":["legacy-workspace-bucket","collaboration-state-v1"]},"snapshotKey":{"type":"string"},"roomEpoch":{"type":"number","format":"double","description":"Monotonic room generation. Incremented whenever the server rolls back to\na predecessor/recovery snapshot so stale clients cannot rejoin it."},"recordVersion":{"type":"number","format":"double"},"schemaVersion":{"type":"number","format":"double"},"enabled":{"type":"boolean"}},"required":["updatedAt","createdAt","updateCountSinceSnapshot","yjsRevision","schemaVersion","enabled"],"type":"object"},"agentGenerated":{"properties":{"content":{"properties":{"meta":{"$ref":"#/components/schemas/GeneratedArtifactMeta"},"latestAutoVersionNumber":{"type":"number","format":"double"},"latestAutoVersionId":{"type":"string"},"contentHash":{"type":"string"},"producedBy":{"properties":{"stepName":{"type":"string"},"runId":{"type":"string"}},"required":["stepName","runId"],"type":"object"},"updatedAt":{"type":"number","format":"double"}},"required":["producedBy","updatedAt"],"type":"object"},"research":{"properties":{"meta":{"$ref":"#/components/schemas/GeneratedArtifactMeta"},"producedBy":{"properties":{"stepName":{"type":"string"},"runId":{"type":"string"}},"required":["stepName","runId"],"type":"object"},"updatedAt":{"type":"number","format":"double"}},"required":["producedBy","updatedAt"],"type":"object"},"outline":{"properties":{"meta":{"$ref":"#/components/schemas/GeneratedArtifactMeta"},"producedBy":{"properties":{"stepName":{"type":"string"},"runId":{"type":"string"}},"required":["stepName","runId"],"type":"object"},"updatedAt":{"type":"number","format":"double"}},"required":["producedBy","updatedAt"],"type":"object"}},"type":"object","description":"CoWrite agent generation metadata.\n\nThe canonical content artifacts live as first-class files under:\n  workspaces/<workspaceId>/articles/<articleId>/(content.md|outline.md|research.md)\n\nThis metadata stores additive, structured agent-derived fields that can be\nconsumed by later workflow steps. The markdown files remain the canonical\ncontent artifacts, but this map is part of runtime workflow state."},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"lastEditedAt":{"type":"number","format":"double"}},"required":["workspaceId","articleId","title","preview","username","collaborative","isPinned","isArchived","createdAt","updatedAt","lastEditedAt"],"type":"object","additionalProperties":false},"ArticleWithContentResponse":{"properties":{"workspaceId":{"type":"string"},"articleId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"preview":{"type":"string"},"wordCount":{"type":"number","format":"double"},"username":{"type":"string"},"folderId":{"type":"string"},"collaborative":{"type":"boolean"},"isPinned":{"type":"boolean"},"isArchived":{"type":"boolean"},"tags":{"items":{"type":"string"},"type":"array","description":"Free-form article tags. Always sanitized before write (trimmed,\nde-duplicated case-insensitively, max 64 chars per tag, max 25 tags)."},"coverImage":{"$ref":"#/components/schemas/ArticleCoverImage"},"seoMetadata":{"$ref":"#/components/schemas/ArticleSeoMetadata"},"articleSettings":{"$ref":"#/components/schemas/Record_string.unknown_"},"markdownFiles":{"$ref":"#/components/schemas/Record_string._updatedAt-number--updatedBy-string--fileName-string--hash_63_-string--hashAlg_63_-sha256--revision_63_-number--s3Key_63_-string__","description":"Known markdown files for this article (multi-file support).\n\nThis is updated on:\n- user edit/sync flows that request upload URLs for article markdown files\n- agent writes (outline/research/content)\n\nIt is NOT a guarantee the object exists in S3 (upload may not have completed)."},"articleRevision":{"type":"number","format":"double"},"contentRevision":{"type":"number","format":"double"},"contentHash":{"type":"string"},"contentHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"contentS3Key":{"type":"string"},"contentUpdatedAt":{"type":"number","format":"double"},"reviewS3Key":{"type":"string"},"reviewHash":{"type":"string"},"reviewHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"reviewRevision":{"type":"number","format":"double"},"reviewUpdatedAt":{"type":"number","format":"double"},"reviewUpdatedBy":{"type":"string"},"reviewAuthorityVersion":{"type":"number","format":"double","description":"Server-only marker: package review authors were sanitized after cutover."},"packageRevision":{"type":"number","format":"double"},"publicPublicationId":{"type":"string","description":"Stable owner-side identity for the article's hosted public link.\n\nThis is the strongly consistent coordination point for first publication;\nthe public publication record remains the source of truth for rendered\ncontent and status."},"publicPublicationMode":{"type":"string","enum":["snapshot","live"]},"livePublicationId":{"type":"string"},"collaboration":{"properties":{"updatedAt":{"type":"number","format":"double"},"createdAt":{"type":"number","format":"double"},"lastReviewHash":{"type":"string"},"lastTargetHashes":{"$ref":"#/components/schemas/Record_string.string_"},"lastPackageRevision":{"type":"number","format":"double"},"lastCheckpointAt":{"type":"number","format":"double"},"lastStoredAt":{"type":"number","format":"double"},"updateCountSinceSnapshot":{"type":"number","format":"double"},"yjsRevision":{"type":"number","format":"double"},"lastRecoverySnapshotAt":{"type":"number","format":"double"},"recoverySnapshotByteLength":{"type":"number","format":"double"},"recoverySnapshotSha256":{"type":"string"},"recoverySnapshotEtag":{"type":"string"},"recoverySnapshotStorage":{"type":"string","enum":["collaboration-state-v1"],"nullable":false},"recoverySnapshotKey":{"type":"string"},"previousSnapshotExpiresAt":{"type":"number","format":"double"},"previousSnapshotByteLength":{"type":"number","format":"double"},"previousSnapshotSha256":{"type":"string"},"previousSnapshotEtag":{"type":"string"},"previousSnapshotStorage":{"type":"string","enum":["legacy-workspace-bucket","collaboration-state-v1"]},"previousSnapshotKey":{"type":"string"},"snapshotByteLength":{"type":"number","format":"double"},"snapshotSha256":{"type":"string"},"snapshotEtag":{"type":"string"},"snapshotStorage":{"type":"string","enum":["legacy-workspace-bucket","collaboration-state-v1"]},"snapshotKey":{"type":"string"},"roomEpoch":{"type":"number","format":"double","description":"Monotonic room generation. Incremented whenever the server rolls back to\na predecessor/recovery snapshot so stale clients cannot rejoin it."},"recordVersion":{"type":"number","format":"double"},"schemaVersion":{"type":"number","format":"double"},"enabled":{"type":"boolean"}},"required":["updatedAt","createdAt","updateCountSinceSnapshot","yjsRevision","schemaVersion","enabled"],"type":"object"},"agentGenerated":{"properties":{"content":{"properties":{"meta":{"$ref":"#/components/schemas/GeneratedArtifactMeta"},"latestAutoVersionNumber":{"type":"number","format":"double"},"latestAutoVersionId":{"type":"string"},"contentHash":{"type":"string"},"producedBy":{"properties":{"stepName":{"type":"string"},"runId":{"type":"string"}},"required":["stepName","runId"],"type":"object"},"updatedAt":{"type":"number","format":"double"}},"required":["producedBy","updatedAt"],"type":"object"},"research":{"properties":{"meta":{"$ref":"#/components/schemas/GeneratedArtifactMeta"},"producedBy":{"properties":{"stepName":{"type":"string"},"runId":{"type":"string"}},"required":["stepName","runId"],"type":"object"},"updatedAt":{"type":"number","format":"double"}},"required":["producedBy","updatedAt"],"type":"object"},"outline":{"properties":{"meta":{"$ref":"#/components/schemas/GeneratedArtifactMeta"},"producedBy":{"properties":{"stepName":{"type":"string"},"runId":{"type":"string"}},"required":["stepName","runId"],"type":"object"},"updatedAt":{"type":"number","format":"double"}},"required":["producedBy","updatedAt"],"type":"object"}},"type":"object","description":"CoWrite agent generation metadata.\n\nThe canonical content artifacts live as first-class files under:\n  workspaces/<workspaceId>/articles/<articleId>/(content.md|outline.md|research.md)\n\nThis metadata stores additive, structured agent-derived fields that can be\nconsumed by later workflow steps. The markdown files remain the canonical\ncontent artifacts, but this map is part of runtime workflow state."},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"lastEditedAt":{"type":"number","format":"double"},"content":{"type":"string"},"userPermission":{"type":"string","enum":["owner","workspace_member","write","read"]}},"required":["workspaceId","articleId","title","preview","username","collaborative","isPinned","isArchived","createdAt","updatedAt","lastEditedAt","content","userPermission"],"type":"object","additionalProperties":false},"DocumentThemeId":{"type":"string","enum":["paper","default","typewriter","gfm"]},"DocumentStyle":{"allOf":[{"properties":{"theme":{"$ref":"#/components/schemas/DocumentThemeId"}},"required":["theme"],"type":"object"},{"$ref":"#/components/schemas/Record_string.unknown_"}]},"ArticlePresentationResponse":{"properties":{"documentStyle":{"$ref":"#/components/schemas/DocumentStyle"},"codeSnippetWrapLines":{"type":"boolean"},"codeSnippetShowLineNumbers":{"type":"boolean"},"autoEmbedGists":{"type":"boolean","description":"Whether plain gist links should render as embeds under this theme."},"textDirection":{"type":"string","enum":["auto","ltr","rtl"]},"userPermission":{"type":"string","enum":["owner","workspace_member","write","read"]}},"required":["documentStyle","codeSnippetWrapLines","codeSnippetShowLineNumbers","autoEmbedGists","textDirection","userPermission"],"type":"object","additionalProperties":false},"ArticleMessageResponse":{"properties":{"message":{"type":"string"},"autoVersionCreated":{"type":"boolean"},"versionId":{"type":"string"},"versionNumber":{"type":"number","format":"double"},"articleRevision":{"type":"number","format":"double"},"contentRevision":{"type":"number","format":"double"},"contentHash":{"type":"string"},"contentHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"contentS3Key":{"type":"string"},"contentUpdatedAt":{"type":"number","format":"double"},"reviewReconciliation":{"$ref":"#/components/schemas/ReviewReconciliationSummary"},"review":{"$ref":"#/components/schemas/ReviewDocument"}},"required":["message"],"type":"object","additionalProperties":false},"UpdateArticleRequest":{"properties":{"title":{"type":"string"},"preview":{"type":"string"},"wordCount":{"type":"number","format":"double"},"folderId":{"type":"string","nullable":true},"isPinned":{"type":"boolean"},"isArchived":{"type":"boolean"},"tags":{"items":{"type":"string"},"type":"array"},"coverImage":{"allOf":[{"$ref":"#/components/schemas/ArticleCoverImage"}],"nullable":true},"seoMetadata":{"allOf":[{"$ref":"#/components/schemas/ArticleSeoMetadata"}],"nullable":true},"articleSettings":{"$ref":"#/components/schemas/Record_string.unknown_"},"contentHash":{"type":"string"},"baseArticleRevision":{"type":"number","format":"double"}},"type":"object","additionalProperties":false},"ArticleContentUploadUrlResponse":{"properties":{"uploadUrl":{"type":"string"},"uploadId":{"type":"string"},"expiresIn":{"type":"number","format":"double"}},"required":["uploadUrl","expiresIn"],"type":"object","additionalProperties":false},"ArticleContentUploadUrlRequest":{"properties":{"baseContentRevision":{"type":"number","format":"double"},"baseContentHash":{"type":"string"},"contentHash":{"type":"string"},"contentLength":{"type":"number","format":"double"}},"type":"object","additionalProperties":false},"ArticleContentCommitRequest":{"properties":{"uploadId":{"type":"string"},"baseContentRevision":{"type":"number","format":"double"},"baseContentHash":{"type":"string"},"contentHash":{"type":"string"},"title":{"type":"string"},"preview":{"type":"string"},"wordCount":{"type":"number","format":"double"},"folderId":{"type":"string","nullable":true},"isPinned":{"type":"boolean"},"isArchived":{"type":"boolean"},"tags":{"items":{"type":"string"},"type":"array"},"coverImage":{"allOf":[{"$ref":"#/components/schemas/ArticleCoverImage"}],"nullable":true},"articleSettings":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["uploadId","baseContentRevision","contentHash"],"type":"object","additionalProperties":false},"ArticleMarkdownFileResponse":{"properties":{"articleId":{"type":"string"},"fileName":{"type":"string"},"content":{"type":"string"}},"required":["articleId","fileName","content"],"type":"object","additionalProperties":false},"ArticleMarkdownUploadUrlRequest":{"properties":{"fileName":{"type":"string"}},"type":"object","additionalProperties":false},"AssetUploadUrlResponse":{"properties":{"uploadUrl":{"type":"string"},"fileName":{"type":"string"},"expiresIn":{"type":"number","format":"double"}},"required":["uploadUrl","fileName","expiresIn"],"type":"object","additionalProperties":false},"AssetUploadUrlRequest":{"properties":{"fileName":{"type":"string"},"contentType":{"type":"string"}},"required":["fileName","contentType"],"type":"object","additionalProperties":false},"AssetListResponse":{"properties":{"assets":{"items":{"properties":{"lastModified":{"type":"string","format":"date-time"},"size":{"type":"number","format":"double"},"fileName":{"type":"string"}},"required":["lastModified","size","fileName"],"type":"object"},"type":"array"}},"required":["assets"],"type":"object","additionalProperties":false},"AssetDownloadUrlResponse":{"properties":{"downloadUrl":{"type":"string"},"expiresIn":{"type":"number","format":"double"}},"required":["downloadUrl","expiresIn"],"type":"object","additionalProperties":false},"BatchAssetDownloadUrlsResponse":{"properties":{"assets":{"items":{"properties":{"expiresIn":{"type":"number","format":"double"},"downloadUrl":{"type":"string"},"fileName":{"type":"string"}},"required":["expiresIn","downloadUrl","fileName"],"type":"object"},"type":"array"}},"required":["assets"],"type":"object","additionalProperties":false},"BatchAssetDownloadUrlsRequest":{"properties":{"fileNames":{"items":{"type":"string"},"type":"array"}},"type":"object","additionalProperties":false},"SharedArticleResponse":{"properties":{"workspaceId":{"type":"string"},"articleId":{"type":"string"},"shortId":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"preview":{"type":"string"},"wordCount":{"type":"number","format":"double"},"username":{"type":"string"},"folderId":{"type":"string"},"collaborative":{"type":"boolean"},"isPinned":{"type":"boolean"},"isArchived":{"type":"boolean"},"tags":{"items":{"type":"string"},"type":"array","description":"Free-form article tags. Always sanitized before write (trimmed,\nde-duplicated case-insensitively, max 64 chars per tag, max 25 tags)."},"coverImage":{"$ref":"#/components/schemas/ArticleCoverImage"},"seoMetadata":{"$ref":"#/components/schemas/ArticleSeoMetadata"},"articleSettings":{"$ref":"#/components/schemas/Record_string.unknown_"},"markdownFiles":{"$ref":"#/components/schemas/Record_string._updatedAt-number--updatedBy-string--fileName-string--hash_63_-string--hashAlg_63_-sha256--revision_63_-number--s3Key_63_-string__","description":"Known markdown files for this article (multi-file support).\n\nThis is updated on:\n- user edit/sync flows that request upload URLs for article markdown files\n- agent writes (outline/research/content)\n\nIt is NOT a guarantee the object exists in S3 (upload may not have completed)."},"articleRevision":{"type":"number","format":"double"},"contentRevision":{"type":"number","format":"double"},"contentHash":{"type":"string"},"contentHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"contentS3Key":{"type":"string"},"contentUpdatedAt":{"type":"number","format":"double"},"reviewS3Key":{"type":"string"},"reviewHash":{"type":"string"},"reviewHashAlg":{"type":"string","enum":["sha256"],"nullable":false},"reviewRevision":{"type":"number","format":"double"},"reviewUpdatedAt":{"type":"number","format":"double"},"reviewUpdatedBy":{"type":"string"},"reviewAuthorityVersion":{"type":"number","format":"double","description":"Server-only marker: package review authors were sanitized after cutover."},"packageRevision":{"type":"number","format":"double"},"publicPublicationId":{"type":"string","description":"Stable owner-side identity for the article's hosted public link.\n\nThis is the strongly consistent coordination point for first publication;\nthe public publication record remains the source of truth for rendered\ncontent and status."},"publicPublicationMode":{"type":"string","enum":["snapshot","live"]},"livePublicationId":{"type":"string"},"collaboration":{"properties":{"updatedAt":{"type":"number","format":"double"},"createdAt":{"type":"number","format":"double"},"lastReviewHash":{"type":"string"},"lastTargetHashes":{"$ref":"#/components/schemas/Record_string.string_"},"lastPackageRevision":{"type":"number","format":"double"},"lastCheckpointAt":{"type":"number","format":"double"},"lastStoredAt":{"type":"number","format":"double"},"updateCountSinceSnapshot":{"type":"number","format":"double"},"yjsRevision":{"type":"number","format":"double"},"lastRecoverySnapshotAt":{"type":"number","format":"double"},"recoverySnapshotByteLength":{"type":"number","format":"double"},"recoverySnapshotSha256":{"type":"string"},"recoverySnapshotEtag":{"type":"string"},"recoverySnapshotStorage":{"type":"string","enum":["collaboration-state-v1"],"nullable":false},"recoverySnapshotKey":{"type":"string"},"previousSnapshotExpiresAt":{"type":"number","format":"double"},"previousSnapshotByteLength":{"type":"number","format":"double"},"previousSnapshotSha256":{"type":"string"},"previousSnapshotEtag":{"type":"string"},"previousSnapshotStorage":{"type":"string","enum":["legacy-workspace-bucket","collaboration-state-v1"]},"previousSnapshotKey":{"type":"string"},"snapshotByteLength":{"type":"number","format":"double"},"snapshotSha256":{"type":"string"},"snapshotEtag":{"type":"string"},"snapshotStorage":{"type":"string","enum":["legacy-workspace-bucket","collaboration-state-v1"]},"snapshotKey":{"type":"string"},"roomEpoch":{"type":"number","format":"double","description":"Monotonic room generation. Incremented whenever the server rolls back to\na predecessor/recovery snapshot so stale clients cannot rejoin it."},"recordVersion":{"type":"number","format":"double"},"schemaVersion":{"type":"number","format":"double"},"enabled":{"type":"boolean"}},"required":["updatedAt","createdAt","updateCountSinceSnapshot","yjsRevision","schemaVersion","enabled"],"type":"object"},"agentGenerated":{"properties":{"content":{"properties":{"meta":{"$ref":"#/components/schemas/GeneratedArtifactMeta"},"latestAutoVersionNumber":{"type":"number","format":"double"},"latestAutoVersionId":{"type":"string"},"contentHash":{"type":"string"},"producedBy":{"properties":{"stepName":{"type":"string"},"runId":{"type":"string"}},"required":["stepName","runId"],"type":"object"},"updatedAt":{"type":"number","format":"double"}},"required":["producedBy","updatedAt"],"type":"object"},"research":{"properties":{"meta":{"$ref":"#/components/schemas/GeneratedArtifactMeta"},"producedBy":{"properties":{"stepName":{"type":"string"},"runId":{"type":"string"}},"required":["stepName","runId"],"type":"object"},"updatedAt":{"type":"number","format":"double"}},"required":["producedBy","updatedAt"],"type":"object"},"outline":{"properties":{"meta":{"$ref":"#/components/schemas/GeneratedArtifactMeta"},"producedBy":{"properties":{"stepName":{"type":"string"},"runId":{"type":"string"}},"required":["stepName","runId"],"type":"object"},"updatedAt":{"type":"number","format":"double"}},"required":["producedBy","updatedAt"],"type":"object"}},"type":"object","description":"CoWrite agent generation metadata.\n\nThe canonical content artifacts live as first-class files under:\n  workspaces/<workspaceId>/articles/<articleId>/(content.md|outline.md|research.md)\n\nThis metadata stores additive, structured agent-derived fields that can be\nconsumed by later workflow steps. The markdown files remain the canonical\ncontent artifacts, but this map is part of runtime workflow state."},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"lastEditedAt":{"type":"number","format":"double"},"userPermission":{"type":"string","enum":["read","write"]}},"required":["workspaceId","articleId","title","preview","username","collaborative","isPinned","isArchived","createdAt","updatedAt","lastEditedAt","userPermission"],"type":"object","additionalProperties":false},"ChatResponse":{"properties":{"conversationId":{"type":"string"},"message":{"$ref":"#/components/schemas/ChatMessage"},"metadata":{"properties":{"model":{"type":"string"},"tokensUsed":{"type":"number","format":"double"}},"required":["model","tokensUsed"],"type":"object"}},"required":["conversationId","message"],"type":"object","additionalProperties":false},"ProcessOptions":{"properties":{"provider":{"type":"string"},"modelName":{"type":"string"},"operation":{"type":"string"},"maxTokens":{"type":"number","format":"double"},"temperature":{"type":"number","format":"double"},"styleProfileId":{"type":"string"},"enableTools":{"type":"boolean"}},"type":"object","additionalProperties":false},"ArticleChatRequestBody":{"properties":{"conversationId":{"type":"string"},"message":{"$ref":"#/components/schemas/ChatMessage"},"context":{"properties":{"cursorPosition":{"type":"number","format":"double"},"selectedText":{"type":"string"}},"type":"object"},"streaming":{"type":"boolean"},"options":{"$ref":"#/components/schemas/ProcessOptions"}},"required":["message"],"type":"object","additionalProperties":false},"ConversationsResponse":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/ConversationSummary"},"type":"array"}},"required":["conversations"],"type":"object","additionalProperties":false},"ArcadeConfirmResponse":{"properties":{"auth_id":{"type":"string","description":"Arcade's auth ID for this confirmed flow"},"next_uri":{"type":"string","description":"URL the frontend should redirect to so the OAuth grant can proceed"}},"required":["auth_id"],"type":"object","additionalProperties":false},"ArcadeConfirmRequest":{"properties":{"flow_id":{"type":"string","description":"The flow_id query parameter Arcade sent to the custom verifier URL"}},"required":["flow_id"],"type":"object","additionalProperties":false},"CreateApiKeyResponse":{"properties":{"keyId":{"type":"string"},"key":{"type":"string"},"keyPrefix":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["keyId","key","keyPrefix","name","createdAt"],"type":"object","additionalProperties":false},"CreateApiKeyRequest":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"expiresInDays":{"type":"number","format":"double"},"scopes":{"items":{"type":"string"},"type":"array"}},"required":["name"],"type":"object","additionalProperties":false},"ApiKeyListItem":{"properties":{"keyId":{"type":"string"},"keyPrefix":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string"},"expiresAt":{"type":"string"},"usageCount":{"type":"number","format":"double"}},"required":["keyId","keyPrefix","name","status","createdAt","usageCount"],"type":"object","additionalProperties":false},"ApiKeyListResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/ApiKeyListItem"},"type":"array"}},"required":["keys"],"type":"object","additionalProperties":false},"ApiKeyDetails":{"properties":{"keyId":{"type":"string"},"keyPrefix":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string"},"expiresAt":{"type":"string"},"usageCount":{"type":"number","format":"double"},"scopes":{"items":{"type":"string"},"type":"array"}},"required":["keyId","keyPrefix","name","status","createdAt","usageCount"],"type":"object","additionalProperties":false},"RevokeApiKeyResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"DeleteApiKeyResponse":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object","additionalProperties":false},"AgentTaskRouting":{"description":"Dispatcher decision when `workflowId` was resolved by `routeAgentTask`\nrather than supplied explicitly by the caller. See\ndocs/tech-spec/intent-routing-north-star.md §5.2/§5.4.","properties":{"intentId":{"type":"string"},"workflowId":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"rationale":{"type":"string"},"clarifyingQuestion":{"type":"string"}},"required":["intentId","workflowId","confidence","rationale"],"type":"object","additionalProperties":false},"CreateAgentRunResponse":{"description":"Response returned when a new agent run is created (202 Accepted).","properties":{"runId":{"type":"string"},"threadId":{"type":"string"},"conversationId":{"type":"string"},"status":{"type":"string","enum":["queued"],"nullable":false},"routing":{"$ref":"#/components/schemas/AgentTaskRouting","description":"Echoed back when workflowId was omitted and resolved by the dispatcher."}},"required":["runId","threadId","conversationId","status"],"type":"object","additionalProperties":false},"CreateAgentRunRequest":{"description":"Request body for creating a new agent run.\nExported for frontend consumption.","properties":{"workspaceId":{"type":"string"},"articleId":{"type":"string","description":"Article-scoped runs require articleId (v1 writing workflows)."},"workflowId":{"type":"string","description":"\"standard_article\", \"research\", \"outline\", \"draft\", or a custom workflow path.\nOmit to have the dispatcher (`routeAgentTask`) resolve it from `instructions`.\nProgrammatic callers (CoWrite autorun, quick actions) should keep passing this\nexplicitly — routing only kicks in when it's absent."},"conversationId":{"type":"string","description":"Optional: link run to an existing conversation thread; otherwise backend creates one."},"scopeType":{"type":"string","enum":["article","workspace","folder"],"description":"Scope for the run. Defaults to 'article' when articleId is provided."},"scopeId":{"type":"string"},"runType":{"type":"string","description":"High-level run type override (e.g. 'topic_research'). Defaults to workflow name."},"styleProfileId":{"type":"string"},"instructions":{"type":"string"},"nodeConfig":{"$ref":"#/components/schemas/Record_string.any_"}},"required":["workspaceId"],"type":"object","additionalProperties":false},"RouteAgentTaskResponse":{"description":"Preview of what `POST /agent-runs` would resolve `workflowId` to if called\nwith the same `instructions` and no explicit `workflowId`.","properties":{"intentId":{"type":"string"},"workflowId":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"rationale":{"type":"string"},"clarifyingQuestion":{"type":"string"},"title":{"type":"string","description":"Router-facing title for the resolved intent, e.g. \"Write a new article\"."},"costClass":{"type":"string","enum":["cheap","expensive"],"description":"Drives propose-then-run (expensive) vs auto-start (cheap) UX."}},"required":["intentId","workflowId","confidence","rationale","title","costClass"],"type":"object","additionalProperties":false},"RouteAgentTaskRequest":{"description":"Request body for previewing a dispatcher routing decision without starting a run\n(the \"plan card\" propose-then-run flow — see intent-routing-north-star.md §5.3).","properties":{"workspaceId":{"type":"string"},"articleId":{"type":"string"},"folderId":{"type":"string"},"instructions":{"type":"string"}},"required":["workspaceId","instructions"],"type":"object","additionalProperties":false},"RunStatus":{"type":"string","enum":["queued","running","paused","waiting_for_authorization","completed","failed","cancelled"],"description":"String literal union of all valid run statuses.\nMirrors AgentRunStatus enum values for frontend consumption."},"StepCitation":{"description":"A single cited source surfaced with a step, trimmed for API transport.\nDeliberately excludes raw tool-call evidence blobs stored in step metadata.","properties":{"sourceType":{"type":"string"},"url":{"type":"string","description":"Resolved URL for web / link-validation citations."},"resourceUri":{"type":"string","description":"Resource pointer for citations that came from workspace resources."},"resourceTitle":{"type":"string"},"resourceId":{"type":"string"},"anchorText":{"type":"string","description":"Markdown anchor text for link-validation citations."},"query":{"type":"string","description":"Search query for web-search citations."},"status":{"type":"number","format":"double","description":"HTTP status observed while validating the URL, when one was reached."},"valid":{"type":"boolean"},"unverified":{"type":"boolean","description":"True when the URL could not be reached at all (timeout, DNS, network error)."},"reason":{"type":"string"},"reasonCode":{"type":"string","description":"Machine-readable rejection code for citations that failed validation\n(e.g. `resource_not_found`). Absent for accepted citations and for records\nwritten before reject detail was persisted."},"confidence":{"type":"number","format":"double"},"excerpt":{"type":"string","description":"Short excerpt; truncated so responses never carry full tool output."},"timestamp":{"type":"number","format":"double"}},"required":["sourceType"],"type":"object","additionalProperties":false},"StepCitationSummary":{"description":"Compact citation provenance for a step, derived from the step's stored metadata.\nAbsent when the step recorded no citation data.","properties":{"total":{"type":"number","format":"double"},"valid":{"type":"number","format":"double"},"invalid":{"type":"number","format":"double"},"unverified":{"type":"number","format":"double","description":"Subset of `invalid` that failed because the URL was unreachable."},"extractedAt":{"type":"number","format":"double"},"truncated":{"type":"boolean","description":"True when `citations` was capped and does not list every recorded source.\nThe cap keeps failed rows first, so a truncated summary still explains its\n`invalid` count; the rows it drops are accepted ones."},"rejectedOmitted":{"type":"number","format":"double","description":"Rejected citations counted in `invalid` that have no detail row because the\nper-step reject cap was hit. Absent when every reject has a row."},"citations":{"items":{"$ref":"#/components/schemas/StepCitation"},"type":"array"}},"required":["total","valid","invalid","unverified","citations"],"type":"object","additionalProperties":false},"StepImageTokenUsage":{"description":"Token counts for one image-model call, as the provider reports them.\n\nMirrors OpenAI's Images API `usage` block (`input_tokens`, `output_tokens`,\n`input_tokens_details.{text_tokens,image_tokens}`). Every field is optional:\nproviders report varying subsets, and an older run record has none of this.","properties":{"inputTokens":{"type":"number","format":"double"},"outputTokens":{"type":"number","format":"double"},"inputTokensDetails":{"properties":{"imageTokens":{"type":"number","format":"double"},"textTokens":{"type":"number","format":"double"}},"type":"object"}},"type":"object","additionalProperties":false},"StepImageGeneration":{"description":"One image-model call recorded for a step.\n\nImage models bill per generated image, tiered by quality and size, so the\nrequest parameters that move the price are recorded alongside the count.\nDeterministic rendering (Mermaid, Vega-Lite fallbacks) calls no paid model\nand is deliberately not represented here.","properties":{"model":{"type":"string","description":"Bare image-model name (e.g. `gpt-image-2`)."},"provider":{"type":"string"},"size":{"type":"string"},"quality":{"type":"string"},"count":{"type":"number","format":"double","description":"Images this call returned."},"usage":{"$ref":"#/components/schemas/StepImageTokenUsage","description":"Token counts the provider billed the call on, when it reports them (GPT\nImage does; Google's image models do not).\n\nIts presence is what turns an image cost from a floor into the whole\ncharge: the per-image price covers the output side only, while these cover\ntext input, image input and output. A consumer that prices from these must\nnot also apply the per-image price to the same call."}},"required":["model","count"],"type":"object","additionalProperties":false},"StepImageUsage":{"description":"Aggregate image generation recorded for a single step.\n\n`complete` is false when a call returned images without identifying its\nmodel, so cost is reported as unknown rather than understated — the same\ncontract the token counts follow.","properties":{"imageCount":{"type":"number","format":"double","description":"Total images generated across every call."},"complete":{"type":"boolean","description":"True when every call reported the model it ran on."},"calls":{"items":{"$ref":"#/components/schemas/StepImageGeneration"},"type":"array","description":"Per-call detail, needed because price varies with quality and size."}},"required":["imageCount","complete","calls"],"type":"object","additionalProperties":false},"StepTokenUsage":{"description":"Aggregate model token usage recorded for a single step, summed across every\nassistant response the step produced (tool-loop turns, repair re-asks,\nsection-wise drafting).\n\n`complete` is false when at least one response omitted usage metadata; the\ntoken counts are then withheld so consumers report cost as unknown rather\nthan estimating from a partial total.","properties":{"inputTokens":{"type":"number","format":"double","description":"Total prompt tokens. Absent when `complete` is false."},"outputTokens":{"type":"number","format":"double","description":"Total completion tokens. Absent when `complete` is false."},"complete":{"type":"boolean","description":"True when every assistant response reported usage metadata."},"responseCount":{"type":"number","format":"double","description":"Number of assistant responses aggregated."},"model":{"type":"string","description":"Model spec that ran the step (e.g. `openai:gpt-5.4-mini`)."},"imageUsage":{"$ref":"#/components/schemas/StepImageUsage","description":"Image-model calls the step made. Absent when it generated no images."}},"required":["complete","responseCount"],"type":"object","additionalProperties":false},"StepSummary":{"description":"Summary of a single step within an agent run, returned in API responses.","properties":{"stepId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"startedAt":{"type":"number","format":"double"},"endedAt":{"type":"number","format":"double"},"durationMs":{"type":"number","format":"double"},"error":{"type":"string"},"citationSummary":{"$ref":"#/components/schemas/StepCitationSummary","description":"Citation provenance for this step; omitted when the step recorded none."},"tokenUsage":{"$ref":"#/components/schemas/StepTokenUsage","description":"Model token usage for this step; omitted when the step ran no model."}},"required":["stepId","name","status","startedAt"],"type":"object","additionalProperties":false},"AgentRunQualityOutcome":{"type":"string","enum":["succeeded","insufficient_quality"]},"ContentProjectGenerationSummary":{"properties":{"qualityOutcome":{"$ref":"#/components/schemas/AgentRunQualityOutcome"},"generationQualityTier":{"$ref":"#/components/schemas/GenerationQualityTier"},"createdCount":{"type":"number","format":"double"},"selectedCount":{"type":"number","format":"double"},"archivedCount":{"type":"number","format":"double"},"dedupedCount":{"type":"number","format":"double"},"evidenceDroppedCount":{"type":"number","format":"double"},"keywordMetricsFetchedCount":{"type":"number","format":"double"},"serpBudgetExhausted":{"type":"boolean"},"minimumViableSelectedCount":{"type":"number","format":"double"},"repairedCandidateCount":{"type":"number","format":"double"},"droppedCandidateCount":{"type":"number","format":"double"},"validatedSourceCount":{"type":"number","format":"double"},"rejectedSourceCount":{"type":"number","format":"double"},"weakEvidenceCount":{"type":"number","format":"double"},"adequateEvidenceCount":{"type":"number","format":"double"},"strongEvidenceCount":{"type":"number","format":"double"},"evidenceBackedSelectedCount":{"type":"number","format":"double"},"selectedWithTwoPlusSourcesCount":{"type":"number","format":"double"}},"required":["qualityOutcome","generationQualityTier","createdCount","selectedCount","archivedCount","dedupedCount","minimumViableSelectedCount"],"type":"object","additionalProperties":false},"AgentRunFailureCategory":{"type":"string","enum":["retryable","needs_attention","partially_complete","terminal"]},"AgentRunUserActionRequired":{"type":"string","enum":["none","fix_inputs","reconnect","upgrade","contact_support"]},"AgentRunRecoveryStrategy":{"type":"string","enum":["retry_failed_step","resume_from_last_checkpoint","restart_from_artifacts","restart_fresh"]},"AgentRunRecoveryOption":{"properties":{"strategy":{"$ref":"#/components/schemas/AgentRunRecoveryStrategy"},"label":{"type":"string"},"description":{"type":"string"},"destructive":{"type":"boolean"}},"required":["strategy","label","description"],"type":"object","additionalProperties":false},"AgentRunRecoveryState":{"properties":{"failedStep":{"type":"string"},"lastGoodStep":{"type":"string"},"errorCode":{"type":"string"},"category":{"$ref":"#/components/schemas/AgentRunFailureCategory"},"retryable":{"type":"boolean"},"userActionRequired":{"$ref":"#/components/schemas/AgentRunUserActionRequired"},"diagnosticId":{"type":"string"},"recoveryOptions":{"items":{"$ref":"#/components/schemas/AgentRunRecoveryOption"},"type":"array"}},"required":["category","retryable","userActionRequired","diagnosticId","recoveryOptions"],"type":"object","additionalProperties":false},"AgentRunStatusResponse":{"description":"Full status response for an agent run, including step summaries.\nExported for frontend consumption.","properties":{"runId":{"type":"string"},"status":{"$ref":"#/components/schemas/RunStatus"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"workspaceId":{"type":"string"},"articleId":{"type":"string"},"folderId":{"type":"string"},"conversationId":{"type":"string"},"scopeType":{"type":"string","enum":["article","workspace","folder"]},"scopeId":{"type":"string"},"currentStep":{"type":"string"},"pausedOnStep":{"type":"string","description":"Present only when `status === 'paused'`."},"pendingAuthorizationTool":{"type":"string","description":"Present only when `status === 'waiting_for_authorization'`."},"pendingAuthorizationProvider":{"type":"string","description":"Present only when `status === 'waiting_for_authorization'`."},"pendingAuthorizationProviderLabel":{"type":"string","description":"Present only when `status === 'waiting_for_authorization'`."},"pendingAuthorizationId":{"type":"string","description":"Present only when `status === 'waiting_for_authorization'`."},"pendingAuthorizationUrl":{"type":"string","description":"Present only when `status === 'waiting_for_authorization'`."},"authorizationPausedAt":{"type":"number","format":"double","description":"Present only when `status === 'waiting_for_authorization'`. Unix ms."},"authorizationTimeoutAt":{"type":"number","format":"double","description":"Present only when `status === 'waiting_for_authorization'`. Unix ms."},"completedSteps":{"type":"number","format":"double"},"totalSteps":{"type":"number","format":"double"},"steps":{"items":{"$ref":"#/components/schemas/StepSummary"},"type":"array"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"completedAt":{"type":"number","format":"double"},"qualityOutcome":{"$ref":"#/components/schemas/AgentRunQualityOutcome"},"generationSummary":{"$ref":"#/components/schemas/ContentProjectGenerationSummary"},"reviewReconciliation":{"$ref":"#/components/schemas/ReviewReconciliationSummary"},"errorMessage":{"type":"string"},"recovery":{"$ref":"#/components/schemas/AgentRunRecoveryState"},"routing":{"$ref":"#/components/schemas/AgentTaskRouting"}},"required":["runId","status","workflowId","workflowName","completedSteps","totalSteps","steps","createdAt","updatedAt"],"type":"object","additionalProperties":false},"ResumeAgentRunRequest":{"description":"Request body for resuming a paused agent run.","properties":{"approved":{"type":"boolean","description":"Whether the user approved the next step (true) or is modifying before continuing."},"approvalOutcome":{"type":"string","enum":["approved","revision_requested"],"description":"Privacy-safe classification for a continuing approval response."},"modifications":{"$ref":"#/components/schemas/Record_string.any_","description":"Optional state modifications to apply before resuming"}},"type":"object","additionalProperties":false},"RetryAgentRunRequest":{"properties":{"strategy":{"$ref":"#/components/schemas/AgentRunRecoveryStrategy","description":"Optional. When omitted, the backend chooses the safest available recovery strategy."},"modifications":{"$ref":"#/components/schemas/Record_string.any_"}},"type":"object","additionalProperties":false},"AgentRunArtifactResponse":{"description":"Artifact content response for a completed agent run step.","properties":{"runId":{"type":"string"},"stepName":{"type":"string"},"content":{"type":"string"},"wordCount":{"type":"number","format":"double"},"metadata":{"$ref":"#/components/schemas/Record_string.any_"}},"required":["runId","stepName","content","wordCount"],"type":"object","additionalProperties":false},"AgentRunListResponse":{"description":"Paginated list response for agent runs.\n\nPagination is cursor-based: when `nextToken` is present the caller should\npass it back as the `nextToken` query parameter to retrieve the next page.\nThe token is an opaque, base64-encoded DynamoDB `LastEvaluatedKey` value;\nits format is implementation-specific and must not be parsed by clients.","properties":{"runs":{"items":{"$ref":"#/components/schemas/AgentRunStatusResponse"},"type":"array"},"total":{"type":"number","format":"double"},"nextToken":{"type":"string","description":"Present when additional pages are available."}},"required":["runs","total"],"type":"object","additionalProperties":false},"AgentClientAnalyticsEventName":{"type":"string","enum":["agent_session_started","agent_session_completed","mcp_tool_started","mcp_tool_completed"]},"AgentClientAnalyticsTransport":{"type":"string","enum":["rest","stdio","websocket"]},"AgentClientAnalyticsResult":{"type":"string","enum":["started","success","failure","disconnected"]},"AgentAnalyticsIngestRequest":{"properties":{"event":{"$ref":"#/components/schemas/AgentClientAnalyticsEventName"},"operation_id":{"type":"string"},"transport":{"$ref":"#/components/schemas/AgentClientAnalyticsTransport"},"tool_name":{"type":"string"},"duration_ms":{"type":"number","format":"double"},"retry_count":{"type":"number","format":"double"},"result":{"$ref":"#/components/schemas/AgentClientAnalyticsResult"},"failure_reason":{"type":"string"}},"required":["event","operation_id","result"],"type":"object","additionalProperties":false},"AgentActivityEventType":{"type":"string","enum":["review.commands","article.created","article.updated","version.created","version.restored","publish.public","publish.external"],"description":"Agent activity feed.\n\nA durable, append-only record of the writes an AGENT (API key, OAuth client\nor hosted-MCP assertion) performed on a user's documents. Human web-session\nactions are never recorded. Events carry ids, titles and counts only — never\ndocument content."},"AgentActivityActor":{"properties":{"kind":{"type":"string","enum":["agent"],"nullable":false},"agentName":{"type":"string"},"clientId":{"type":"string"},"credentialId":{"type":"string"},"credentialKind":{"type":"string"}},"required":["kind","agentName","credentialKind"],"type":"object","additionalProperties":false},"AgentActivityEvent":{"properties":{"eventId":{"type":"string"},"eventAt":{"type":"string"},"eventType":{"$ref":"#/components/schemas/AgentActivityEventType"},"actor":{"$ref":"#/components/schemas/AgentActivityActor"},"articleId":{"type":"string"},"workspaceId":{"type":"string"},"title":{"type":"string"},"count":{"type":"number","format":"double"},"metadata":{"$ref":"#/components/schemas/Record_string.unknown_"}},"required":["eventId","eventAt","eventType","actor","articleId"],"type":"object","additionalProperties":false},"ListAgentActivityResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/AgentActivityEvent"},"type":"array"},"nextCursor":{"type":"string"}},"required":["events"],"type":"object","additionalProperties":false},"AICredentialProvider":{"type":"string","enum":["openai","anthropic","xai","gemini"]},"AICredentialStatus":{"type":"string","enum":["active","invalid","needs_validation","revoked"]},"AICredentialSummary":{"properties":{"credentialId":{"type":"string"},"provider":{"$ref":"#/components/schemas/AICredentialProvider"},"displayName":{"type":"string"},"status":{"$ref":"#/components/schemas/AICredentialStatus"},"keyPrefix":{"type":"string"},"createdAt":{"type":"number","format":"double"},"updatedAt":{"type":"number","format":"double"},"lastValidatedAt":{"type":"number","format":"double"},"lastUsedAt":{"type":"number","format":"double"}},"required":["credentialId","provider","status","createdAt","updatedAt"],"type":"object","additionalProperties":false},"TestAICredentialResponse":{"properties":{"success":{"type":"boolean"},"provider":{"$ref":"#/components/schemas/AICredentialProvider"},"modelName":{"type":"string"},"message":{"type":"string"},"responseTime":{"type":"number","format":"double"},"error":{"type":"string"}},"required":["success","provider","message"],"type":"object","additionalProperties":false},"TestAICredentialRequest":{"properties":{"provider":{"$ref":"#/components/schemas/AICredentialProvider"},"apiKey":{"type":"string"},"modelName":{"type":"string"}},"required":["provider","apiKey"],"type":"object","additionalProperties":false},"SaveAICredentialRequest":{"properties":{"provider":{"$ref":"#/components/schemas/AICredentialProvider"},"apiKey":{"type":"string"},"displayName":{"type":"string"},"modelName":{"type":"string"},"validate":{"type":"boolean"}},"required":["provider","apiKey"],"type":"object","additionalProperties":false},"ArticleChatResponse":{"properties":{"provider":{"type":"string"},"modelName":{"type":"string"},"prompt":{"type":"string"},"response":{"type":"string"},"timestamp":{"type":"string"}},"required":["provider","modelName","prompt","response","timestamp"],"type":"object","additionalProperties":false},"InvalidAPIKeyErrorResponse":{"properties":{"error":{"properties":{"userMessage":{"type":"string"},"errorCode":{"type":"string"},"modelName":{"type":"string"},"provider":{"type":"string"},"message":{"type":"string"},"type":{"type":"string","enum":["INVALID_API_KEY"],"nullable":false}},"required":["userMessage","errorCode","provider","message","type"],"type":"object"}},"required":["error"],"type":"object","additionalProperties":false},"EntitlementDeniedErrorResponse":{"properties":{"error":{"properties":{"meter":{},"planDisplayName":{"type":"string"},"appKey":{"type":"string","enum":["mdedit","cowrite"]},"upgradeUrl":{"type":"string"},"upgradeTarget":{"type":"string","enum":["STANDARD","PREMIUM"]},"requiredAction":{"type":"string","enum":["upgrade","configure_byok","wait","choose_allowed_model"]},"operation":{"type":"string"},"feature":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string","enum":["credits_exhausted","credits_expired","byok_not_allowed","byok_key_missing","fair_use_exceeded","plan_required","subscription_required","model_not_allowed","usage_limit_exceeded"]},"type":{"type":"string","enum":["ENTITLEMENT_DENIED"],"nullable":false}},"required":["message","reason","type"],"type":"object"}},"required":["error"],"type":"object","additionalProperties":false},"InsufficientQuotaErrorResponse":{"properties":{"error":{"properties":{"userMessage":{"type":"string"},"errorCode":{"type":"string"},"modelName":{"type":"string"},"provider":{"type":"string"},"message":{"type":"string"},"type":{"type":"string","enum":["INSUFFICIENT_QUOTA"],"nullable":false}},"required":["userMessage","errorCode","provider","message","type"],"type":"object"}},"required":["error"],"type":"object","additionalProperties":false},"ChatRequest":{"properties":{"prompt":{"type":"string"},"provider":{"type":"string","enum":["openai","anthropic","xai","gemini"]},"modelName":{"type":"string"},"maxTokens":{"type":"number","format":"double"},"temperature":{"type":"number","format":"double"},"systemMessage":{"type":"string"},"providerMode":{"type":"string","enum":["managed","byok","local"]}},"required":["prompt"],"type":"object","additionalProperties":false},"AsyncJobResponse":{"properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["queued"],"nullable":false},"message":{"type":"string"},"jobUrl":{"type":"string"}},"required":["jobId","status","message","jobUrl"],"type":"object","additionalProperties":false},"ImageType":{"type":"string","enum":["default","visualization","infographic","abstract","diagram"],"description":"Image type hint used to tailor the generation prompt for tech article content.\n- default:       Standard professional illustration\n- visualization: Data-driven chart or graph-style image\n- infographic:   Step-by-step or multi-panel explainer layout\n- abstract:      Conceptual / artistic representation\n- diagram:       Architecture, flowchart, or technical diagram\n\nUser preference key: \"defaultImageType\""},"ImageResponse":{"description":"The image-generation response, declared to match what the service actually\nsends.\n\nThe schema is generated with `additionalProperties: false`, so an undeclared\nfield is one a schema-validating client may reject and a typed client cannot\nread. `provider`, `modelName`, `imageType` and `entitlements` were being sent\nundeclared; they are named here alongside `usage` rather than left implicit.\nOptional members are the ones JSON omits when the value is absent.","properties":{"provider":{"type":"string"},"modelName":{"type":"string"},"prompt":{"type":"string"},"imageType":{"$ref":"#/components/schemas/ImageType"},"size":{"type":"string"},"quality":{"type":"string"},"n":{"type":"number","format":"double"},"bucketType":{"type":"string"},"images":{"items":{"type":"string"},"type":"array"},"usage":{"$ref":"#/components/schemas/StepImageTokenUsage","description":"Token counts the image model billed this call on, when the provider reports\nthem (GPT Image does; Google's image models do not).\n\nExposed for the same reason it is captured: these are what the call is\npriced on, so a caller paying for generation can account for it exactly\ninstead of inferring a floor from the published per-image figures."},"timestamp":{"type":"string"},"entitlements":{"$ref":"#/components/schemas/EntitlementsStatusResponse"}},"required":["provider","modelName","prompt","size","quality","n","bucketType","images","timestamp"],"type":"object","additionalProperties":false},"ImageGenerationRequest":{"properties":{"prompt":{"type":"string"},"workspaceId":{"type":"string","description":"Optional scope for public uploads. When bucketType is \"public\" and these are\nprovided, generated images are stored under the canonical\nhosted/workspaces/{workspaceId}/articles/{articleId}/assets prefix."},"articleId":{"type":"string"},"provider":{"type":"string","enum":["openai","xai","gemini"],"description":"AI provider for image generation.\n- openai:  OpenAI GPT Image models\n- xai:     xAI Grok Imagine models\n- gemini:  Google Imagen/Gemini image models\n\nUser preference key: \"preferredImageProvider\""},"model":{"type":"string","description":"Specific model name to use. Falls back to the provider default when omitted.\nUser preference key: \"preferredImageModel\""},"imageType":{"$ref":"#/components/schemas/ImageType","description":"Image style/type used to enhance the prompt for tech article visuals.\nUser preference key: \"defaultImageType\""},"size":{"type":"string","enum":["auto","1024x1024","1536x1024","1024x1536","1792x1024","1024x1792"],"description":"Image dimensions. DALL·E models support 1024 and 1792-based sizes, while GPT image\nmodels support 1024 and 1536-based sizes plus 'auto'."},"quality":{"type":"string","enum":["auto","low","medium","high","standard","hd"],"description":"Image quality. DALL·E uses \"standard\"/\"hd\". GPT image models support \"low/medium/high/auto\".\nKeep both for backwards compatibility."},"n":{"type":"number","format":"double"},"bucketType":{"type":"string","enum":["private","public"]}},"required":["prompt"],"type":"object","additionalProperties":false},"AnimationGenerationRequest":{"properties":{"renderer":{"type":"string","enum":["manim","code-animation","chart-animation","diagram-animation"]},"workspaceId":{"type":"string"},"articleId":{"type":"string"},"title":{"type":"string"},"prompt":{"type":"string"},"durationSeconds":{"type":"number","format":"double"},"style":{"type":"string"},"visualStyle":{"$ref":"#/components/schemas/VisualStyle"},"code":{"type":"string"},"language":{"type":"string"},"theme":{"type":"string"},"font":{"type":"string"},"typingSpeedCps":{"type":"number","format":"double"},"pauseAtEndMs":{"type":"number","format":"double"},"windowChrome":{"type":"string"},"data":{"type":"string"},"dataFormat":{"type":"string","enum":["csv","table","json"]},"source":{"type":"string"},"sourceLanguage":{"type":"string","enum":["mermaid","graphviz_dot"]},"diagramKind":{"type":"string","enum":["flowchart","state","graph","sequence","mindmap","class","er"]},"events":{"items":{"properties":{"durationMs":{"type":"number","format":"double"},"startMs":{"type":"number","format":"double"},"label":{"type":"string"},"targetId":{"type":"string"},"type":{"type":"string","enum":["reveal","trace","highlight","callout"]}},"required":["type"],"type":"object"},"type":"array"},"width":{"type":"number","format":"double"},"height":{"type":"number","format":"double"},"fps":{"type":"number","format":"double"},"quality":{"type":"string","enum":["low","medium","high"]},"caption":{"type":"string"},"altText":{"type":"string"}},"required":["renderer","workspaceId","articleId"],"type":"object","additionalProperties":false},"AIModel":{"properties":{"provider":{"type":"string"},"providerDisplayName":{"type":"string"},"displayName":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["chat","image"]},"description":{"type":"string"},"isRecommended":{"type":"boolean"},"isNew":{"type":"boolean"},"tier":{"type":"string","enum":["basic","standard","advanced","premium"]},"capabilities":{"items":{"type":"string"},"type":"array"},"icon":{"type":"string"},"contextWindow":{"type":"number","format":"double"},"pricing":{"properties":{"outputTokens":{"type":"number","format":"double"},"inputTokens":{"type":"number","format":"double"}},"type":"object"},"usesMaxCompletionTokens":{"type":"boolean"},"supportsTemperature":{"type":"boolean"}},"required":["provider","providerDisplayName","displayName","name","type"],"type":"object","additionalProperties":false},"ModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/AIModel"},"type":"array"}},"required":["models"],"type":"object","additionalProperties":false},"TestConnectionResponse":{"properties":{"success":{"type":"boolean"},"provider":{"type":"string"},"modelName":{"type":"string"},"message":{"type":"string"},"responseTime":{"type":"number","format":"double"},"error":{"type":"string"}},"required":["success","provider","message"],"type":"object","additionalProperties":false},"TestConnectionRequest":{"properties":{"provider":{"type":"string","enum":["openai","anthropic","xai","gemini"]},"apiKey":{"type":"string"},"modelName":{"type":"string"}},"required":["provider","apiKey"],"type":"object","additionalProperties":false}},"securitySchemes":{"jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"apiKey":{"type":"apiKey","name":"x-api-key","in":"header"},"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://mdh-app.auth.us-west-2.amazoncognito.com/oauth2/authorize","tokenUrl":"https://mdh-app.auth.us-west-2.amazoncognito.com/oauth2/token","scopes":{"https://apiv2.mdedit.ai/api/workspaces:read":"Read accessible workspaces","https://apiv2.mdedit.ai/api/workspaces:write":"Create and update workspaces","https://apiv2.mdedit.ai/api/folders:read":"Read folders","https://apiv2.mdedit.ai/api/folders:write":"Create and update folders","https://apiv2.mdedit.ai/api/articles:read":"Read Markdown Documents","https://apiv2.mdedit.ai/api/articles:write":"Create and edit Markdown Documents","https://apiv2.mdedit.ai/api/reviews:read":"Read document reviews","https://apiv2.mdedit.ai/api/reviews:write":"Create and update document reviews","https://apiv2.mdedit.ai/api/templates:read":"Read templates","https://apiv2.mdedit.ai/api/templates:write":"Create and update templates","https://apiv2.mdedit.ai/api/projects:read":"Read projects","https://apiv2.mdedit.ai/api/projects:write":"Create and update projects","https://apiv2.mdedit.ai/api/topics:read":"Read topics","https://apiv2.mdedit.ai/api/topics:write":"Create and update topics","https://apiv2.mdedit.ai/api/performance:read":"Read content performance","https://apiv2.mdedit.ai/api/publishing:read":"Read publishing targets and status","https://apiv2.mdedit.ai/api/publishing:write":"Publish documents","https://apiv2.mdedit.ai/api/conversions:execute":"Convert documents between formats","https://apiv2.mdedit.ai/api/integrations:write":"Manage integrations","https://apiv2.mdedit.ai/api/keys:manage":"Manage scoped API keys"}}}}}},"info":{"title":"MDH Express API","version":"1.0.0","description":"Unified MDH API Service - AI Chat, Image Generation, and Job Management","contact":{"name":"MDH Team","email":"support@mdh.com"}},"paths":{"/workspaces/{workspaceId}/webhooks":{"get":{"operationId":"List","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkspaceWebhook"},"type":"array"}}}}},"tags":["Workspace Webhooks"],"security":[{"jwt":[]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"Create","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceWebhookResponse"}}}}},"tags":["Workspace Webhooks"],"security":[{"jwt":[]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceWebhookRequest"}}}}}},"/workspaces/{workspaceId}/webhooks/{webhookId}":{"patch":{"operationId":"Update","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WorkspaceWebhook"},{"properties":{"secret":{"type":"string"}},"type":"object"}]}}}}},"tags":["Workspace Webhooks"],"security":[{"jwt":[]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"webhookId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkspaceWebhookRequest"}}}}},"delete":{"operationId":"Remove","responses":{"204":{"description":"Deleted"}},"tags":["Workspace Webhooks"],"security":[{"jwt":[]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"webhookId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics":{"get":{"operationId":"ListTopics","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceListTopicsResponse"}}}}},"description":"List topics for a workspace.","summary":"List topics by workspace","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"contentProjectId","required":false,"schema":{"type":"string"}},{"in":"query","name":"status","required":false,"schema":{"$ref":"#/components/schemas/TopicStatus"}},{"in":"query","name":"limit","required":false,"schema":{"format":"double","type":"number"}},{"in":"query","name":"nextToken","required":false,"schema":{"type":"string"}},{"in":"query","name":"includeCounts","required":false,"schema":{"type":"boolean"}}]},"post":{"operationId":"CreateTopic","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreateTopicResponse"}}}}},"description":"Create a topic in a workspace (optionally associating it to a content project).","summary":"Create topic","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreateTopicRequest"}}}}}},"/workspaces/{workspaceId}/topics/classify-type":{"post":{"operationId":"ClassifyArticleType","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyArticleTypeResponse"}}}}},"description":"Classify the article type/format implied by a proposed title, without\ncreating a topic. Powers the New-article form's \"Auto\" article type —\nthe client shows the result as an editable chip before/at submit and\nonly falls back to the manual Article type/format selects (behind an\n\"Advanced\" disclosure) on override.","summary":"Classify article type","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyArticleTypeRequest"}}}}}},"/workspaces/{workspaceId}/topics/short-id/{shortId}":{"get":{"operationId":"GetTopicByShortId","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentTopic"}}}}},"tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"shortId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}":{"get":{"operationId":"GetTopic","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentTopic"}}}}},"description":"Get a single topic by ID.","summary":"Get topic","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateTopic","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTopicMessageResponse"}}}}},"description":"Update mutable fields on a topic.","summary":"Update topic","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUpdateTopicRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/seo-brief":{"get":{"operationId":"GetTopicSeoBrief","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTopicSeoBriefResponse"}}}}},"description":"Get the structured SEO brief for a topic.","summary":"Get topic SEO brief","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateTopicSeoBrief","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTopicSeoBriefResponse"}}}}},"description":"Update the structured SEO strategy for a topic.","summary":"Update topic SEO brief","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUpdateTopicSeoBriefRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/seo-brief/refresh-metrics":{"post":{"operationId":"RefreshTopicSeoMetrics","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceRefreshTopicSeoMetricsResponse"}}}}},"description":"Refresh keyword metrics for the current SEO brief revision.","summary":"Refresh topic SEO metrics","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}/performance-target":{"get":{"operationId":"GetPerformanceTarget","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePerformanceTargetResponse"}}}}},"description":"Get the effective Cowrite performance tracking target for a topic.","summary":"Get topic performance target","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"SetPerformanceTarget","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePerformanceTargetResponse"}}}}},"description":"Set a manual published URL for Cowrite performance tracking.","summary":"Set topic performance target","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUpdatePerformanceTargetRequest"}}}}},"delete":{"operationId":"ClearPerformanceTarget","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePerformanceTargetResponse"}}}}},"description":"Clear a manual Cowrite performance tracking URL. A live primary publication\nmay still become the effective target.","summary":"Clear topic performance target","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}/performance-target/verify":{"post":{"operationId":"VerifyPerformanceTarget","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceVerifyPerformanceTargetResponse"}}}}},"description":"Verify whether a topic has enough information to begin performance tracking.","summary":"Verify topic performance target","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}/performance":{"get":{"operationId":"GetTopicPerformance","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTopicPerformanceResponse"}}}}},"description":"Return stored Cowrite performance metrics for a topic.","summary":"Get topic performance","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}/performance/sync":{"post":{"operationId":"SyncTopicPerformance","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncTopicPerformanceResponse"}}}}},"description":"Sync Cowrite performance metrics for a topic.","summary":"Sync topic performance","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}/shortlist":{"put":{"operationId":"ShortlistTopic","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceShortlistTopicResponse"}}}}},"description":"Shortlist a topic (idea → shortlisted).\n\nThis is the canonical \"approve brief\" action for Cowrite.\nIt transitions the topic to `shortlisted` and auto-enqueues the next run:\n- requireOutlineApproval=true  → `outline` and pause for review\n- requireOutlineApproval=false → `outline` without a pause; backend queues draft after completion","summary":"Shortlist topic","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceRunInstructionsRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/archive":{"put":{"operationId":"ArchiveTopic","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTopicMessageResponse"}}}}},"description":"Archive a topic (from any non-archived status → archived).\n\nClears scheduledDate and scheduleNote on archive.","summary":"Archive topic","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}/restore":{"put":{"operationId":"RestoreTopic","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTopicMessageResponse"}}}}},"description":"Restore an archived topic to its previous non-archived status.","summary":"Restore topic","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}/audit-events":{"get":{"operationId":"ListAuditEvents","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"nextToken":{"type":"string"},"events":{"items":{"$ref":"#/components/schemas/ContentAuditEvent"},"type":"array"}},"required":["events"],"type":"object"}}}}},"description":"List audit events for a topic.","summary":"List audit events for topic","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"format":"double","type":"number"}},{"in":"query","name":"nextToken","required":false,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}/article/ensure":{"post":{"operationId":"EnsureTopicArticle","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceEnsureTopicArticleResponse"}}}}},"description":"Ensure the topic has an article container linked, without starting any workflow.","summary":"Ensure topic article","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceEnsureTopicArticleRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/workflow/start":{"post":{"operationId":"StartWorkflow","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceStartWorkflowResponse"}}}}},"description":"Start the Cowrite pipeline for a topic with a single call.\n\nThis exists so clients do not need to call outline-generate and draft endpoints\nseparately to get from \"title\" → \"draft\".\n\nBehavior (policy-driven):\n- requireOutlineApproval=true  → enqueue `outline` only (pauses for approval)\n- requireOutlineApproval=false → enqueue `outline` without a pause; backend queues draft after completion\n\n`pipeline: 'full'` swaps the staged pair for a single `full_editorial_article`\nrun that benchmarks SERP coverage before research and outline, and drafts in\nthe same run (so nothing is chained after it). The approval policy above is\nunchanged by that choice.","summary":"Start topic workflow (async)","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceStartWorkflowRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/outline/generate":{"post":{"operationId":"GenerateOutline","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceGenerateOutlineResponse"}}}}},"description":"Trigger async outline generation for a topic in a workspace.\n\nThe \"New article\" flow uses this to generate `outline.md` first, then\nseparately enqueues an editorial_* draft action once the outline exists.","summary":"Generate outline (async)","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceGenerateOutlineRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/outline":{"get":{"operationId":"GetOutline","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceGetOutlineResponse"}}}}},"description":"Get the generated outline for a workspace topic.","summary":"Get outline","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/topics/{topicId}/outline/approve":{"post":{"operationId":"ApproveOutline","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceApproveOutlineResponse"}}}}},"description":"Approve an outline for a workspace topic.\n\nThis records the approval on the topic and lets the backend advance the\npipeline by queueing the editorial draft when no draft is already running.","summary":"Approve outline","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceApproveOutlineRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/outline/request-changes":{"post":{"operationId":"OutlineRequestChanges","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WorkspaceTopicMessageResponse"},{"properties":{"outlineRunId":{"type":"string"}},"type":"object"}]}}}}},"description":"Request changes to the generated outline.\n\nRecords an outline_changes_requested audit event and enqueues an\noutline_revision run that will regenerate the outline using the provided feedback.\n\nOnly valid when topic.status === 'outlined'.","summary":"Request outline changes","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceOutlineRequestChangesRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/draft":{"get":{"operationId":"GetDraft","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceGetDraftResponse"}}}}},"description":"Get the persisted draft for a workspace topic.\n\nReturns the latest draft markdown produced by an agent run.\nReturns 404 if no draft has been generated yet.","summary":"Get topic draft","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"RunDraftAction","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceRunDraftActionResponse"}}}}},"description":"Run an action-based draft workflow for a topic.","summary":"Run draft action (async)","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceRunDraftActionRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/draft/approve":{"post":{"operationId":"ApproveDraft","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTopicMessageResponse"}}}}},"description":"Approve the draft for a topic.\n\nRecords the approval in ContentTopicApprovals.draft and writes a draft_approved audit event.\nOnly valid when topic status is already `drafted`.","summary":"Approve topic draft","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceApproveDraftRequest"}}}}}},"/workspaces/{workspaceId}/topics/{topicId}/draft/request-changes":{"post":{"operationId":"DraftRequestChanges","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WorkspaceTopicMessageResponse"},{"properties":{"draftRunId":{"type":"string"}},"type":"object"}]}}}}},"description":"Request changes to the generated draft.\n\nRecords a draft_changes_requested audit event and enqueues a draft_revision run.\nOnly valid when topic.status === 'drafted'.","summary":"Request draft changes","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDraftRequestChangesRequest"}}}}}},"/workspaces":{"post":{"operationId":"CreateWorkspace","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceResponse"}}}}},"description":"Create a new workspace","summary":"Create workspace","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceRequest"}}}}},"get":{"operationId":"GetUserWorkspaces","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Workspace"},"type":"array"}}}}},"description":"Get all workspaces for the authenticated user\nIncludes both direct membership and invited workspaces\nCreates a default workspace if user has none","summary":"Get user workspaces","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:read"]}],"parameters":[]}},"/workspaces/{workspaceId}":{"get":{"operationId":"GetWorkspace","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}}},"description":"Get workspace details by ID\nChecks both direct membership and invitation-based permissions","summary":"Get workspace","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateWorkspace","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMessageResponse"}}}}},"description":"Update workspace metadata","summary":"Update workspace","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkspaceRequest"}}}}},"delete":{"operationId":"DeleteWorkspace","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMessageResponse"}}}}},"description":"Delete a workspace","summary":"Delete workspace","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/members":{"post":{"operationId":"AddMember","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMessageResponse"}}}}},"description":"Add a member to workspace","summary":"Add member","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMemberRequest"}}}}}},"/workspaces/{workspaceId}/members/{memberUsername}":{"delete":{"operationId":"RemoveMember","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMessageResponse"}}}}},"description":"Remove a member from workspace","summary":"Remove member","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"memberUsername","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/collaborators":{"get":{"operationId":"GetWorkspaceCollaborators","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkspaceCollaboratorResponse"},"type":"array"}}}}},"description":"Get all collaborators for a workspace (both direct members and invited)","summary":"Get workspace collaborators","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/collaborators/{collaboratorUsername}":{"delete":{"operationId":"RemoveWorkspaceCollaborator","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMessageResponse"}}}}},"description":"Remove an invitation-based collaborator from a workspace","summary":"Revoke workspace collaborator access","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"collaboratorUsername","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/export/zip":{"get":{"operationId":"ExportWorkspaceZip","responses":{"200":{"description":"Ok","content":{"application/zip":{"schema":{"$ref":"#/components/schemas/NodeJS.ReadableStream"}}}}},"description":"Export entire workspace data as a ZIP file\nIncludes all articles with their content and assets","summary":"Export workspace as ZIP","tags":["Workspaces"],"security":[{"jwt":["OR"]},{"apiKey":["workspaces:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/workspaces:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]}},"/workflows":{"get":{"operationId":"ListWorkflows","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkflowsResponse"}}}},"400":{"description":"Missing required query parameter","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"List available workflows.\n\nReturns system defaults as well as any custom workflows stored at the\nworkspace level (and folder level when `folderId` is provided).","summary":"List workflows","tags":["Workflows"],"security":[{"jwt":[]}],"parameters":[{"in":"query","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"folderId","required":false,"schema":{"type":"string"}}]},"post":{"operationId":"CreateWorkflow","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWorkflowResponse"}}}},"400":{"description":"Invalid workflow definition","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"409":{"description":"Workflow already exists","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Create a custom workflow.\n\nThe workflow definition is validated, serialized to markdown, and saved to\nS3 at the workspace or folder scope.","summary":"Create workflow","tags":["Workflows"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowRequest"}}}}}},"/workflows/{workflowId}":{"get":{"operationId":"GetWorkflow","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWorkflowResponse"}}}},"400":{"description":"Missing required query parameter","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Get a workflow by ID.\n\nFor system workflows use `default`, `research`, `outline`, or `draft`.\nFor custom workflows use the workflow name and provide `workspaceId`.","summary":"Get workflow","tags":["Workflows"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workflowId","required":true,"schema":{"type":"string"}},{"in":"query","name":"workspaceId","required":false,"schema":{"type":"string"}},{"in":"query","name":"folderId","required":false,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateWorkflow","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWorkflowResponse"}}}},"400":{"description":"Invalid workflow definition","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Update an existing custom workflow.\n\nSystem workflows (`default`, `research`, `outline`, `draft`) cannot be\nmodified.","summary":"Update workflow","tags":["Workflows"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workflowId","required":true,"schema":{"type":"string"}},{"in":"query","name":"workspaceId","required":false,"schema":{"type":"string"}},{"in":"query","name":"folderId","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowRequest"}}}}},"delete":{"operationId":"DeleteWorkflow","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}}}},"400":{"description":"Missing required query parameter","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Cannot delete system workflow","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Delete a custom workflow.\n\nSystem workflows (`default`, `research`, `outline`, `draft`) cannot be\ndeleted.","summary":"Delete workflow","tags":["Workflows"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workflowId","required":true,"schema":{"type":"string"}},{"in":"query","name":"workspaceId","required":false,"schema":{"type":"string"}},{"in":"query","name":"folderId","required":false,"schema":{"type":"string"}}]}},"/workflows/{workflowId}/authorization-requirements":{"get":{"operationId":"GetWorkflowAuthorizationRequirements","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"canStart":{"type":"boolean"},"providers":{"items":{"$ref":"#/components/schemas/WorkflowAuthorizationProviderRequirement"},"type":"array"},"workflowId":{"type":"string"}},"required":["canStart","providers","workflowId"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"503":{"description":"Arcade unavailable","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Return the Arcade providers that the current user still needs to connect\nbefore they can run the specified workflow.\n\nAn empty `providers` array means all requirements are satisfied and the\nworkflow can be started immediately.","summary":"Get workflow authorization requirements","tags":["Workflows"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workflowId","required":true,"schema":{"type":"string"}},{"in":"query","name":"workspaceId","required":false,"schema":{"type":"string"}},{"in":"query","name":"folderId","required":false,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/versions":{"post":{"operationId":"CreateVersion","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVersionResponse"}}}},"403":{"description":"Version quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaExceededErrorResponse"}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Create version (returns presigned S3 upload URL)","summary":"Create a version of the article","tags":["Versions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVersionRequest"}}}}},"get":{"operationId":"GetVersions","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionListResponse"}}}}},"description":"Get all versions for an article","summary":"List all versions of an article","tags":["Versions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/versions/{versionId}":{"get":{"operationId":"GetVersion","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionContentResponse"}}}},"404":{"description":"Article or version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Get specific version content","summary":"Get the content of a specific version","tags":["Versions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"versionId","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"DeleteVersion","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteVersionResponse"}}}},"404":{"description":"Article or version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Delete a version","summary":"Delete a manual version (auto versions cannot be deleted)","tags":["Versions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"versionId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/versions/{versionId}/restore":{"post":{"operationId":"RestoreVersion","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreVersionResponse"}}}}},"description":"Restore a version","summary":"Restore an article to a previous version","tags":["Versions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"versionId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/versions/{v1}/compare/{v2}":{"get":{"operationId":"CompareVersions","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionDiffResponse"}}}}},"description":"Compare two versions","summary":"Get a diff between two versions","tags":["Versions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"v1","required":true,"schema":{"type":"string"}},{"in":"path","name":"v2","required":true,"schema":{"type":"string"}}]}},"/upload":{"post":{"operationId":"CreateUploadUrl","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"},"examples":{"Example 1":{"value":{"signedUrl":"https://s3.amazonaws.com/bucket/tools/input/<jobId>/input.md?...","expiresInSeconds":300}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}},"description":"Create a presigned S3 PUT URL for tool inputs (single key).","tags":["Tools"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRequest"}}}}}},"/tools/markdown/linkify":{"post":{"operationId":"LinkifyMarkdown","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkdownLinkifyResponse"},"examples":{"Example 1":{"value":{"markdown":"[Example Domain](https://example.com)\n"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Replace raw URL markdown link text with the linked page title.","tags":["Tools"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkdownLinkifyRequest"}}}}}},"/tools/convert":{"post":{"operationId":"CreateConversion","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionResponse"},"examples":{"Example 1":{"value":{"jobId":"123e4567-e89b-12d3-a456-426614174000","statusUrl":"/api/tools/jobs/123e4567-e89b-12d3-a456-426614174000","conversion":{"type":"pdf","inputFormat":"markdown","outputFormat":"pdf"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Quota exceeded","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Input file not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"409":{"description":"Job already exists","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"413":{"description":"Input file too large","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Create a new file conversion job.\nSupports PDF, MP3, ZIP, Pandoc, and constrained MarkItDown conversions\nwith a unified interface.","tags":["Tools"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionRequest"}}}}}},"/tools/convert/access":{"post":{"operationId":"CheckConversionAccess","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionAccessResponse"},"examples":{"Example 1":{"value":{"allowed":true,"conversion":{"type":"mp3","inputFormat":"html","outputFormat":"mp3","requiredFeatures":["tool-conversion","tool-audio"]}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Quota exceeded","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Check whether the current actor can start a conversion before any input is uploaded.","tags":["Tools"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionAccessRequest"}}}}}},"/tools/jobs/{jobId}":{"get":{"operationId":"GetToolJob","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolJobStatusResponse"},"examples":{"Example 1":{"value":{"jobId":"123e4567-e89b-12d3-a456-426614174000","status":"completed","progress":100,"createdAt":"2024-01-01T00:00:00.000Z","processedAt":"2024-01-01T00:00:01.000Z","finishedAt":"2024-01-01T00:00:05.000Z","downloadUrl":"https://s3.amazonaws.com/bucket/tools/output/<jobId>/output.pdf?...","fileName":"output.pdf","mimeType":"application/pdf","expiresAt":"2024-01-01T01:00:05.000Z"}}}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Get the status and result of a conversion job.\nPoll this endpoint to check job progress and get the download URL when complete.","tags":["Tools"],"security":[],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}]}},"/tools/jobs/{jobId}/download":{"get":{"operationId":"DownloadToolJob","responses":{"200":{"description":"Ok","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/NodeJS.ReadableStream"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"409":{"description":"Job not completed","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Download a completed tool job output.\nThis proxies the S3 object through the API to avoid CORS issues with presigned URLs.","tags":["Tools"],"security":[],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}]}},"/templates/{templateId}":{"get":{"operationId":"GetTemplate","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateWithContentResponse"}}}}},"description":"Get template by ID with content","summary":"Get template details","tags":["Templates"],"security":[{"jwt":["OR"]},{"apiKey":["templates:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/templates:read"]}],"parameters":[{"description":"Template ID","in":"path","name":"templateId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateTemplate","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}}},"description":"Update a template","summary":"Update template","tags":["Templates"],"security":[{"jwt":["OR"]},{"apiKey":["templates:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/templates:write"]}],"parameters":[{"description":"Template ID","in":"path","name":"templateId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTemplateRequest"}}}}},"delete":{"operationId":"DeleteTemplate","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateMessageResponse"}}}}},"description":"Delete a template","summary":"Delete template","tags":["Templates"],"security":[{"jwt":["OR"]},{"apiKey":["templates:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/templates:write"]}],"parameters":[{"description":"Template ID","in":"path","name":"templateId","required":true,"schema":{"type":"string"}}]}},"/templates/slug/{slug}":{"get":{"operationId":"GetTemplateBySlug","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateWithContentResponse"}}}}},"description":"Get template by slug (useful for system templates)","summary":"Get template by slug","tags":["Templates"],"security":[{"jwt":["OR"]},{"apiKey":["templates:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/templates:read"]}],"parameters":[{"description":"Template slug (e.g., 'blog-post', 'tech-design-doc')","in":"path","name":"slug","required":true,"schema":{"type":"string"}}]}},"/templates/{templateId}/publish":{"post":{"operationId":"PublishTemplate","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}}},"description":"Publish a template (make it public)","summary":"Publish template","tags":["Templates"],"security":[{"jwt":["OR"]},{"apiKey":["templates:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/templates:write"]}],"parameters":[{"description":"Template ID","in":"path","name":"templateId","required":true,"schema":{"type":"string"}}]}},"/templates/{templateId}/track-usage":{"post":{"operationId":"TrackTemplateUsage","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateMessageResponse"}}}}},"description":"Track template usage - increment usage count and update last used timestamp","summary":"Track template usage","tags":["Templates"],"security":[{"jwt":["OR"]},{"apiKey":["templates:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/templates:write"]}],"parameters":[{"description":"Template ID","in":"path","name":"templateId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/templates":{"get":{"operationId":"GetWorkspaceTemplates","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Template"},"type":"array"}}}}},"description":"Get all templates accessible in workspace context\nReturns: System templates + Workspace templates + User's private templates","summary":"List all accessible templates","tags":["Templates"],"security":[{"jwt":["OR"]},{"apiKey":["templates:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/templates:read"]}],"parameters":[{"description":"Workspace ID","in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/save-as-template":{"post":{"operationId":"SaveArticleAsTemplate","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"201":{"description":"Template created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}}},"description":"Save article as template","summary":"Save article as template","tags":["Templates"],"security":[{"jwt":["OR"]},{"apiKey":["templates:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/templates:write"]}],"parameters":[{"description":"Workspace ID","in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"description":"Article ID to convert to template","in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveArticleAsTemplateRequest"}}}}}},"/subscription":{"get":{"operationId":"GetUserSubscriptions","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{},"type":"array"}}}}},"description":"Get all active subscriptions for the authenticated user","summary":"Get user subscriptions","tags":["Subscription"],"security":[{"jwt":[]}],"parameters":[]},"post":{"operationId":"CreateSubscription","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionResponse"}}}}},"description":"Create a new subscription for the authenticated user","summary":"Create subscription","tags":["Subscription"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionRequest"}}}}}},"/subscription/{subscriptionId}":{"get":{"operationId":"GetSubscription","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{}}}}},"description":"Get a specific subscription by ID for the authenticated user","summary":"Get subscription by ID","tags":["Subscription"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"subscriptionId","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"DeleteSubscription","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSubscriptionResponse"}}}}},"description":"Delete a specific subscription for the authenticated user","summary":"Delete subscription","tags":["Subscription"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"subscriptionId","required":true,"schema":{"type":"string"}}]}},"/subscription/cancel":{"post":{"operationId":"CancelSubscription","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionResponse"}}}}},"description":"Cancel all active subscriptions for the authenticated user","summary":"Cancel user subscriptions","tags":["Subscription"],"security":[{"jwt":[]}],"parameters":[]}},"/subscription/checkout":{"post":{"operationId":"CreateCheckoutSession","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}}},"description":"Create a Stripe checkout session for the authenticated user","summary":"Create checkout session","tags":["Subscription"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionRequest"}}}}}},"/subscription/portal-session":{"post":{"operationId":"CreatePortalSession","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}}},"description":"Create a Stripe Billing Portal session for the authenticated user","summary":"Create customer portal session","tags":["Subscription"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionRequest"}}}}}},"/style-profiles":{"post":{"operationId":"CreateProfile","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StyleProfile"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Create or update a baseline style profile from form fields.\nUpserts on (workspaceId, scopeType, scopeId) — safe to call multiple times.","tags":["Style Profiles"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProfileBody"}}}}},"get":{"operationId":"ListProfiles","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"profiles":{"items":{"$ref":"#/components/schemas/StyleProfile"},"type":"array"}},"required":["profiles"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"List all style profiles for a workspace (writer + project scoped).","tags":["Style Profiles"],"security":[{"jwt":[]}],"parameters":[{"in":"query","name":"workspaceId","required":true,"schema":{"type":"string"}}]}},"/style-profiles/extract":{"post":{"operationId":"ExtractStyleProfile","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"jobId":{"type":"string"}},"required":["message","jobId"],"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Profile or article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Enrich an existing style profile by running LLM extraction over sample articles.\nQueues an async job (extract-baseline) and returns the job ID.\nExtraction results are merged into the profile — form-set fields are not overwritten.","tags":["Style Profiles"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractStyleProfileBody"}}}}}},"/style-profiles/{profileId}":{"get":{"operationId":"GetProfile","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StyleProfile"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Profile not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Retrieve a single style profile by ID.","tags":["Style Profiles"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"profileId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateProfile","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StyleProfile"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Profile not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Update fields on an existing style profile.\nOnly provided fields are updated — null fields are ignored (use DELETE to clear).","tags":["Style Profiles"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"profileId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStyleProfileRequest"}}}}},"delete":{"operationId":"DeleteProfile","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Profile not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Delete a style profile and clear style memories for the same writer/project scope.","tags":["Style Profiles"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"profileId","required":true,"schema":{"type":"string"}}]}},"/resources":{"get":{"operationId":"ListResources","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResourcesResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Article Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"List resources for a scope (workspace/folder/article).","tags":["AI Resources"],"security":[{"jwt":[]}],"parameters":[{"in":"query","name":"scopeType","required":true,"schema":{"$ref":"#/components/schemas/ResourceScopeType"}},{"in":"query","name":"scopeId","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","required":true,"schema":{"format":"double","type":"number"}}]},"post":{"operationId":"CreateUrlResource","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"resource":{"$ref":"#/components/schemas/ResourceListItem"}},"required":["resource"],"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Article Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Attach a URL resource (ingests immediately).","tags":["AI Resources"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUrlResourceBody"}}}}}},"/resources/upload-url":{"post":{"operationId":"CreateUploadUrl","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadUrlResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Article Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Create a file resource upload URL (client uploads to S3, then call ingest).","tags":["AI Resources"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadUrlBody"}}}}}},"/resources/{resourceId}/ingest":{"post":{"operationId":"IngestResource","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"resource":{"$ref":"#/components/schemas/ResourceListItem"}},"required":["resource"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Resource or Article Not Found","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"},{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}]}}}}},"description":"Ingest a resource (for file uploads or re-ingestion).","tags":["AI Resources"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"resourceId","required":true,"schema":{"type":"string"}}]}},"/resources/{resourceId}":{"patch":{"operationId":"UpdateResource","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"ok":{"type":"boolean","enum":[true],"nullable":false}},"required":["ok"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Resource or Article Not Found","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"},{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}]}}}}},"description":"Update resource fields (enabled/title/tags).","tags":["AI Resources"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"resourceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResourceBody"}}}}},"delete":{"operationId":"DeleteResource","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"ok":{"type":"boolean","enum":[true],"nullable":false}},"required":["ok"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Resource or Article Not Found","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"},{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}]}}}}},"description":"Delete a resource.","tags":["AI Resources"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"resourceId","required":true,"schema":{"type":"string"}}]}},"/render":{"post":{"operationId":"Render","responses":{"200":{"description":"Rendered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Render diagrams or code screenshots","summary":"Render content to image","tags":["Render"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderApiRequest"},"example":{"type":"diagram","content":"graph TD;\n    A-->B;\n    A-->C;","format":"png","diagramOptions":{"diagramType":"mermaid","visualStyle":{"theme":"pastel","look":"classic"}},"options":{"width":1200,"height":800,"backgroundColor":"white"}}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/publish":{"get":{"operationId":"GetPublishStatus","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishStatusResponseBody"}}}}},"description":"Get publish status for an article","tags":["Publishing"],"security":[{"jwt":["OR"]},{"apiKey":["publishing:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/publishing:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"Publish","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishResponseBody"}}}}},"description":"Publish an article (creates or updates existing publish)","tags":["Publishing"],"security":[{"jwt":["OR"]},{"apiKey":["publishing:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/publishing:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequestBody"}}}}},"put":{"operationId":"Update","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishResponseBody"}}}}},"description":"Update a published article (re-publish latest content)","tags":["Publishing"],"security":[{"jwt":["OR"]},{"apiKey":["publishing:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/publishing:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequestBody"}}}}},"delete":{"operationId":"Unpublish","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnpublishResponseBody"}}}}},"description":"Unpublish an article (soft delete)","tags":["Publishing"],"security":[{"jwt":["OR"]},{"apiKey":["publishing:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/publishing:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/publish/external":{"post":{"operationId":"PublishExternal","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalPublishResponseBody"}}}}},"description":"Publish an article to an external writing platform.","tags":["Publishing"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalPublishRequestBody"}}}}}},"/workspaces/{workspaceId}/published":{"get":{"operationId":"List","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishedListResponseBody"}}}}},"description":"List the current user's published documents for a workspace","tags":["Publishing"],"security":[{"jwt":["OR"]},{"apiKey":["publishing:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/publishing:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"default":50,"format":"double","type":"number"}},{"in":"query","name":"nextToken","required":false,"schema":{"type":"string"}}]}},"/public/p/{publishId}":{"get":{"operationId":"Get","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicPublishedArticleRecord"}}}}},"description":"Get a published document by publishId (public, no auth)","tags":["Publishing"],"security":[],"parameters":[{"in":"path","name":"publishId","required":true,"schema":{"type":"string"}}]}},"/public/p/{publishId}/view":{"post":{"operationId":"View","responses":{"204":{"description":"No content"}},"description":"Increment view count (public, no auth)","tags":["Publishing"],"security":[],"parameters":[{"in":"path","name":"publishId","required":true,"schema":{"type":"string"}}]}},"/preferences":{"get":{"operationId":"GetUserPreferences","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record_string.unknown_"}}}}},"description":"Get preferences for the authenticated user","summary":"Get user preferences (returns empty object if none exist)","tags":["Preferences"],"security":[{"jwt":[]}],"parameters":[]},"post":{"operationId":"SaveUserPreferences","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavePreferencesResponse"}}}}},"description":"Save/update preferences for the authenticated user","summary":"Save or update user preferences","tags":["Preferences"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record_string.unknown_"}}}}},"delete":{"operationId":"DeleteUserPreferences","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePreferencesResponse"}}}}},"description":"Delete preferences for the authenticated user","summary":"Delete all user preferences","tags":["Preferences"],"security":[{"jwt":[]}],"parameters":[]}},"/preferences/email":{"get":{"operationId":"GetEmailPreferences","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailPreferences"}}}}},"description":"Get marketing email preferences for the authenticated user","summary":"Get email category preferences (returns defaults if never set)","tags":["Preferences"],"security":[{"jwt":[]}],"parameters":[]},"put":{"operationId":"UpdateEmailPreferences","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailPreferences"}}}}},"description":"Update marketing email preferences for the authenticated user","summary":"Update email category preferences or unsubscribe from all non-essential email","tags":["Preferences"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmailPreferencesRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/permissions":{"get":{"operationId":"GetArticlePermissions","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Permission"},"type":"array"}}}}},"description":"Get all permissions for an article","summary":"List article permissions","tags":["Permissions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/permissions/{username}":{"put":{"operationId":"UpdatePermission","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePermissionResponse"}}}}},"description":"Update a user's permission level on an article","summary":"Update permission","tags":["Permissions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"username","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePermissionRequest"}}}}},"delete":{"operationId":"RevokePermission","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePermissionResponse"}}}}},"description":"Revoke a user's permission on an article","summary":"Revoke permission","tags":["Permissions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"username","required":true,"schema":{"type":"string"}}]}},"/oauth-connections":{"get":{"operationId":"ListConnections","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListConnectedOAuthHostsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"List non-sensitive activity projections for the user's supported OAuth hosts.\nTokens and refresh credentials are never stored in this projection.","tags":["OAuth Connections"],"security":[{"jwt":["OR"]}],"parameters":[]}},"/oauth-connections/all":{"delete":{"operationId":"RevokeAllConnections","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeAllOAuthHostsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Revoke every Cognito session for this mdedit account.\nCognito cannot enforce per-host revocation for these public clients.","tags":["OAuth Connections"],"security":[{"jwt":["OR"]}],"parameters":[]}},"/admin/lifecycle-marketing/dry-run":{"post":{"operationId":"DryRunLifecycleMarketing","responses":{"200":{"description":"Lifecycle marketing dry-run rendered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleMarketingDryRunResponse"}}}}},"description":"Render a non-sending lifecycle email preview and capture dry-run analytics.","summary":"Dry-run lifecycle marketing workflow","tags":["Admin - Lifecycle Marketing"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleMarketingDryRunRequest"}}}}}},"/jobs/{jobId}":{"get":{"operationId":"GetJob","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"},"examples":{"Example 1":{"value":{"jobId":"123e4567-e89b-12d3-a456-426614174000","status":"completed","progress":100,"createdAt":"2024-01-01T00:00:00.000Z","processedAt":"2024-01-01T00:00:01.000Z","finishedAt":"2024-01-01T00:00:05.000Z","result":{"provider":"openai","modelName":"gpt-4.1-mini","prompt":"Hello","response":"Hi there!","timestamp":"2024-01-01T00:00:00.000Z"}}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobNotFoundError"}}}}},"description":"Get job information\nGet the current status, progress, and result (if available) of an async job","tags":["Job Management"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/invitations":{"post":{"operationId":"InviteUserToArticle","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteUserResponse"}}}}},"description":"Invite a user to an article by email","summary":"Invite user to article","tags":["Article Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteUserRequest"}}}}},"get":{"operationId":"GetArticleInvitations","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Invitation"},"type":"array"}}}}},"description":"Get all pending invitations for an article","summary":"List article invitations","tags":["Article Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/invitations/{email}":{"delete":{"operationId":"RevokeInvitation","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteInvitationResponse"}}}}},"description":"Revoke an invitation","summary":"Revoke invitation","tags":["Article Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"email","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateInvitationPermission","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvitationResponse"}}}}},"description":"Update the permission on a pending invitation","summary":"Update invitation permission","tags":["Article Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"email","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvitationRequest"}}}}}},"/invitations":{"get":{"operationId":"GetUserInvitations","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Invitation"},"type":"array"}}}}},"description":"Get all pending invitations for the authenticated user","summary":"List user's invitations","tags":["Invitations"],"security":[{"jwt":[]}],"parameters":[]}},"/invitations/accept":{"post":{"operationId":"AcceptInvitation","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationResponse"}}}}},"description":"Accept an invitation","summary":"Accept invitation","tags":["Invitations"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationRequest"}}}}}},"/invitations/reject":{"post":{"operationId":"RejectInvitation","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectInvitationResponse"}}}}},"description":"Reject an invitation","summary":"Reject invitation","tags":["Invitations"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectInvitationRequest"}}}}}},"/workspaces/{workspaceId}/invitations":{"post":{"operationId":"InviteUserToWorkspace","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteUserResponse"}}}}},"description":"Invite a user to a workspace by email","summary":"Invite user to workspace","tags":["Workspace Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteUserRequest"}}}}},"get":{"operationId":"GetWorkspaceInvitations","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Invitation"},"type":"array"}}}}},"description":"Get all pending invitations for a workspace","summary":"List workspace invitations","tags":["Workspace Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/invitations/{email}":{"delete":{"operationId":"RevokeWorkspaceInvitation","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteInvitationResponse"}}}}},"description":"Revoke a workspace invitation","summary":"Revoke workspace invitation","tags":["Workspace Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"email","required":true,"schema":{"type":"string"}}]}},"/images/search":{"post":{"operationId":"SearchImages","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ImageSearchResponse"},{"$ref":"#/components/schemas/MultiProviderImageSearchResponse"}]}}}}},"description":"Search for images from image providers (Unsplash, Giphy, Pixabay)\n\nWhen provider is not specified, searches all providers in parallel and returns combined results.\nWhen provider is specified, searches only that provider.","summary":"Search for images across multiple providers","tags":["Image Services"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"description":"Search parameters including query, optional provider, limit, and size","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageSearchRequest","description":"Search parameters including query, optional provider, limit, and size"}}}}}},"/workspaces/{workspaceId}/google-drive-sync/{connectionId}":{"get":{"operationId":"GetConfig","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveSyncConfig"}}}}},"tags":["Google Drive Sync"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/google-drive-sync/{connectionId}/folders":{"get":{"operationId":"ListFolders","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveFolderListResponse"}}}}},"tags":["Google Drive Sync"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}},{"in":"query","name":"parentId","required":false,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/google-drive-sync/{connectionId}/root/preview":{"post":{"operationId":"PreviewRoot","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveRootPreview"}}}}},"tags":["Google Drive Sync"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveRootRequest"}}}}}},"/workspaces/{workspaceId}/google-drive-sync/{connectionId}/root":{"post":{"operationId":"SelectRoot","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveSyncConfig"}}}}},"tags":["Google Drive Sync"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveRootRequest"}}}}}},"/workspaces/{workspaceId}/google-drive-sync/{connectionId}/pause":{"post":{"operationId":"SetPaused","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveSyncConfig"}}}}},"tags":["Google Drive Sync"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDrivePauseRequest"}}}}}},"/workspaces/{workspaceId}/google-drive-sync/{connectionId}/pull":{"post":{"operationId":"Pull","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDrivePullResponse"}}}}},"tags":["Google Drive Sync"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDrivePullRequest"}}}}}},"/workspaces/{workspaceId}/google-drive-sync/{connectionId}/cursor/ack":{"post":{"operationId":"AcknowledgeCursor","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveSyncConfig"}}}}},"tags":["Google Drive Sync"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveCursorAckRequest"}}}}}},"/workspaces/{workspaceId}/google-drive-sync/{connectionId}/mutations":{"post":{"operationId":"Push","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDrivePushReceipt"}}}}},"tags":["Google Drive Sync"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveMutation"}}}}}},"/connect/github/token":{"post":{"operationId":"GetConnectToken","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubTokenResponse"}}}}},"description":"Exchange GitHub OAuth code for access token (connect flow)","summary":"Get GitHub OAuth access token for connect flow","tags":["GitHub OAuth"],"security":[],"parameters":[{"in":"query","name":"code","required":true,"schema":{"type":"string"}}]}},"/oauth/github/token":{"post":{"operationId":"GetTokenAlias","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubTokenResponse"}}}}},"description":"Exchange GitHub OAuth code for access token (oauth flow)","summary":"Get GitHub OAuth access token for oauth flow","tags":["GitHub OAuth"],"security":[],"parameters":[]},"get":{"operationId":"GetJwksAlias","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{}}}}},"description":"OIDC jwks_uri endpoint (alias; used by the mdedit pool).","tags":["GitHub OAuth"],"security":[],"parameters":[]}},"/oauth/github/token/{appKey}":{"post":{"operationId":"GetTokenForApp","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubTokenResponse"}}}}},"tags":["GitHub OAuth"],"security":[],"parameters":[{"in":"path","name":"appKey","required":true,"schema":{"type":"string"}}]},"get":{"operationId":"GetJwks","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{}}}}},"description":"OIDC jwks_uri endpoint (app-scoped).","tags":["GitHub OAuth"],"security":[],"parameters":[{"in":"path","name":"appKey","required":true,"schema":{"type":"string"}}]}},"/oauth/github/user-info":{"get":{"operationId":"GetUserInfo","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubUserInfoResponse"}}}}},"description":"Get GitHub user information using access token","summary":"Get GitHub user info","tags":["GitHub OAuth"],"security":[],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/folders/{folderId}/permissions":{"get":{"operationId":"GetFolderPermissions","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Permission"},"type":"array"}}}}},"description":"Get all permissions for a folder","summary":"List all users with access to this folder","tags":["Folder Permissions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"folderId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/folders/{folderId}/permissions/{permissionUsername}":{"put":{"operationId":"UpdateFolderPermission","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolderPermissionResponse"}}}}},"description":"Update or create a folder permission","summary":"Grant or update access to a folder","tags":["Folder Permissions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"folderId","required":true,"schema":{"type":"string"}},{"in":"path","name":"permissionUsername","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"permission":{"type":"string","enum":["read","write"]}},"required":["permission"],"type":"object"}}}}},"delete":{"operationId":"RevokePermission","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteFolderPermissionResponse"}}}}},"description":"Revoke folder access","summary":"Remove a user's access to a folder","tags":["Folder Permissions"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"folderId","required":true,"schema":{"type":"string"}},{"in":"path","name":"permissionUsername","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/folders/{folderId}/invitations":{"post":{"operationId":"InviteToFolder","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFolderInvitationResponse"}}}}},"description":"Invite a user to a folder","summary":"Send an invitation to access a folder","tags":["Folder Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"folderId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFolderInvitationRequest"}}}}},"get":{"operationId":"GetFolderInvitations","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Invitation"},"type":"array"}}}}},"description":"Get all pending invitations for a folder","summary":"List all pending invitations for this folder","tags":["Folder Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"folderId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/folders/{folderId}/invitations/{email}":{"delete":{"operationId":"RevokeInvitation","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteFolderInvitationResponse"}}}}},"description":"Revoke a folder invitation","summary":"Delete a pending invitation","tags":["Folder Invitations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"folderId","required":true,"schema":{"type":"string"}},{"in":"path","name":"email","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/folders":{"post":{"operationId":"CreateFolder","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFolderResponse"}}}}},"description":"Create a new folder in workspace","summary":"Create folder","tags":["Folders"],"security":[{"jwt":["OR"]},{"apiKey":["folders:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/folders:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFolderRequest"}}}}},"get":{"operationId":"GetFolders","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Folder"},"type":"array"}}}}},"description":"Get all folders in workspace","summary":"Get folders","tags":["Folders"],"security":[{"jwt":["OR"]},{"apiKey":["folders:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/folders:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"includeDeleted","required":false,"schema":{"type":"boolean"}}]}},"/workspaces/{workspaceId}/folders/{folderId}":{"get":{"operationId":"GetFolder","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}}},"description":"Get folder details by ID","summary":"Get folder","tags":["Folders"],"security":[{"jwt":["OR"]},{"apiKey":["folders:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/folders:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"folderId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateFolder","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderMessageResponse"}}}}},"description":"Update folder metadata","summary":"Update folder","tags":["Folders"],"security":[{"jwt":["OR"]},{"apiKey":["folders:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/folders:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"folderId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolderRequest"}}}}},"delete":{"operationId":"DeleteFolder","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderMessageResponse"}}}}},"description":"Delete a folder","summary":"Delete folder","tags":["Folders"],"security":[{"jwt":["OR"]},{"apiKey":["folders:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/folders:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"folderId","required":true,"schema":{"type":"string"}}]}},"/shared-folders":{"get":{"operationId":"GetSharedFolders","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"allOf":[{"$ref":"#/components/schemas/Folder"},{"properties":{"userPermission":{"type":"string","enum":["read","write"]}},"required":["userPermission"],"type":"object"}]},"type":"array"}}}}},"description":"Get all folders shared with the authenticated user","summary":"List shared folders","tags":["Folders"],"security":[{"jwt":["OR"]},{"apiKey":["folders:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/folders:read"]}],"parameters":[]}},"/workspaces/{workspaceId}/publication-destinations":{"get":{"operationId":"ListDestinations","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PublicationDestination"},"type":"array"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"CreateDestination","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationDestination"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicationDestinationRequest"}}}}}},"/workspaces/{workspaceId}/publication-destinations/{destinationId}":{"delete":{"operationId":"DeleteDestination","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean","enum":[true],"nullable":false}},"required":["success"],"type":"object"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"destinationId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateDestination","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationDestination"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"destinationId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicationDestinationRequest"}}}}}},"/workspaces/{workspaceId}/publication-destinations/github/install-info":{"get":{"operationId":"GetGitHubInstallInfo","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubPublicationInstallInfo"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/publication-destinations/{destinationId}/test":{"post":{"operationId":"TestDestination","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestPublicationDestinationResponse"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"destinationId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/external-connections/{connectionId}/github/repositories":{"get":{"operationId":"ListGitHubRepositories","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubPublicationPage_GitHubRepositorySummary_"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"format":"double","type":"number"}},{"in":"query","name":"perPage","required":false,"schema":{"format":"double","type":"number"}}]}},"/workspaces/{workspaceId}/external-connections/{connectionId}/github/branches":{"get":{"operationId":"ListGitHubBranches","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubPublicationPage_GitHubBranchSummary_"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}},{"in":"query","name":"repoFullName","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"format":"double","type":"number"}},{"in":"query","name":"perPage","required":false,"schema":{"format":"double","type":"number"}}]}},"/workspaces/{workspaceId}/external-connections/{connectionId}/github/repository-profile":{"get":{"operationId":"DetectGitHubRepositoryProfile","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubRepositoryDetectionResult"}}}}},"description":"The publishing profile the repository's own layout implies, so the connect\nflow can preselect a site framework and content folder.","tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}},{"in":"query","name":"repoFullName","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/external-publications":{"get":{"operationId":"ListWorkspacePublications","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ExternalPublication"},"type":"array"}}}}},"description":"List every external publication in the workspace, across all articles.","tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/external-publications":{"get":{"operationId":"ListPublications","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ExternalPublication"},"type":"array"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"CreatePublication","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnqueueExternalPublicationResponse"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExternalPublicationRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/external-publications/preview":{"post":{"operationId":"Preview","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewExternalPublicationResponse"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewExternalPublicationRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/external-publications/{publicationId}/publish":{"post":{"operationId":"Publish","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnqueueExternalPublicationResponse"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"publicationId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"publishAt":{"type":"string"},"requestedStatus":{"type":"string","enum":["draft","live","scheduled"]}},"type":"object"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/external-publications/{publicationId}/cancel-schedule":{"post":{"operationId":"CancelSchedule","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnqueueExternalPublicationResponse"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"publicationId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/external-publications/{publicationId}/primary":{"put":{"operationId":"SetPrimary","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalPublication"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"publicationId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/external-publications/{publicationId}/refresh":{"post":{"operationId":"RefreshPublication","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshExternalPublicationResponse"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"publicationId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/external-publications/jobs/{jobId}":{"get":{"operationId":"GetJob","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalPublicationJob"}}}}},"tags":["External Publications"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/external-connections":{"get":{"operationId":"ListConnections","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ExternalConnection"},"type":"array"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"capability","required":false,"schema":{"$ref":"#/components/schemas/ExternalConnectionCapability"}},{"in":"query","name":"provider","required":false,"schema":{"$ref":"#/components/schemas/ExternalProvider"}}]},"post":{"operationId":"CreateConnection","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalConnection"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExternalConnectionRequest"}}}}}},"/workspaces/{workspaceId}/external-connections/google/oauth/start":{"post":{"operationId":"StartGoogleOAuth","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalConnectionOAuthStartResponse"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalConnectionOAuthStartRequest"}}}}}},"/workspaces/{workspaceId}/external-connections/google-drive/oauth/start":{"post":{"operationId":"StartGoogleDriveOAuth","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalConnectionOAuthStartResponse"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveExternalConnectionOAuthStartRequest"}}}}}},"/workspaces/{workspaceId}/external-connections/github/oauth/start":{"post":{"operationId":"StartGitHubOAuth","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalConnectionOAuthStartResponse"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalConnectionOAuthStartRequest"}}}}}},"/workspaces/{workspaceId}/external-connections/x/oauth/start":{"post":{"operationId":"StartXOAuth","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalConnectionOAuthStartResponse"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XExternalConnectionOAuthStartRequest"}}}}}},"/workspaces/{workspaceId}/external-connections/github/app/install/start":{"post":{"operationId":"StartGitHubAppInstall","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubAppInstallStartResponse"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubAppInstallStartRequest"}}}}}},"/workspaces/{workspaceId}/external-connections/google/oauth/callback":{"get":{"operationId":"GoogleOAuthCallback","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExternalConnectionOAuthCallbackResponse"},{}]}}}}},"tags":["External Connections"],"security":[],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"code","required":true,"schema":{"type":"string"}},{"in":"query","name":"state","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/external-connections/{connectionId}":{"delete":{"operationId":"DeleteConnection","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean","enum":[true],"nullable":false}},"required":["success"],"type":"object"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateConnection","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalConnection"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExternalConnectionRequest"}}}}}},"/workspaces/{workspaceId}/external-connections/{connectionId}/refresh-resources":{"post":{"operationId":"RefreshResources","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalConnection"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/external-connections/github/gists":{"post":{"operationId":"CreateGitHubGist","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubGistResponse"}}}}},"tags":["External Connections"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGitHubGistRequest"}}}}}},"/external-connections/google/oauth/callback":{"get":{"operationId":"GoogleOAuthCallback","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExternalConnectionOAuthCallbackResponse"},{}]}}}}},"tags":["External Connections"],"security":[],"parameters":[{"in":"query","name":"code","required":true,"schema":{"type":"string"}},{"in":"query","name":"state","required":true,"schema":{"type":"string"}},{"in":"query","name":"mode","required":false,"schema":{"type":"string"}}]}},"/external-connections/google-drive/oauth/callback":{"get":{"operationId":"GoogleDriveOAuthCallback","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExternalConnectionOAuthCallbackResponse"},{}]}}}}},"tags":["External Connections"],"security":[],"parameters":[{"in":"query","name":"code","required":true,"schema":{"type":"string"}},{"in":"query","name":"state","required":true,"schema":{"type":"string"}},{"in":"query","name":"mode","required":false,"schema":{"type":"string"}}]}},"/external-connections/github/oauth/callback":{"get":{"operationId":"GithubOAuthCallback","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExternalConnectionOAuthCallbackResponse"},{}]}}}}},"tags":["External Connections"],"security":[],"parameters":[{"in":"query","name":"code","required":true,"schema":{"type":"string"}},{"in":"query","name":"state","required":true,"schema":{"type":"string"}},{"in":"query","name":"mode","required":false,"schema":{"type":"string"}}]}},"/external-connections/x/oauth/callback":{"get":{"operationId":"XOAuthCallback","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExternalConnectionOAuthCallbackResponse"},{}]}}}}},"tags":["External Connections"],"security":[],"parameters":[{"in":"query","name":"code","required":true,"schema":{"type":"string"}},{"in":"query","name":"state","required":true,"schema":{"type":"string"}},{"in":"query","name":"mode","required":false,"schema":{"type":"string"}}]}},"/external-connections/github/app/install/callback":{"get":{"operationId":"GithubAppInstallCallback","responses":{"204":{"description":"No content"}},"tags":["External Connections"],"security":[],"parameters":[{"in":"query","name":"installation_id","required":true,"schema":{"type":"string"}},{"in":"query","name":"state","required":true,"schema":{"type":"string"}},{"in":"query","name":"setup_action","required":false,"schema":{"type":"string"}}]}},"/entitlements/status":{"get":{"operationId":"GetEntitlementsStatus","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementsStatusResponse"}}}}},"description":"Get backend-owned entitlement status and frontend-safe catalog for the authenticated user.","tags":["Entitlements"],"security":[{"jwt":[]}],"parameters":[]}},"/admin/email/send":{"post":{"operationId":"SendEmail","responses":{"202":{"description":"Email job accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponse"}}}}},"description":"Queue a source-controlled product email (Admin only).\nSender, Reply-To, configuration set, subject, HTML, and text are resolved server-side.","summary":"Queue a product email","tags":["Admin - Email"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailRequest"}}}}}},"/workspaces/{workspaceId}/content-projects/{contentProjectId}/performance":{"get":{"operationId":"GetContentProjectPerformance","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentProjectPerformanceResponse"}}}}},"tags":["Cowrite Performance"],"security":[{"jwt":["OR"]},{"apiKey":["performance:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/performance:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}},{"in":"query","name":"domain","required":false,"schema":{"type":"string"}},{"in":"query","name":"status","required":false,"schema":{"$ref":"#/components/schemas/ContentPerformanceRollupStatus"}},{"in":"query","name":"startDate","required":false,"schema":{"type":"string"}},{"in":"query","name":"endDate","required":false,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/performance/overview":{"get":{"operationId":"GetWorkspacePerformanceOverview","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePerformanceOverviewResponse"}}}}},"tags":["Cowrite Performance"],"security":[{"jwt":["OR"]},{"apiKey":["performance:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/performance:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"contentProjectId","required":false,"schema":{"type":"string"}},{"in":"query","name":"domain","required":false,"schema":{"type":"string"}},{"in":"query","name":"status","required":false,"schema":{"$ref":"#/components/schemas/ContentPerformanceRollupStatus"}},{"in":"query","name":"startDate","required":false,"schema":{"type":"string"}},{"in":"query","name":"endDate","required":false,"schema":{"type":"string"}}]}},"/conversions/uploads":{"post":{"operationId":"CreateUploadUrl","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolUploadResponse"},"examples":{"Example 1":{"value":{"signedUrl":"https://s3.amazonaws.com/bucket/tools/input/<jobId>/input.md?...","expiresInSeconds":300}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Create a presigned S3 PUT URL for a conversion input.\nUpload the file to this URL, then POST the same key to `/conversions`.","tags":["Conversions"],"security":[{"jwt":["OR"]},{"apiKey":["conversions:execute"]},{"oauth2":["https://apiv2.mdedit.ai/api/conversions:execute"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolUploadRequest"}}}}}},"/conversions":{"post":{"operationId":"CreateConversion","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionResponse"},"examples":{"Example 1":{"value":{"jobId":"123e4567-e89b-12d3-a456-426614174000","statusUrl":"/api/conversions/123e4567-e89b-12d3-a456-426614174000","conversion":{"type":"pandoc","inputFormat":"markdown","outputFormat":"docx"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Quota exceeded","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Input file not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"409":{"description":"Job already exists","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"413":{"description":"Input file too large","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Start a conversion for an already-uploaded input.\nPoll `/conversions/{jobId}` until the status is `completed`.","tags":["Conversions"],"security":[{"jwt":["OR"]},{"apiKey":["conversions:execute"]},{"oauth2":["https://apiv2.mdedit.ai/api/conversions:execute"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionRequest"}}}}}},"/conversions/{jobId}":{"get":{"operationId":"GetConversion","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolJobStatusResponse"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Get the status of a conversion, including a short-lived download URL once\nit completes.","tags":["Conversions"],"security":[{"jwt":["OR"]},{"apiKey":["conversions:execute"]},{"oauth2":["https://apiv2.mdedit.ai/api/conversions:execute"]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}]}},"/conversions/{jobId}/download":{"get":{"operationId":"DownloadConversion","responses":{"200":{"description":"Ok","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/NodeJS.ReadableStream"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"409":{"description":"Job not completed","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Download a completed conversion, proxied through the API so callers do not\nhave to follow a presigned S3 URL.","tags":["Conversions"],"security":[{"jwt":["OR"]},{"apiKey":["conversions:execute"]},{"oauth2":["https://apiv2.mdedit.ai/api/conversions:execute"]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/conversations":{"get":{"operationId":"ListConversationsByScope","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedConversationsResponse"}}}},"400":{"description":"Missing required query parameters","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"List conversations for a given scope within a workspace.\n\nQuery parameters:\n - `scopeType` – type of scope, e.g. `article`, `folder`, or `workspace`\n - `scopeId`   – identifier of the scope (articleId, folderId, workspaceId, …)\n - `limit`     – maximum number of results (default 20)\n - `nextToken` – opaque pagination cursor returned by a previous call","tags":["Conversations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"scopeType","required":true,"schema":{"type":"string"}},{"in":"query","name":"scopeId","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"format":"double","type":"number"}},{"in":"query","name":"nextToken","required":false,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/conversations/{conversationId}":{"get":{"operationId":"GetConversation","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetailResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Conversation Not Found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Get a single conversation by ID (workspace-scoped access check).","tags":["Conversations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"conversationId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/conversations/{conversationId}/messages":{"post":{"operationId":"AppendMessages","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetailResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Conversation Not Found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Append externally executed messages to a conversation.\n\nUsed by desktop-local execution where the backend owns conversation history\nbut does not execute the model request.","tags":["Conversations"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"conversationId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendConversationMessagesRequest"}}}}}},"/content-projects/{contentProjectId}/topics/generate":{"post":{"operationId":"GenerateTopics","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateTopicsResponse"}}}}},"description":"Trigger async AI topic generation for a content project.\n\nEnqueues a `topic_research` agent run via BullMQ and returns immediately.\nReturns 409 if a topic research run is already in-flight for this project.","summary":"Generate topics (async)","tags":["Topics"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateTopicsRequest"}}}}}},"/content-projects/prefill":{"post":{"operationId":"PrefillContentProject","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPrefillResponse"}}}}},"description":"Queue a draft-only project profile generated from public website evidence.\nThis endpoint never creates or updates a content project.","summary":"Draft content project profile from URL","tags":["Content Projects"],"security":[{"jwt":["OR"]},{"apiKey":["projects:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/projects:write"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPrefillRequest"}}}}}},"/content-projects":{"post":{"operationId":"CreateContentProject","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContentProjectResponse"}}}}},"description":"Create a new content project (folder with folderType = 'content_project')","summary":"Create content project","tags":["Content Projects"],"security":[{"jwt":["OR"]},{"apiKey":["projects:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/projects:write"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContentProjectRequest"}}}}},"get":{"operationId":"ListContentProjects","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ContentProjectFolder"},"type":"array"}}}}},"description":"List all content projects in a workspace","summary":"List content projects","tags":["Content Projects"],"security":[{"jwt":["OR"]},{"apiKey":["projects:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/projects:read"]}],"parameters":[{"in":"query","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"includeDeleted","required":false,"schema":{"type":"boolean"}}]}},"/content-projects/short-id/{workspaceId}/{shortId}":{"get":{"operationId":"GetContentProjectByShortId","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentProjectFolder"}}}}},"tags":["Content Projects"],"security":[{"jwt":["OR"]},{"apiKey":["projects:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/projects:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"shortId","required":true,"schema":{"type":"string"}}]}},"/content-projects/{contentProjectId}":{"get":{"operationId":"GetContentProject","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentProjectFolder"}}}}},"description":"Get a content project by ID","summary":"Get content project","tags":["Content Projects"],"security":[{"jwt":["OR"]},{"apiKey":["projects:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/projects:read"]}],"parameters":[{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateContentProject","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentProjectMessageResponse"}}}}},"description":"Update a content project","summary":"Update content project","tags":["Content Projects"],"security":[{"jwt":["OR"]},{"apiKey":["projects:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/projects:write"]}],"parameters":[{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContentProjectRequest"}}}}},"delete":{"operationId":"DeleteContentProject","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteContentProjectResponse"}}}}},"description":"Delete a content project","summary":"Delete content project","tags":["Content Projects"],"security":[{"jwt":["OR"]},{"apiKey":["projects:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/projects:write"]}],"parameters":[{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}}]}},"/content-projects/{contentProjectId}/archive":{"put":{"operationId":"ArchiveContentProject","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveContentProjectResponse"}}}}},"description":"Archive a content project and all active topics in it.","summary":"Archive content project","tags":["Content Projects"],"security":[{"jwt":["OR"]},{"apiKey":["projects:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/projects:write"]}],"parameters":[{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}}]}},"/content-projects/{contentProjectId}/restore":{"put":{"operationId":"RestoreContentProject","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreContentProjectResponse"}}}}},"description":"Restore an archived content project and the topics archived by that project archive.","summary":"Restore content project","tags":["Content Projects"],"security":[{"jwt":["OR"]},{"apiKey":["projects:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/projects:write"]}],"parameters":[{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}}]}},"/connected-accounts":{"get":{"operationId":"ListConnectedAccounts","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListConnectedAccountsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"List all supported Arcade providers and their connection status for the current user.\n\nProvider statuses are resolved independently — a failure for one provider returns\nstatus \"unknown\" rather than failing the entire response.","summary":"List connected Arcade accounts","tags":["Connected Accounts"],"security":[{"jwt":[]}],"parameters":[]}},"/connected-accounts/{providerKey}/authorize":{"post":{"operationId":"StartAuthorization","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartAuthorizationResult"}}}},"400":{"description":"Unsupported provider","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid returnTo path","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Arcade unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Start an OAuth authorization flow for the specified Arcade provider.\n\nIf the provider is already connected, returns `status: \"completed\"` without\nstarting a new flow. Otherwise returns the URL the user should be redirected to.\n\nRate limited to 5 requests per 10 minutes per user per provider.","summary":"Start Arcade OAuth authorization","tags":["Connected Accounts"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"providerKey","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartAuthorizationRequest"}}}}}},"/connected-accounts/{connectionId}":{"delete":{"operationId":"DisconnectConnectedAccount","responses":{"204":{"description":"No content"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Arcade unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Disconnect a connected Arcade account by its Arcade connection ID.\n\nThe `connectionId` is returned by `GET /connected-accounts` in the `connectionId`\nfield of each provider. Verifies the connection belongs to the current user\nbefore deletion.","summary":"Disconnect a connected Arcade account","tags":["Connected Accounts"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"connectionId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/collaboration/status":{"get":{"operationId":"GetCollaborationStatus","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollaborationStatusResponse"}}}}},"description":"Get collaboration status for an article.","tags":["Collaboration"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/collaboration/enable":{"post":{"operationId":"Enable","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollaborationEnableResponse"}}}}},"description":"Enable real-time collaborative editing for an article.","tags":["Collaboration"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/collaboration/checkpoint":{"post":{"operationId":"Checkpoint","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollaborationCheckpointResponse"}}}}},"description":"Materialize the current collaborative Yjs state into the article package.","tags":["Collaboration"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/tools/code-typing-animation":{"post":{"operationId":"Create","responses":{"202":{"description":"Animation queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeTypingAnimationStartResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Animation quota exhausted","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Queue a private code typing animation render.","tags":["Tools"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeTypingAnimationRequest"}}}}}},"/tools/code-typing-animation/{jobId}":{"get":{"operationId":"GetAnimationStatus","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeTypingAnimationJobStatusResponse"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Get progress and artifact links for an animation owned by the current user.","tags":["Tools"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}]}},"/tools/code-typing-animation/{jobId}/download":{"get":{"operationId":"Download","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeTypingAnimationDownloadResponse"}}}},"400":{"description":"Invalid format","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Job or artifact not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"409":{"description":"Job not completed","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Create a short-lived download URL for one completed private artifact.","tags":["Tools"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}},{"in":"query","name":"format","required":true,"schema":{"$ref":"#/components/schemas/CodeTypingAnimationArtifactFormat"}}]}},"/content-projects/{contentProjectId}/calendar/generate":{"post":{"operationId":"GenerateCalendar","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateCalendarResult"}}}}},"description":"Generate (or regenerate) the calendar schedule for a set of topics.\n\n- Caps `topicIds` at 25 per call.\n- Assigns dates deterministically based on `cadence` + `startDate`.\n- Bulk-updates `scheduledDate` on the referenced topics transactionally.\n- Only topics with status `shortlisted`, `outlined`, or `drafted` are eligible.","summary":"Generate calendar","tags":["Calendar"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateCalendarRequest"}}}}}},"/content-projects/{contentProjectId}/calendar":{"get":{"operationId":"GetCalendar","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateCalendarResult"}}}}},"description":"Get the current calendar view for a content project.\n\nReturns all topics that have a `scheduledDate` set and are not `archived`,\nsorted ascending by `scheduledDate`.","summary":"Get calendar","tags":["Calendar"],"security":[{"jwt":["OR"]},{"apiKey":["topics:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:read"]}],"parameters":[{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}}]}},"/content-projects/{contentProjectId}/calendar/entries/{topicId}":{"put":{"operationId":"UpdateCalendarEntry","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEntry"}}}}},"description":"Update or clear the schedule for a single calendar entry (topic).\n\n- Pass `null` for `scheduledDate` or `scheduleNote` to remove the field.\n- Archived topics cannot be rescheduled.","summary":"Update calendar entry","tags":["Calendar"],"security":[{"jwt":["OR"]},{"apiKey":["topics:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/topics:write"]}],"parameters":[{"in":"path","name":"contentProjectId","required":true,"schema":{"type":"string"}},{"in":"path","name":"topicId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCalendarEntryRequest"}}}}}},"/assistant/context/resolve":{"post":{"operationId":"Resolve","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveAssistantContextResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"tags":["AI Assistant Context"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveAssistantContextRequestBody"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/review":{"get":{"operationId":"GetReview","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetArticleReviewResponse"}}}}},"description":"Get the review JSON for an article.","summary":"Get article review","tags":["Article Review"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read","reviews:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read","https://apiv2.mdedit.ai/api/reviews:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/review-upload-url":{"post":{"operationId":"GetReviewUploadUrl","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleReviewUploadUrlResponse"}}}}},"description":"Get a presigned upload URL for review.json.","summary":"Get article review upload URL","tags":["Article Review"],"security":[{"jwt":["OR"]},{"apiKey":["reviews:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/reviews:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleReviewUploadUrlRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/review-commit":{"post":{"operationId":"CommitReview","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticlePackageCommitResponse"}}}}},"description":"Commit a pending review.json upload.","summary":"Commit article review","tags":["Article Review"],"security":[{"jwt":["OR"]},{"apiKey":["reviews:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/reviews:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleReviewCommitRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/review-commands":{"post":{"operationId":"ApplyReviewCommands","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleReviewCommandsResponse"}}}}},"description":"Apply an idempotent, server-authored batch of review commands.","summary":"Apply article review commands","tags":["Article Review"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read","reviews:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read","https://apiv2.mdedit.ai/api/reviews:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleReviewCommandsRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/package":{"get":{"operationId":"GetPackage","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetArticlePackageResponse"}}}}},"description":"Get all markdown targets and review JSON for offline package sync.","summary":"Get article package","tags":["Article Review"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read","reviews:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read","https://apiv2.mdedit.ai/api/reviews:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/package-upload-urls":{"post":{"operationId":"GetPackageUploadUrls","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticlePackageUploadUrlsResponse"}}}}},"description":"Get presigned upload URLs for changed package targets.","summary":"Get article package upload URLs","tags":["Article Review"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticlePackageUploadUrlsRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/package-commit":{"post":{"operationId":"CommitPackage","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticlePackageCommitResponse"}}}}},"description":"Commit changed package targets and review JSON.","summary":"Commit article package","tags":["Article Review"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticlePackageCommitRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/presentation/media-urls":{"post":{"operationId":"CreateMediaUrls","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleMediaUrlsResponse"}}}}},"tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleMediaUrlsRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/presentation/gists":{"post":{"operationId":"GetGists","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleGistsResponse"}}}}},"tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleGistsRequest"}}}}}},"/article-media/{token}":{"get":{"operationId":"Proxy","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeJS.ReadableStream"}}}}},"tags":["Articles"],"security":[],"parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles":{"post":{"operationId":"CreateArticle","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateArticleResponse"}}}}},"description":"Create a new article","summary":"Create article","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateArticleRequest"}}}}},"get":{"operationId":"GetArticles","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Article"},"type":"array"}}}}},"description":"Get all articles in workspace","summary":"List articles","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"folderId","required":false,"schema":{"type":"string"}},{"in":"query","name":"tag","required":false,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/short-id/{shortId}":{"get":{"operationId":"GetArticleByShortId","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleWithContentResponse"}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"shortId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}":{"get":{"operationId":"GetArticle","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleWithContentResponse"}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Get article by ID (with content from S3)","summary":"Get article","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"UpdateArticle","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleMessageResponse"}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Update article metadata (with upsert - creates if doesn't exist)","summary":"Update article","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateArticleRequest"}}}}},"delete":{"operationId":"DeleteArticle","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleMessageResponse"}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Delete an article","summary":"Delete article","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/presentation":{"get":{"operationId":"GetArticlePresentation","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticlePresentationResponse"}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Resolve the narrow set of viewer preferences and permissions needed by an\narticle presentation surface. This intentionally does not expose the\ncaller's complete preferences document.","summary":"Get article presentation settings","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/export":{"post":{"operationId":"ExportArticle","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"conversion":{"properties":{"outputFormat":{"type":"string"},"inputFormat":{"type":"string"}},"required":["outputFormat","inputFormat"],"type":"object"},"statusUrl":{"type":"string"},"jobId":{"type":"string"}},"required":["conversion","statusUrl","jobId"],"type":"object"},"examples":{"Example 1":{"value":{"jobId":"123e4567-e89b-12d3-a456-426614174000","statusUrl":"/api/tools/jobs/123e4567-e89b-12d3-a456-426614174000","conversion":{"inputFormat":"markdown","outputFormat":"docx"}}}}}}},"400":{"description":"Invalid format","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Quota exceeded or permission denied","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Export article in various formats (async)","summary":"Export article","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"format":{"type":"string"}},"required":["format"],"type":"object"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/export/zip":{"get":{"operationId":"ExportArticleZip","responses":{"200":{"description":"Ok","content":{"application/zip":{"schema":{"$ref":"#/components/schemas/NodeJS.ReadableStream"}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundErrorResponse"}}}}},"description":"Export article as zip (DEPRECATED - use POST /export instead)","summary":"Export article as zip","tags":["Articles"],"deprecated":true,"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/content-upload-url":{"post":{"operationId":"GetContentUploadUrl","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleContentUploadUrlResponse"}}}}},"description":"Get presigned URL for content upload","summary":"Get content upload URL","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleContentUploadUrlRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/content-commit":{"post":{"operationId":"CommitContent","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleMessageResponse"}}}}},"description":"Commit a pending content upload if the caller's base revision still matches the server.","summary":"Commit article content","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleContentCommitRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/files/{fileName}":{"get":{"operationId":"GetMarkdownFile","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleMarkdownFileResponse"}}}}},"description":"Read an arbitrary markdown file under an article (e.g. outline.md, notes.md).","summary":"Get article markdown file","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"fileName","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"DeleteMarkdownFile","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleMessageResponse"}}}}},"description":"Delete a markdown file under an article.","summary":"Delete article markdown file","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"fileName","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/files/upload-url":{"post":{"operationId":"GetMarkdownUploadUrl","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleContentUploadUrlResponse"}}}}},"description":"Get presigned URL for uploading an arbitrary markdown file under an article.","summary":"Get article markdown upload URL","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleMarkdownUploadUrlRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/asset-upload-url":{"post":{"operationId":"GetAssetUploadUrl","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetUploadUrlResponse"}}}}},"description":"Get presigned URL for asset upload","summary":"Get asset upload URL","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetUploadUrlRequest"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/assets":{"get":{"operationId":"ListAssets","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetListResponse"}}}}},"description":"List all assets for article","summary":"List assets","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/assets/{fileName}":{"delete":{"operationId":"DeleteAsset","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleMessageResponse"}}}}},"description":"Delete an asset","summary":"Delete asset","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:write"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"fileName","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/assets/{fileName}/download-url":{"post":{"operationId":"GetAssetDownloadUrl","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetDownloadUrlResponse"}}}}},"description":"Get presigned download URL for a specific asset","summary":"Get asset download URL","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"fileName","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/assets/download-urls":{"post":{"operationId":"GetBatchAssetDownloadUrls","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchAssetDownloadUrlsResponse"}}}}},"description":"Get presigned download URLs for multiple assets (or all assets if fileNames not provided)","summary":"Get batch asset download URLs","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchAssetDownloadUrlsRequest"}}}}}},"/shared-articles":{"get":{"operationId":"GetSharedArticles","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SharedArticleResponse"},"type":"array"}}}}},"description":"Get all articles shared with the authenticated user","summary":"List shared articles","tags":["Articles"],"security":[{"jwt":["OR"]},{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[]}},"/workspaces/{workspaceId}/articles/{articleId}/chat":{"post":{"operationId":"Chat","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Article Not Found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Article-scoped AI chat (non-streaming).\nUse WebSocket for streaming responses.","tags":["Article AI"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleChatRequestBody"}}}}}},"/workspaces/{workspaceId}/articles/{articleId}/conversations":{"get":{"operationId":"GetConversations","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Article Not Found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Get recent conversations for an article.","tags":["Article AI"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}}]}},"/workspaces/{workspaceId}/articles/{articleId}/conversations/{conversationId}":{"get":{"operationId":"GetConversation","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetailResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"Conversation Not Found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Get a single conversation by ID.","tags":["Article AI"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"articleId","required":true,"schema":{"type":"string"}},{"in":"path","name":"conversationId","required":true,"schema":{"type":"string"}}]}},"/auth/arcade/confirm":{"post":{"operationId":"ConfirmArcadeAuth","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArcadeConfirmResponse"}}}}},"description":"Confirm Arcade user identity during a custom-verifier authorization flow.\n\nCalled by the frontend `/arcade/verify` page after the user is confirmed\nlogged in. Performs a server-to-server call to Arcade's `auth.confirmUser`\nAPI using our API key (never exposed to the browser) and returns the\n`next_uri` for the frontend to redirect to.","summary":"Confirm Arcade authorization flow","tags":["Arcade Auth"],"security":[{"jwt":["OR"]},{"apiKey":["integrations:write"]},{"oauth2":["https://apiv2.mdedit.ai/api/integrations:write"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArcadeConfirmRequest"}}}}}},"/api-keys":{"post":{"operationId":"CreateApiKey","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Create a new API key\nThe full API key is returned only once at creation time.\nStore it securely - it cannot be retrieved again.","summary":"Create new API key","tags":["API Keys"],"security":[{"jwt":["OR"]},{"apiKey":["keys:manage"]},{"oauth2":["https://apiv2.mdedit.ai/api/keys:manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}}},"get":{"operationId":"ListApiKeys","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"List all API keys for the authenticated user\nReturns masked keys with usage information","summary":"List user's API keys","tags":["API Keys"],"security":[{"jwt":["OR"]},{"apiKey":["keys:manage"]},{"oauth2":["https://apiv2.mdedit.ai/api/keys:manage"]}],"parameters":[]}},"/api-keys/{keyId}":{"get":{"operationId":"GetApiKey","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyDetails"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"API key not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Get details of a specific API key","summary":"Get API key details","tags":["API Keys"],"security":[{"jwt":["OR"]},{"apiKey":["keys:manage"]},{"oauth2":["https://apiv2.mdedit.ai/api/keys:manage"]}],"parameters":[{"in":"path","name":"keyId","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"RevokeApiKey","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeApiKeyResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"API key not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Revoke an API key\nRevoked keys cannot be used for authentication","summary":"Revoke API key","tags":["API Keys"],"security":[{"jwt":["OR"]},{"apiKey":["keys:manage"]},{"oauth2":["https://apiv2.mdedit.ai/api/keys:manage"]}],"parameters":[{"in":"path","name":"keyId","required":true,"schema":{"type":"string"}}]}},"/api-keys/{keyId}/delete":{"delete":{"operationId":"DeleteApiKey","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteApiKeyResponse"}}}},"400":{"description":"Key must be revoked or expired","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"404":{"description":"API key not found","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Permanently delete an API key\nOnly revoked or expired keys can be deleted.","summary":"Delete API key (permanent)","tags":["API Keys"],"security":[{"jwt":["OR"]},{"apiKey":["keys:manage"]},{"oauth2":["https://apiv2.mdedit.ai/api/keys:manage"]}],"parameters":[{"in":"path","name":"keyId","required":true,"schema":{"type":"string"}}]}},"/agent-runs":{"post":{"operationId":"CreateRun","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRunResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaExceededErrorResponse"}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Create a new agent run.\n\nValidates workspace/article permissions, enforces quota, creates the run\nrecord, and queues it for execution.\n\nSupports optional idempotency via the `Idempotency-Key` header (max 128\ncharacters).  When provided, duplicate requests with the same key and body\nare replayed from the stored result; requests with the same key but a\ndifferent body receive a 409 Conflict.\n\nArticle-scoped runs (`scopeType === 'article'` or `articleId` provided)\nrequire a valid `articleId`.  Folder- or workspace-scoped runs may omit\n`articleId` and supply `scopeType` + `scopeId` instead.","tags":["Agent Runs"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRunRequest"}}}}},"get":{"operationId":"ListRuns","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"List agent runs for the authenticated user.\n\nWhen `scopeType` + `scopeId` are supplied, the query uses the **ByScope**\nGSI and can be further narrowed by `runType` and/or `status`.  This is\nthe recommended path for scope-first clients (e.g. folder-level dashboards).\n\nWithout scope params the query falls back to the **ByUserAndStatus** GSI,\nwhich can be filtered by `status` and/or `articleId`.\n\nPagination is cursor-based: pass the `nextToken` from the previous response\nas the `nextToken` query parameter to retrieve the next page.","tags":["Agent Runs"],"security":[{"jwt":[]}],"parameters":[{"in":"query","name":"status","required":false,"schema":{"type":"string"}},{"in":"query","name":"articleId","required":false,"schema":{"type":"string"}},{"in":"query","name":"scopeType","required":false,"schema":{"type":"string"}},{"in":"query","name":"scopeId","required":false,"schema":{"type":"string"}},{"in":"query","name":"runType","required":false,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"format":"double","type":"number"}},{"in":"query","name":"nextToken","required":false,"schema":{"type":"string"}}]}},"/agent-runs/route":{"post":{"operationId":"RouteTask","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteAgentTaskResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Preview the dispatcher's routing decision for a free-text agent-mode\ninstruction without creating a run — the \"plan card\" propose-then-run\nflow. The client shows this decision (title, rationale, confidence) and\nlets the user Start it or Change to a different workflow before\n`POST /agent-runs` is called.","summary":"Preview agent task routing","tags":["Agent Runs"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteAgentTaskRequest"}}}}}},"/agent-runs/{runId}":{"get":{"operationId":"GetRun","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunStatusResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Run not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Get status and progress for a specific agent run.","tags":["Agent Runs"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"runId","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"CancelRun","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}}}},"400":{"description":"Run cannot be cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Run not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Cancel a running or paused agent run.","tags":["Agent Runs"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"runId","required":true,"schema":{"type":"string"}}]}},"/agent-runs/{runId}/resume":{"post":{"operationId":"ResumeRun","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunStatusResponse"}}}},"400":{"description":"Run is not in paused state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Run not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Resume a paused agent run, optionally applying state modifications.\n\nThe run must be in `paused` status. If `modifications` are provided they\nare passed to the workflow graph before re-queuing.","tags":["Agent Runs"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"runId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeAgentRunRequest"}}}}}},"/agent-runs/{runId}/retry":{"post":{"operationId":"RetryRun","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunStatusResponse"}}}},"400":{"description":"Run cannot be retried","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Run not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"A newer run owns the topic stage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Retry or restart a failed agent run.","tags":["Agent Runs"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"runId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryAgentRunRequest"}}}}}},"/agent-runs/{runId}/artifacts/{stepName}":{"get":{"operationId":"GetRunArtifact","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunArtifactResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Run or step not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Get the generated artifact (text content) for a completed step of an agent run.\n\nReturns the full markdown content produced by the named step (e.g. \"draft\",\n\"research\", \"outline\"). The run must be completed and the step must have\nfinished successfully.","tags":["Agent Runs"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"runId","required":true,"schema":{"type":"string"}},{"in":"path","name":"stepName","required":true,"schema":{"type":"string"}}]}},"/agent-analytics/events":{"post":{"operationId":"CaptureEvent","responses":{"202":{"description":"Agent analytics accepted","content":{"application/json":{"schema":{"properties":{"accepted":{"type":"boolean","enum":[true],"nullable":false}},"required":["accepted"],"type":"object"}}}}},"description":"Accept privacy-safe lifecycle events from an authenticated agent client.\nTool arguments, results, document data, and agent output are rejected.","summary":"Capture agent client lifecycle telemetry","tags":["Agent Analytics"],"security":[{"apiKey":["articles:read"]},{"oauth2":["https://apiv2.mdedit.ai/api/articles:read"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAnalyticsIngestRequest"}}}}}},"/agent-activity":{"get":{"operationId":"ListAgentActivity","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentActivityResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"List the caller's own agent activity, newest first.\nOnly writes performed by agents (API keys, OAuth clients, hosted MCP) are\nrecorded; human web-session actions never appear here.","summary":"List agent activity","tags":["Agent Activity"],"security":[{"jwt":["OR"]}],"parameters":[{"in":"query","name":"limit","required":false,"schema":{"format":"double","type":"number"}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}}]}},"/ai/credentials":{"get":{"operationId":"ListCredentials","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AICredentialSummary"},"type":"array"}}}}},"tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[]},"post":{"operationId":"SaveCredential","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AICredentialSummary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveAICredentialRequest"}}}}}},"/ai/credentials/test":{"post":{"operationId":"TestCredential","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestAICredentialResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestAICredentialRequest"}}}}}},"/ai/credentials/{credentialId}":{"delete":{"operationId":"DeleteCredential","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean","enum":[true],"nullable":false}},"required":["success"],"type":"object"}}}}},"tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[{"in":"path","name":"credentialId","required":true,"schema":{"type":"string"}}]}},"/ai/chat":{"post":{"operationId":"Chat","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleChatResponse"},"examples":{"Example 1":{"value":{"provider":"openai","modelName":"gpt-4.1-mini","prompt":"Explain quantum computing","response":"Quantum computing is a type of computation that...","timestamp":"2024-01-01T00:00:00.000Z"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Invalid API key - the provided API key is incorrect or unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidAPIKeyErrorResponse"}}}},"403":{"description":"Entitlement denied - AI funding not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementDeniedErrorResponse"}}}},"429":{"description":"API quota exceeded - user-provided API key has insufficient quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientQuotaErrorResponse"}}}}},"description":"Synchronous AI chat completion\nGet an immediate response from various AI providers (OpenAI, Anthropic, xAI, Gemini)","tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}}}},"/ai/chat/async":{"post":{"operationId":"ChatAsync","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobResponse"},"examples":{"Example 1":{"value":{"jobId":"123e4567-e89b-12d3-a456-426614174000","status":"queued","message":"Chat completion job has been queued","jobUrl":"/api/jobs/123e4567-e89b-12d3-a456-426614174000"}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Entitlement denied - AI funding not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementDeniedErrorResponse"}}}}},"description":"Asynchronous AI chat completion\nQueue a chat completion job for processing. Returns job ID immediately.","tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}}}},"/ai/generate-image":{"post":{"operationId":"GenerateImage","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageResponse"},"examples":{"Example 1":{"value":{"provider":"openai","modelName":"gpt-image-2","prompt":"A futuristic city skyline at sunset","size":"1024x1024","quality":"standard","n":1,"bucketType":"private","images":["https://mdh-bucket.s3.amazonaws.com/images/generated/uuid.png"],"usage":{"inputTokens":42,"outputTokens":1056,"inputTokensDetails":{"textTokens":42,"imageTokens":0}},"timestamp":"2024-01-01T00:00:00.000Z"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Invalid API key - the provided API key is incorrect or unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidAPIKeyErrorResponse"}}}},"403":{"description":"Entitlement denied - AI funding not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementDeniedErrorResponse"}}}},"429":{"description":"API quota exceeded - user-provided API key has insufficient quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientQuotaErrorResponse"}}}}},"description":"Synchronous image generation\nGenerate images using OpenAI GPT Image","tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageGenerationRequest"}}}}}},"/ai/generate-image/async":{"post":{"operationId":"GenerateImageAsync","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobResponse"},"examples":{"Example 1":{"value":{"jobId":"123e4567-e89b-12d3-a456-426614174000","status":"queued","message":"Image generation job has been queued","jobUrl":"/api/jobs/123e4567-e89b-12d3-a456-426614174000"}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"403":{"description":"Entitlement denied - AI funding not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementDeniedErrorResponse"}}}}},"description":"Asynchronous image generation\nQueue an image generation job. Returns job ID immediately.","tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageGenerationRequest"}}}}}},"/ai/generate-animation":{"post":{"operationId":"GenerateAnimation","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobResponse"},"examples":{"Example 1":{"value":{"jobId":"123e4567-e89b-12d3-a456-426614174000","status":"queued","message":"Animation job has been queued","jobUrl":"/api/jobs/123e4567-e89b-12d3-a456-426614174000"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Queue an animation job (Manim or code typing animation)\nReturns a job ID immediately. Poll GET /api/jobs/{jobId}/status for completion.","tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnimationGenerationRequest"}}}}}},"/ai/models":{"get":{"operationId":"GetModels","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsResponse"},"examples":{"Example 1":{"value":{"models":[{"provider":"openai","providerDisplayName":"OpenAI","displayName":"GPT-4.1 mini","name":"gpt-4.1-mini","type":"chat"},{"provider":"anthropic","providerDisplayName":"Anthropic","displayName":"Claude Sonnet 5","name":"claude-sonnet-5","type":"chat"}]}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Get available AI models\nReturns a list of all models with display names and provider information","tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[]}},"/ai/test-connection":{"post":{"operationId":"TestConnection","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionResponse"},"examples":{"Example 1":{"value":{"success":true,"provider":"openai","modelName":"gpt-4.1-mini","message":"Connection successful","responseTime":1234}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}}}}},"description":"Test API key connection\nValidates an API key by making a simple test request to the provider","tags":["AI Services"],"security":[{"jwt":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionRequest"}}}}}}},"servers":[{"url":"https://apiv2.mdedit.ai/api","description":"Production server"},{"url":"http://localhost:8080/api","description":"Development server"}]}