{"components":{"parameters":{"Cursor":{"in":"query","name":"cursor","schema":{"type":"string"}},"IdempotencyKey":{"description":"Required on spending POSTs (create job, approve). Replay stores the response for 24h.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}},"Limit":{"in":"query","name":"limit","schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},"OptionalIdempotencyKey":{"description":"Optional on reject. When present, replay stores the response for 24h.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string"}},"SiteId":{"in":"path","name":"siteId","required":true,"schema":{"format":"uuid","type":"string"}}},"responses":{"BadRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Invalid request or missing Idempotency-Key"},"Conflict":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Invalid job state or idempotency in progress"},"Forbidden":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Missing scope or plan"},"NotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Resource not found (also used for cross-org)"},"ServiceUnavailable":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"ENCRYPTION_KEY missing or dependency unavailable"},"TooManyRequests":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Rate limit, daily quota, or concurrency limit","headers":{"Retry-After":{"schema":{"type":"string"}}}},"Unauthenticated":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Missing or invalid API token"},"Unprocessable":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"BYOK missing, ack required, or idempotency key reused"}},"schemas":{"ApproveJobRequest":{"additionalProperties":false,"properties":{"factCheckAcknowledged":{"type":"boolean"},"languageAcknowledged":{"description":"Record that a person read the advisory language warnings. This never blocks Approve. It releases the Autopilot hold on an article that still has a warning.","type":"boolean"},"seoScoreAcknowledged":{"type":"boolean"}},"type":"object"},"Article":{"properties":{"createdAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"markdown":{"type":"string"},"publishedAt":{"format":"date-time","nullable":true,"type":"string"},"siteId":{"format":"uuid","type":"string"},"slug":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","siteId","slug","title","status"],"type":"object"},"ArticleEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/Article"}},"required":["data"],"type":"object"},"Brief":{"additionalProperties":true,"properties":{"brief":{"additionalProperties":true,"type":"object"},"cached":{"type":"boolean"},"confidence":{"type":"string"},"country":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"editedBrief":{"additionalProperties":true,"nullable":true,"type":"object"},"fetchedAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"keyword":{"type":"string"},"keywordId":{"format":"uuid","nullable":true,"type":"string"},"language":{"type":"string"},"llmCostUsd":{"nullable":true,"type":"number"},"locale":{"type":"string"},"organizationId":{"type":"string"},"provider":{"type":"string"},"providerCostUsd":{"type":"number"},"questions":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"serp":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"siteId":{"format":"uuid","type":"string"},"source":{"type":"string"},"status":{"type":"string"},"summary":{"nullable":true,"properties":{"caveats":{"items":{"type":"string"},"type":"array"},"derivedFrom":{"items":{"type":"string"},"type":"array"},"edited":{"type":"boolean"},"evidence":{"properties":{"pagesAttempted":{"nullable":true,"type":"integer"},"pagesRead":{"nullable":true,"type":"integer"},"resultsReturned":{"nullable":true,"type":"integer"},"serpRows":{"type":"integer"},"source":{"type":"string"},"status":{"type":"string"}},"required":["source","status","serpRows"],"type":"object"},"text":{"type":"string"},"truncated":{"type":"boolean"}},"required":["text","edited","evidence","caveats","derivedFrom"],"type":"object"},"updatedAt":{"format":"date-time","type":"string"},"warnings":{"items":{},"type":"array"}},"required":["id","siteId","keyword","locale","status","createdAt","updatedAt"],"type":"object"},"BriefEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/Brief"}},"required":["data"],"type":"object"},"BriefListEnvelope":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Brief"},"type":"array"},"hasMore":{"type":"boolean"},"nextCursor":{"nullable":true,"type":"string"}},"required":["data","hasMore"],"type":"object"},"CreateBriefRequest":{"additionalProperties":false,"properties":{"keyword":{"type":"string"},"keywordId":{"format":"uuid","type":"string"},"locale":{"type":"string"},"regenerate":{"type":"boolean"}},"required":["keyword"],"type":"object"},"CreateEventWebhookRequest":{"additionalProperties":false,"properties":{"description":{"maxLength":120,"type":"string"},"url":{"format":"uri","maxLength":2048,"type":"string"}},"required":["url"],"type":"object"},"CreateJobRequest":{"additionalProperties":false,"description":"Provide exactly one of topic, keywordId, pageUrl, or youtubeUrl.","properties":{"articleFormat":{"description":"Optional structure preset for this draft: `default` (today's generic outline), `how_to` (numbered steps under a \"How to …\" heading), `listicle` (quick answer, comparison table, numbered items) or `question_led` (answer first, reader questions as headings). Applied to the outline and draft only; never overrides fact, citation or disclosure rules. Not available for Amazon drafts.","enum":["default","how_to","listicle","question_led"],"type":"string"},"briefId":{"format":"uuid","type":"string"},"instructions":{"description":"Optional instructions for this article only, for example the audience, angle, required sections, or a closing note. Capped at 2,000 characters (counted per character, so CJK text fits too). Applied to the outline and draft; never overrides fact, citation, or disclosure rules. Returned on the job as `instructions`.","maxLength":2000,"type":"string"},"keywordId":{"format":"uuid","type":"string"},"locale":{"type":"string"},"pageUrl":{"format":"uri","type":"string"},"provider":{"enum":["openai","anthropic","openrouter"],"type":"string"},"topic":{"maxLength":300,"type":"string"},"youtubeUrl":{"type":"string"}},"type":"object"},"CreateKeywordRequest":{"additionalProperties":false,"properties":{"locale":{"type":"string"},"phrase":{"maxLength":300,"type":"string"},"priority":{"type":"integer"},"status":{"enum":["candidate","accepted","rejected","planned","published"],"type":"string"}},"required":["phrase"],"type":"object"},"Destination":{"properties":{"config":{"additionalProperties":true,"type":"object"},"id":{"format":"uuid","type":"string"},"label":{"type":"string"},"provider":{"type":"string"},"status":{"type":"string"}},"required":["id","provider","status","label"],"type":"object"},"DestinationListEnvelope":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Destination"},"type":"array"}},"required":["data"],"type":"object"},"Error":{"properties":{"code":{"type":"string"},"details":{"additionalProperties":true,"type":"object"},"docsUrl":{"type":"string"},"message":{"type":"string"},"param":{"nullable":true,"type":"string"},"requestId":{"type":"string"}},"required":["code","message","requestId"],"type":"object"},"ErrorEnvelope":{"properties":{"error":{"$ref":"#/components/schemas/Error"}},"required":["error"],"type":"object"},"EventWebhookCreateEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/EventWebhookCreateResult"}},"required":["data"],"type":"object"},"EventWebhookCreateResult":{"additionalProperties":false,"properties":{"endpoint":{"$ref":"#/components/schemas/EventWebhookEndpoint"},"secret":{"description":"One-time signing secret (`whsec_…`).","type":"string"}},"required":["endpoint","secret"],"type":"object"},"EventWebhookDelivery":{"additionalProperties":false,"properties":{"attempts":{"type":"integer"},"createdAt":{"format":"date-time","type":"string"},"deliveredAt":{"format":"date-time","nullable":true,"type":"string"},"deliveryId":{"type":"string"},"endpointId":{"format":"uuid","type":"string"},"event":{"enum":["job.completed","job.failed","job.needs_review","job.approved","job.rejected"],"type":"string"},"id":{"format":"uuid","type":"string"},"jobId":{"format":"uuid","nullable":true,"type":"string"},"lastError":{"nullable":true,"type":"string"},"responseCode":{"nullable":true,"type":"integer"},"status":{"enum":["pending","delivered","failed"],"type":"string"}},"required":["id","endpointId","deliveryId","event","status","attempts","createdAt"],"type":"object"},"EventWebhookDeliveryListEnvelope":{"properties":{"data":{"properties":{"deliveries":{"items":{"$ref":"#/components/schemas/EventWebhookDelivery"},"type":"array"}},"required":["deliveries"],"type":"object"}},"required":["data"],"type":"object"},"EventWebhookEndpoint":{"additionalProperties":false,"properties":{"createdAt":{"format":"date-time","type":"string"},"createdByEmail":{"nullable":true,"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"id":{"format":"uuid","type":"string"},"revokedAt":{"format":"date-time","nullable":true,"type":"string"},"secretLast4":{"type":"string"},"url":{"format":"uri","type":"string"}},"required":["id","url","description","secretLast4","enabled","createdAt"],"type":"object"},"EventWebhookEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/EventWebhookEndpoint"}},"required":["data"],"type":"object"},"EventWebhookListEnvelope":{"properties":{"data":{"properties":{"endpoints":{"items":{"$ref":"#/components/schemas/EventWebhookEndpoint"},"type":"array"}},"required":["endpoints"],"type":"object"}},"required":["data"],"type":"object"},"Job":{"additionalProperties":false,"properties":{"articleFormat":{"description":"Structure preset chosen at create time (#1183). Always present; jobs created without a choice report `default`.","enum":["default","how_to","listicle","question_led"],"type":"string"},"articleId":{"format":"uuid","nullable":true,"type":"string"},"checklist":{"additionalProperties":true,"type":"object"},"createdAt":{"format":"date-time","type":"string"},"error":{"nullable":true,"type":"string"},"factCheckSummary":{"additionalProperties":true,"nullable":true,"type":"object"},"finishedAt":{"format":"date-time","nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"images":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"instructions":{"description":"Per-article operator instructions sent at create time (#1182). Null when the job had none.","nullable":true,"type":"string"},"keywordId":{"format":"uuid","nullable":true,"type":"string"},"locale":{"nullable":true,"type":"string"},"markdown":{"type":"string"},"markedCopiedAt":{"description":"Set only by Mark as copied (#418 P2). Approve never sets it, so this is how a client tells a copied job from a delivery still in flight (#1373), instead of inferring it from an absent `prUrl`.","format":"date-time","nullable":true,"type":"string"},"metaDescription":{"type":"string"},"organizationId":{"type":"string"},"prUrl":{"nullable":true,"type":"string"},"publishAttempts":{"items":{"$ref":"#/components/schemas/PublishAttempt"},"nullable":true,"type":"array"},"publishDestinations":{"items":{"additionalProperties":true,"type":"object"},"nullable":true,"type":"array"},"publishInFlight":{"description":"Destinations whose delivery has started but not finished (#1373). Approve marks the job published before the CMS fan-out, so a job can be `published` with no `publishDestinations` yet while this is non-empty. Omitted once every run is terminal.","items":{"$ref":"#/components/schemas/PublishInFlight"},"nullable":true,"type":"array"},"redeliveryResults":{"description":"Per-provider outcome of a Redeliver (retry-publish) call (#1395). Present only on a retry-publish response that named `providers`; omitted on GET. One row per named provider this call actually wrote.","items":{"$ref":"#/components/schemas/RedeliveryResult"},"nullable":true,"type":"array"},"seoScore":{"additionalProperties":true,"nullable":true,"type":"object"},"siteId":{"format":"uuid","type":"string"},"slug":{"type":"string"},"source":{"type":"string"},"sourceType":{"type":"string"},"stages":{"items":{"$ref":"#/components/schemas/JobStage"},"type":"array"},"startedAt":{"format":"date-time","nullable":true,"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"topic":{"type":"string"},"translationKey":{"nullable":true,"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","siteId","organizationId","topic","status","source","sourceType","stages","checklist","articleFormat","createdAt","updatedAt"],"type":"object"},"JobEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/Job"}},"required":["data"],"type":"object"},"JobSEOOptimize":{"properties":{"accepted":{"type":"boolean"},"after":{"additionalProperties":true,"nullable":true,"type":"object"},"before":{"additionalProperties":true,"nullable":true,"type":"object"},"costIsEstimate":{"type":"boolean"},"estimatedCostUsd":{"nullable":true,"type":"number"},"job":{"$ref":"#/components/schemas/Job"},"reason":{"type":"string"},"revisionId":{"format":"uuid","nullable":true,"type":"string"},"seoScore":{"$ref":"#/components/schemas/JobSEOScore"}},"required":["accepted","reason","job","seoScore","costIsEstimate"],"type":"object"},"JobSEOOptimizeEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/JobSEOOptimize"}},"required":["data"],"type":"object"},"JobSEORescore":{"properties":{"benchmarkRefresh":{"additionalProperties":true,"nullable":true,"type":"object"},"job":{"$ref":"#/components/schemas/Job"},"seoScore":{"$ref":"#/components/schemas/JobSEOScore"}},"required":["job","seoScore"],"type":"object"},"JobSEORescoreEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/JobSEORescore"}},"required":["data"],"type":"object"},"JobSEOScore":{"additionalProperties":false,"properties":{"mode":{"nullable":true,"type":"string"},"optimizeStatus":{"nullable":true,"type":"string"},"primaryLocale":{"nullable":true,"type":"string"},"reports":{"additionalProperties":true,"type":"object"},"score":{"nullable":true,"type":"integer"},"scoredAt":{"format":"date-time","nullable":true,"type":"string"}},"required":["score","reports"],"type":"object"},"JobSEOScoreEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/JobSEOScore"}},"required":["data"],"type":"object"},"JobStage":{"additionalProperties":true,"properties":{"error":{"nullable":true,"type":"string"},"finishedAt":{"format":"date-time","nullable":true,"type":"string"},"name":{"type":"string"},"output":{"nullable":true,"type":"string"},"startedAt":{"format":"date-time","nullable":true,"type":"string"},"status":{"description":"Pipeline stage terminal/progress state. Soft-skips (e.g. SERP brief unavailable) use `skipped` so review UI does not imply a usable artifact.\n","enum":["pending","running","succeeded","skipped","failed"],"type":"string"}},"required":["name","status"],"type":"object"},"JobSummary":{"properties":{"createdAt":{"format":"date-time","type":"string"},"error":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"locale":{"nullable":true,"type":"string"},"organizationId":{"type":"string"},"prUrl":{"nullable":true,"type":"string"},"siteId":{"format":"uuid","type":"string"},"slug":{"type":"string"},"source":{"type":"string"},"sourceType":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"topic":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","siteId","status","source"],"type":"object"},"JobSummaryListEnvelope":{"properties":{"data":{"items":{"$ref":"#/components/schemas/JobSummary"},"type":"array"},"hasMore":{"type":"boolean"},"nextCursor":{"nullable":true,"type":"string"}},"required":["data","hasMore"],"type":"object"},"Keyword":{"properties":{"cannibalizesUrl":{"nullable":true,"type":"string"},"clusterId":{"format":"uuid","nullable":true,"type":"string"},"cpcUsd":{"nullable":true,"type":"number"},"createdAt":{"format":"date-time","type":"string"},"gscImpressions":{"nullable":true,"type":"integer"},"gscPosition":{"nullable":true,"type":"number"},"id":{"format":"uuid","type":"string"},"intent":{"nullable":true,"type":"string"},"isPillar":{"type":"boolean"},"keywordDifficulty":{"nullable":true,"type":"integer"},"locale":{"nullable":true,"type":"string"},"metricsFetchedAt":{"format":"date-time","nullable":true,"type":"string"},"phrase":{"type":"string"},"priority":{"type":"integer"},"searchVolume":{"nullable":true,"type":"integer"},"siteId":{"format":"uuid","type":"string"},"source":{"type":"string"},"status":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","siteId","phrase","priority","status","source","isPillar","createdAt","updatedAt"],"type":"object"},"KeywordCluster":{"properties":{"createdAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"keywords":{"items":{"$ref":"#/components/schemas/Keyword"},"type":"array"},"locale":{"type":"string"},"method":{"type":"string"},"name":{"type":"string"},"pillarKeywordId":{"format":"uuid","nullable":true,"type":"string"},"siteId":{"format":"uuid","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","siteId","locale","name","method","createdAt","updatedAt"],"type":"object"},"KeywordClusterListEnvelope":{"properties":{"data":{"items":{"$ref":"#/components/schemas/KeywordCluster"},"type":"array"},"hasMore":{"type":"boolean"},"nextCursor":{"nullable":true,"type":"string"}},"required":["data","hasMore"],"type":"object"},"KeywordEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/Keyword"}},"required":["data"],"type":"object"},"KeywordListEnvelope":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Keyword"},"type":"array"},"hasMore":{"type":"boolean"},"nextCursor":{"nullable":true,"type":"string"}},"required":["data","hasMore"],"type":"object"},"Me":{"properties":{"apiVersion":{"type":"string"},"byok":{"properties":{"dataforseo":{"type":"boolean"},"images":{"type":"boolean"},"llm":{"additionalProperties":{"type":"boolean"},"type":"object"},"supadata":{"type":"boolean"},"webSearch":{"type":"boolean"}},"type":"object"},"limits":{"properties":{"dailyJobCap":{"type":"integer"},"jobsCreatedToday":{"type":"integer"},"maxConcurrentJobs":{"type":"integer"},"orgDailyJobCap":{"type":"integer"},"orgJobsCreatedToday":{"type":"integer"},"requestsPerMinute":{"type":"integer"}},"type":"object"},"organization":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"plan":{"type":"string"}},"required":["id","name","plan"],"type":"object"},"token":{"properties":{"expiresAt":{"format":"date-time","nullable":true,"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"scopes":{"items":{"type":"string"},"type":"array"}},"required":["id","name","scopes"],"type":"object"}},"required":["organization","token","byok","limits","apiVersion"],"type":"object"},"MeEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/Me"}},"required":["data"],"type":"object"},"PublishAttempt":{"additionalProperties":false,"properties":{"attemptedAt":{"format":"date-time","nullable":true,"type":"string"},"failure":{"$ref":"#/components/schemas/PublishFailure"},"provider":{"type":"string"},"status":{"type":"string"}},"required":["provider","status"],"type":"object"},"PublishFailure":{"additionalProperties":false,"properties":{"action":{"enum":["reconnect","retry","fix_content","wait"],"type":"string"},"category":{"enum":["auth","permission","rate_limit","validation","upstream","config"],"type":"string"},"userMessage":{"type":"string"}},"required":["category","action","userMessage"],"type":"object"},"PublishInFlight":{"additionalProperties":false,"description":"One destination whose publish run is still queued or running (#1373).","properties":{"attemptedAt":{"format":"date-time","nullable":true,"type":"string"},"provider":{"type":"string"},"status":{"type":"string"}},"required":["provider","status"],"type":"object"},"RedeliveryResult":{"additionalProperties":false,"description":"One destination's in-place outcome after a Redeliver (#1395).","properties":{"editUrl":{"description":"The destination's own editor link, when known.","type":"string"},"error":{"description":"The destination's failure message when the redelivery did not succeed. The job stays `published`; this is a soft failure.","type":"string"},"provider":{"type":"string"},"publicUrl":{"description":"Public permalink when the destination is live.","type":"string"},"state":{"description":"Shared delivery state: `draft` when the destination post is private, `live` when it is public, `unknown` when the run recorded nothing the API can read.","enum":["draft","live","unknown"],"type":"string"},"status":{"description":"The lifecycle string the destination echoed, when it echoed one.","type":"string"}},"required":["provider","state"],"type":"object"},"RejectJobRequest":{"additionalProperties":false,"properties":{"reason":{"description":"Optional rejection note stored on the job error field.","maxLength":1000,"type":"string"}},"type":"object"},"RescoreJobRequest":{"additionalProperties":false,"properties":{"refreshBenchmarks":{"type":"boolean"}},"type":"object"},"RetryPublishJobRequest":{"properties":{"providers":{"description":"Optional destination providers to retry. Omit to retry every failed destination. A named provider is re-delivered even when its last run succeeded, updating the existing remote post (e.g. a Payload PATCH) rather than creating a duplicate.","items":{"type":"string"},"type":"array"}},"type":"object"},"Site":{"properties":{"createdAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"primaryDomain":{"type":"string"},"primaryLocale":{"type":"string"},"settings":{"properties":{"citationsEnabled":{"type":"boolean"},"factCheckMode":{"type":"string"},"imageMode":{"type":"string"},"seoGateMode":{"type":"string"},"seoScoreMode":{"type":"string"},"serpBriefMode":{"type":"string"}},"type":"object"},"status":{"type":"string"},"targetLocales":{"items":{"type":"string"},"type":"array"},"updatedAt":{"format":"date-time","type":"string"},"weeklyMax":{"type":"integer"}},"required":["id","name","status","settings"],"type":"object"},"SiteEnvelope":{"properties":{"data":{"$ref":"#/components/schemas/Site"}},"required":["data"],"type":"object"},"SiteListEnvelope":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Site"},"type":"array"},"hasMore":{"type":"boolean"},"nextCursor":{"nullable":true,"type":"string"}},"required":["data","hasMore"],"type":"object"},"UpdateKeywordRequest":{"additionalProperties":false,"properties":{"status":{"enum":["candidate","accepted","rejected","planned","published"],"type":"string"}},"required":["status"],"type":"object"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"qyn_live_","description":"Org API token (`qyn_live_…`) from Settings → Developer. Required for all\nREST operations. Also accepted on MCP.\n","scheme":"bearer","type":"http"},"mcpOAuth":{"bearerFormat":"Clerk OAuth access token","description":"Clerk-issued OAuth access token for MCP only (#196). Scopes match the\ntoken allow-list. Not valid on REST routes in this document.\n","scheme":"bearer","type":"http"}}},"info":{"description":"Org-scoped public REST API for Quillyn. Authenticate REST routes with a\nBearer `qyn_live_…` API token from Settings → Developer.\n\nMCP (`POST https://api.quillyn.com/mcp`) accepts the same `qyn_` tokens **or**\na Clerk OAuth 2.1 access token from Connect assistant (#196). OAuth grants\nuse the same scope strings as tokens (`jobs:write`, `jobs:approve`, …);\nApprove stays explicit. SPA Clerk session JWTs are never accepted here.\nDiscovery: `GET /.well-known/oauth-protected-resource/mcp`.\n","title":"Quillyn Public API","version":"2026-11-05"},"openapi":"3.0.3","paths":{"/articles/{id}":{"get":{"operationId":"getArticle","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleEnvelope"}}},"description":"Article"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Get a published article","tags":["Jobs"],"x-required-scope":"jobs:read"}},"/briefs/{id}":{"get":{"operationId":"getBrief","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefEnvelope"}}},"description":"Brief"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Get a content brief","tags":["Briefs"],"x-required-scope":"briefs:read"}},"/jobs":{"get":{"operationId":"listJobs","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"in":"query","name":"siteId","schema":{"format":"uuid","type":"string"}},{"description":"Comma-separated status list","in":"query","name":"status","schema":{"type":"string"}},{"in":"query","name":"source","schema":{"enum":["manual","scheduled","api"],"type":"string"}},{"in":"query","name":"createdAfter","schema":{"format":"date-time","type":"string"}},{"in":"query","name":"updatedAfter","schema":{"format":"date-time","type":"string"}},{"in":"query","name":"order","schema":{"enum":["updated_asc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSummaryListEnvelope"}}},"description":"Job summaries"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"List article jobs","tags":["Jobs"],"x-required-scope":"jobs:read"}},"/jobs/{id}":{"get":{"operationId":"getJob","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"include","schema":{"enum":["html"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobEnvelope"}}},"description":"Job detail"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Get an article job","tags":["Jobs"],"x-required-scope":"jobs:read"}},"/jobs/{id}/approve":{"post":{"description":"Same checks as the web Approve path. Requires `jobs:approve` on an\nowner-created token. `Idempotency-Key` is required.\n","operationId":"approveJob","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveJobRequest"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobEnvelope"}}},"description":"Approved job"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"}},"summary":"Approve a needs_review job (publish)","tags":["Jobs"],"x-required-scope":"jobs:approve"}},"/jobs/{id}/reject":{"post":{"operationId":"rejectJob","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"$ref":"#/components/parameters/OptionalIdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectJobRequest"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobEnvelope"}}},"description":"Rejected job"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}},"summary":"Reject a needs_review job","tags":["Jobs"],"x-required-scope":"jobs:write"}},"/jobs/{id}/retry-publish":{"post":{"description":"Re-delivers failed CMS/webhook/Cloudflare destinations without calling\nApprove again. The job must already be `published` (`needs_review`\nreturns 409). Optional `providers` defaults to every failed destination.\nNaming a provider re-delivers it even when its last run succeeded; the\ndestination then updates the existing remote post (same remote id)\ninstead of creating another one. Destinations not named are still\nskipped when their last run succeeded. Requires `jobs:approve`\non an owner-created token. `Idempotency-Key` is required.\n\nA re-delivery never spends article credit. It also never demotes a live\npost: when the prior run recorded a live outcome, the write updates that\npost in place (Webflow `isDraft` off, Ghost published, WordPress\npublished, Shopify published, Wix `UPDATE_PUBLICATION`) rather than\nrewriting it as a draft. A destination the prior run left as a draft\nkeeps the connection's configured post mode, so a site whose setting now\nsays Publish publishes on re-delivery. Each re-delivery writes a fresh\n`result_meta.remote` block, the same one Approve records.\n\nWhen the request names `providers`, the response also carries\n`redeliveryResults[]`: one row per named provider that this call actually\nwrote, reporting the resulting `state` (`draft`/`live`/`unknown`),\n`status`, `publicUrl`, `editUrl`, and the destination's own `error` when\nthe write failed. A redelivery is soft-failed like Approve: the job stays\n`published` and the failure surfaces on the row and on `job.error`.\n\nRefresh jobs (`source_type: refresh`) have no in-place redelivery path —\ntheir destination registry skips Ghost/Shopify, writes only a WordPress\nautosave, and forces Wix/Webflow to a draft — so naming `providers` on one\nreturns `409 redeliver_unsupported`. Omitting `providers` (the failed-only\ndefault) is unchanged for those jobs.\n","operationId":"retryPublishJob","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryPublishJobRequest"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobEnvelope"}}},"description":"Job after retry (same shape as GET /jobs/{id})"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"}},"summary":"Retry destination publish for a published job","tags":["Jobs"],"x-required-scope":"jobs:approve"}},"/jobs/{id}/seo-optimize":{"post":{"description":"Uses the org BYOK model key. May rewrite draft markdown when accepted.\n`Idempotency-Key` is required (LLM spend).\n","operationId":"seoOptimizeJob","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSEOOptimizeEnvelope"}}},"description":"Optimize result"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"summary":"Run SEO optimize on a needs_review job","tags":["Jobs"],"x-required-scope":"jobs:write"}},"/jobs/{id}/seo-score":{"get":{"operationId":"getJobSeoScore","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSEOScoreEnvelope"}}},"description":"SEO score summary"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Get SEO score report for a job","tags":["Jobs"],"x-required-scope":"jobs:read"}},"/jobs/{id}/seo-score/rescore":{"post":{"description":"Deterministic on-page score against ranking-page benchmarks. Optional\n`refreshBenchmarks` re-fetches brief URLs only (no SERP call).\n","operationId":"rescoreJobSeo","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"$ref":"#/components/parameters/OptionalIdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RescoreJobRequest"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSEORescoreEnvelope"}}},"description":"Rescored job + SEO score"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Recompute SEO score for a job","tags":["Jobs"],"x-required-scope":"jobs:write"}},"/me":{"get":{"operationId":"getMe","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeEnvelope"}}},"description":"Account snapshot"},"401":{"$ref":"#/components/responses/Unauthenticated"}},"summary":"Account, token, BYOK readiness, and caps","tags":["Meta"],"x-required-scope":""}},"/openapi.json":{"get":{"operationId":"getOpenAPI","responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"OpenAPI 3.0.3 document as JSON"}},"security":[],"summary":"OpenAPI document","tags":["Meta"],"x-required-scope":""}},"/sites":{"get":{"operationId":"listSites","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteListEnvelope"}}},"description":"Site page"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"}},"summary":"List sites","tags":["Sites"],"x-required-scope":"sites:read"}},"/sites/{siteId}":{"get":{"operationId":"getSite","parameters":[{"$ref":"#/components/parameters/SiteId"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteEnvelope"}}},"description":"Site"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Get a site","tags":["Sites"],"x-required-scope":"sites:read"}},"/sites/{siteId}/briefs":{"get":{"operationId":"listBriefs","parameters":[{"$ref":"#/components/parameters/SiteId"},{"in":"query","name":"keyword","schema":{"type":"string"}},{"in":"query","name":"locale","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefListEnvelope"}}},"description":"Briefs"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"List SERP content briefs for a site","tags":["Briefs"],"x-required-scope":"briefs:read"},"post":{"description":"Uses org BYOK SERP credentials (DataForSEO / Serper). Returns a cached\nfresh brief with `200` when one exists unless `regenerate` is true.\n`Idempotency-Key` is required (SERP spend).\n","operationId":"createBrief","parameters":[{"$ref":"#/components/parameters/SiteId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBriefRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefEnvelope"}}},"description":"Fresh cached brief"},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefEnvelope"}}},"description":"Newly created brief"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"Create a SERP content brief","tags":["Briefs"],"x-required-scope":"briefs:write"}},"/sites/{siteId}/destinations":{"get":{"operationId":"listDestinations","parameters":[{"$ref":"#/components/parameters/SiteId"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationListEnvelope"}}},"description":"Destinations"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"List publish destinations (no secrets)","tags":["Sites"],"x-required-scope":"sites:read"}},"/sites/{siteId}/jobs":{"post":{"description":"Returns `202` with `status: queued` and a `Location` header. Provide\nexactly one of `topic`, `keywordId`, `pageUrl`, or `youtubeUrl`.\n`Idempotency-Key` is required. Daily token/org caps and concurrency\nlimits apply.\n","operationId":"createJob","parameters":[{"$ref":"#/components/parameters/SiteId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobEnvelope"}}},"description":"Job queued","headers":{"Idempotent-Replayed":{"schema":{"enum":["true"],"type":"string"}},"Location":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"Create an article job (async)","tags":["Jobs"],"x-required-scope":"jobs:write"}},"/sites/{siteId}/keyword-clusters":{"get":{"operationId":"listKeywordClusters","parameters":[{"$ref":"#/components/parameters/SiteId"},{"in":"query","name":"locale","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeywordClusterListEnvelope"}}},"description":"Clusters"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"List keyword clusters with member keywords","tags":["Keywords"],"x-required-scope":"keywords:read"}},"/sites/{siteId}/keywords":{"get":{"operationId":"listKeywords","parameters":[{"$ref":"#/components/parameters/SiteId"},{"in":"query","name":"locale","schema":{"type":"string"}},{"in":"query","name":"status","schema":{"enum":["candidate","accepted","rejected","planned","published"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeywordListEnvelope"}}},"description":"Keyword page"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"List site keywords (content plan)","tags":["Keywords"],"x-required-scope":"keywords:read"},"post":{"operationId":"createKeyword","parameters":[{"$ref":"#/components/parameters/SiteId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeywordRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeywordEnvelope"}}},"description":"Phrase already existed; priority/status updated"},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeywordEnvelope"}}},"description":"New keyword created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Create or upsert a keyword on the content plan","tags":["Keywords"],"x-required-scope":"keywords:write"}},"/sites/{siteId}/keywords/{id}":{"patch":{"operationId":"updateKeyword","parameters":[{"$ref":"#/components/parameters/SiteId"},{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKeywordRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeywordEnvelope"}}},"description":"Updated keyword"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Update a keyword status","tags":["Keywords"],"x-required-scope":"keywords:write"}},"/webhooks":{"get":{"description":"Org-scoped lifecycle event webhooks (#195). Receivers get signed POSTs\nfor `job.completed`, `job.failed`, `job.needs_review`, `job.approved`,\nand `job.rejected`. Delivery uses `X-Quillyn-Signature` (HMAC-SHA256),\n`X-Quillyn-Delivery-Id`, and `X-Quillyn-Event`, with up to 3 attempts\nand exponential backoff (200ms × attempt). SSRF-blocked URLs are rejected\nat create time.\n","operationId":"listEventWebhooks","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventWebhookListEnvelope"}}},"description":"Endpoint list"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"}},"summary":"List org event webhook endpoints","tags":["Webhooks"],"x-required-scope":"webhooks:manage"},"post":{"description":"Returns the signing secret once (`Cache-Control: no-store`). Store it\nsecurely; Quillyn keeps only an AES-GCM ciphertext for outbound HMAC.\n","operationId":"createEventWebhook","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEventWebhookRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventWebhookCreateEnvelope"}}},"description":"Created endpoint + one-time secret"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Active endpoint limit (10) reached"}},"summary":"Create an event webhook endpoint","tags":["Webhooks"],"x-required-scope":"webhooks:manage"}},"/webhooks/{id}":{"delete":{"operationId":"revokeEventWebhook","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventWebhookEnvelope"}}},"description":"Revoked endpoint"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Revoke an event webhook endpoint","tags":["Webhooks"],"x-required-scope":"webhooks:manage"}},"/webhooks/{id}/deliveries":{"get":{"operationId":"listEventWebhookDeliveries","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventWebhookDeliveryListEnvelope"}}},"description":"Recent delivery attempts"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"List recent deliveries for an endpoint","tags":["Webhooks"],"x-required-scope":"webhooks:manage"}}},"security":[{"bearerAuth":[]}],"servers":[{"description":"Production","url":"https://api.quillyn.com/api/public/v1"}],"tags":[{"name":"Meta"},{"name":"Sites"},{"name":"Keywords"},{"name":"Briefs"},{"name":"Jobs"},{"name":"Webhooks"},{"name":"MCP"}]}