{"openapi":"3.1.0","info":{"title":"PostChamp API","version":"1.0.0","description":"Write, schedule and manage LinkedIn posts, content styles, carousels and infographics from your own tools. Calls run as the key's creator with their current role and use the organization's credits. Lists are `{ items, nextCursor }`; errors are `{ error: { code, message, details } }`. Every response carries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`."},"servers":[{"url":"https://api.postchampai.com"}],"tags":[{"name":"Account"},{"name":"Posts"},{"name":"Scheduling"},{"name":"Content styles"},{"name":"Carousels"},{"name":"Infographics"},{"name":"Jobs"}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"An API key from Settings → API keys (`pc_live_…`). Studio plan. Keep it on your server."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"not_found"},"message":{"type":"string","example":"Workspace not found."},"details":{}},"required":["code","message"]}},"required":["error"],"description":"Every error has this shape. 5xx answers carry `details.requestId`; every answer has an `X-Request-Id` header."},"KeyInfo":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string"},"prefix":{"type":"string"},"workspaceId":{"type":["string","null"],"description":"null = every workspace the creator can reach."}},"required":["id","prefix","workspaceId"]},"organization":{"type":"object","properties":{"id":{"type":"string"},"plan":{"type":"string"}},"required":["id","plan"]},"actingAs":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"description":"Calls run as the key's creator, with their current role."},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isMain":{"type":"boolean"}},"required":["id","name","isMain"]}}},"required":["key","organization","actingAs","workspaces"]},"CreditBalance":{"type":"object","properties":{"monthly":{"type":"number"},"lifetime":{"type":"number"},"bonus":{"type":"number"},"held":{"type":"number"},"available":{"type":"number"},"monthlyAllowance":{"type":"number"},"nextResetAt":{"type":["string","null"],"format":"date-time"},"billingClass":{"type":["string","null"],"enum":["monthly","yearly","lifetime","trial",null]},"planKey":{"type":["string","null"],"enum":["creator","pro","studio","scale",null]},"trialKind":{"type":["string","null"],"enum":["card","basic",null]},"trialEndsAt":{"type":["string","null"],"format":"date-time"}},"required":["monthly","lifetime","bonus","held","available","monthlyAllowance","nextResetAt","billingClass","planKey","trialKind","trialEndsAt"]},"CarouselTemplateList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CarouselTemplate"}}},"required":["items"]},"CarouselTemplate":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"Send it as `templateKey` when creating a carousel."},"kind":{"type":"string","enum":["carousel"]},"name":{"type":"string"},"description":{"type":["string","null"]},"group":{"type":"string"},"isPremium":{"type":"boolean"},"locked":{"type":"boolean","description":"Premium and the plan lacks premium templates."},"tone":{"type":"string"},"recommendedSlides":{"type":"integer"},"mode":{"type":"string","enum":["light","dark"]},"sizes":{"type":"array","items":{"type":"string","enum":["portrait","square"]}},"previewUrl":{"type":"string"}},"required":["id","key","kind","name","description","group","isPremium","locked","tone","recommendedSlides","mode","sizes","previewUrl"]},"GenerateResult":{"oneOf":[{"$ref":"#/components/schemas/GenerateNeedsInput"},{"$ref":"#/components/schemas/GenerateDone"}],"discriminator":{"propertyName":"status","mapping":{"needs_input":"#/components/schemas/GenerateNeedsInput","done":"#/components/schemas/GenerateDone"}}},"GenerateNeedsInput":{"type":"object","properties":{"status":{"type":"string","enum":["needs_input"]},"question":{"type":"string"},"attempt":{"type":"integer"}},"required":["status","question","attempt"],"description":"Free: answer the question by sending `answers` with the same Idempotency-Key."},"GenerateDone":{"type":"object","properties":{"status":{"type":"string","enum":["done"]},"generationGroupId":{"type":"string"},"postIds":{"type":"array","items":{"type":"string"}},"posts":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"failed":{"type":"integer","description":"Versions that failed (charged once when at least one succeeded)."},"suggestedFirstComment":{"type":["string","null"]},"creditsLeft":{"type":["number","null"]},"replayed":{"type":"boolean","description":"An earlier, already charged request with this key was replayed."}},"required":["status","generationGroupId","postIds","posts","failed","suggestedFirstComment","creditsLeft","replayed"]},"Post":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","pending_approval","approved","scheduled","publishing","published","failed","cancelled"]},"content":{"type":"string","description":"Plain text (no styling)."},"contentDoc":{"type":"object","properties":{"type":{"type":"string","enum":["doc"]},"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["paragraph"]},"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":20000},"marks":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic"]}},"required":["type"]},"maxItems":2}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["hardBreak"]}},"required":["type"]}]},"maxItems":3000}},"required":["type"]},"maxItems":3000}},"required":["type","content"]},"linkedInText":{"type":"string","description":"What LinkedIn will show (styled Unicode)."},"charCount":{"type":"integer"},"origin":{"type":"string"},"contentStyleId":{"type":["string","null"]},"theme":{"type":["string","null"]},"plannedDate":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"mediaType":{"type":"string"},"scheduledAt":{"type":["string","null"],"format":"date-time"},"publishedAt":{"type":["string","null"],"format":"date-time"},"linkedinPostUrl":{"type":["string","null"]},"lastErrorCode":{"type":["string","null"]},"lastErrorMessage":{"type":["string","null"]},"lockedReason":{"type":["string","null"]},"editable":{"type":"boolean","description":"False when the post lock rule refuses edits; `lock` says why."},"lock":{"type":["string","null"]},"generationGroupId":{"type":["string","null"]},"currentVersionId":{"type":["string","null"]},"sourceRefs":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"url":{"type":"string"}},"required":["type"]}},"createdByUserId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","content","contentDoc","linkedInText","charCount","origin","contentStyleId","theme","plannedDate","documentTitle","mediaType","scheduledAt","publishedAt","linkedinPostUrl","lastErrorCode","lastErrorMessage","lockedReason","editable","lock","generationGroupId","currentVersionId","sourceRefs","createdByUserId","createdAt","updatedAt"]},"PostList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"Timeline":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TimelineItem"}}},"required":["items"]},"TimelineItem":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","pending_approval","approved","scheduled","publishing","published","failed","cancelled"]},"opening":{"type":"string"},"type":{"type":"string","enum":["text","images","document","video"]},"at":{"type":["string","null"],"format":"date-time","description":"`publishedAt` for published posts, `scheduledAt` for scheduled ones."},"updatedAt":{"type":"string","format":"date-time"},"url":{"type":["string","null"]},"engagement":{"type":["number","null"]}},"required":["id","status","opening","type","at","updatedAt","url","engagement"]},"ScheduleState":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","pending_approval","approved","scheduled","publishing","published","failed","cancelled"]},"scheduledAt":{"type":["string","null"],"format":"date-time"},"local":{"type":["object","null"],"properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"description":"In the workspace timezone."},"timezone":{"type":"string"},"scheduleVersion":{"type":"integer"},"publishedAt":{"type":["string","null"],"format":"date-time"},"linkedinPostUrl":{"type":["string","null"]},"lastErrorCode":{"type":["string","null"]},"lastErrorMessage":{"type":["string","null"]}},"required":["id","status","scheduledAt","local","timezone","scheduleVersion","publishedAt","linkedinPostUrl","lastErrorCode","lastErrorMessage"]},"ContentStyleList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContentStyle"}}},"required":["items"]},"ContentStyle":{"type":"object","properties":{"id":{"type":"string","description":"`preset:<key>` for built-ins, else the style uuid."},"kind":{"type":"string","enum":["preset","custom"]},"presetKey":{"type":["string","null"],"enum":["story","contrarian","lesson_learned","build_in_public","observational","reflection","milestone","tactical",null]},"name":{"type":"string"},"description":{"type":["string","null"]},"guidance":{"type":["string","null"]},"examples":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"key":{"type":"string","description":"Send it back when removing the example."}},"required":["text","key"]}},"customized":{"type":"boolean"},"archived":{"type":"boolean"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","kind","presetKey","name","description","guidance","examples","customized","archived","updatedAt"]},"CarouselStarted":{"type":"object","properties":{"id":{"type":"string"},"carouselId":{"type":"string"},"jobId":{"type":"string"},"status":{"type":"string","enum":["queued","running","ready","failed","cancelled"]}},"required":["id","carouselId","jobId","status"],"description":"A queued build (`status` is the carousel's status now on a replay)."},"Carousel":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["ai_artwork","template"]},"title":{"type":"string"},"prompt":{"type":["string","null"]},"size":{"type":"string","enum":["portrait","square"]},"width":{"type":"integer"},"height":{"type":"integer"},"stylePreset":{"type":["string","null"]},"brandKitApplied":{"type":"boolean"},"status":{"type":"string","enum":["queued","running","ready","failed","cancelled"]},"progress":{"type":"number"},"revision":{"type":"integer"},"slideCount":{"type":"integer"},"drawn":{"type":["object","null"],"properties":{"done":{"type":"integer"},"total":{"type":"integer"}},"required":["done","total"]},"error":{"type":["string","null"]},"hasPdf":{"type":"boolean"},"jobId":{"type":"string"},"lock":{"type":"object","properties":{"locked":{"type":"boolean"},"postId":{"type":["string","null"]}},"required":["locked","postId"]},"template":{"type":["object","null"],"properties":{"key":{"type":"string"},"name":{"type":"string"},"group":{"type":"string"},"isPremium":{"type":"boolean"}},"required":["key","name","group","isPremium"]},"attachedPostIds":{"type":"array","items":{"type":"string"}},"slides":{"type":"array","items":{"$ref":"#/components/schemas/CarouselSlide"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"pdfUrl":{"type":["string","null"],"description":"Presigned GET of the PDF once built (expires in 5 minutes)."},"pdfUrlExpiresAt":{"type":["string","null"],"format":"date-time"}},"required":["id","kind","title","prompt","size","width","height","stylePreset","brandKitApplied","status","progress","revision","slideCount","drawn","error","hasPdf","jobId","lock","template","attachedPostIds","slides","createdAt","updatedAt","pdfUrl","pdfUrlExpiresAt"]},"CarouselSlide":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer"},"prompt":{"type":["string","null"]},"status":{"type":"string","enum":["queued","running","ready","failed","cancelled"]},"imageId":{"type":["string","null"]},"currentVersionId":{"type":["string","null"]},"url":{"type":["string","null"],"description":"Presigned GET of the slide picture (5 min)."},"versionsCount":{"type":"integer"},"drawing":{"type":"boolean"},"lastError":{"type":["string","null"]},"layout":{"type":["object","null"],"additionalProperties":{}},"imageUrl":{"type":["string","null"]},"pictureMissing":{"type":"boolean"}},"required":["id","position","prompt","status","imageId","currentVersionId","url","versionsCount","drawing","lastError","layout","imageUrl","pictureMissing"]},"CarouselChangeStarted":{"type":"object","properties":{"carouselId":{"type":"string"},"jobId":{"type":"string"},"revision":{"type":"integer"},"ops":{"type":"array","items":{"$ref":"#/components/schemas/CarouselOp"}},"paidSlides":{"type":"integer","description":"Slides added or redrawn (10 credits each, capped)."},"upTo":{"type":"integer","description":"The most it can cost (charged only for slides that succeed)."},"id":{"type":"string"},"status":{"type":"string","enum":["queued"]}},"required":["carouselId","jobId","revision","ops","paidSlides","upTo","id","status"]},"CarouselOp":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","enum":["add"]},"prompt":{"type":"string"},"position":{"type":"integer"}},"required":["op","prompt","position"]},{"type":"object","properties":{"op":{"type":"string","enum":["redraw"]},"slideId":{"type":"string"},"instruction":{"type":["string","null"]},"referenceObjectIds":{"type":"array","items":{"type":"string"}}},"required":["op","slideId","instruction"]},{"type":"object","properties":{"op":{"type":"string","enum":["remove"]},"slideId":{"type":"string"}},"required":["op","slideId"]},{"type":"object","properties":{"op":{"type":"string","enum":["move"]},"slideId":{"type":"string"},"toPosition":{"type":"integer"}},"required":["op","slideId","toPosition"]}]},"InfographicStarted":{"type":"object","properties":{"id":{"type":"string"},"infographicId":{"type":"string"},"versionId":{"type":"string"},"jobId":{"type":"string"},"status":{"type":"string","enum":["queued","running","ready","failed","cancelled"]}},"required":["id","infographicId","versionId","jobId","status"],"description":"A queued version (`status` is the version's status now on a replay)."},"InfographicList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InfographicSummary"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"InfographicSummary":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"renderMode":{"type":"string","enum":["html","ai_image"]},"aspect":{"type":"string","enum":["portrait","square","landscape"]},"status":{"type":"string","enum":["queued","running","ready","failed","cancelled"]},"error":{"type":["string","null"]},"url":{"type":["string","null"]},"jobId":{"type":["string","null"]},"versionCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","renderMode","aspect","status","error","url","jobId","versionCount","createdAt","updatedAt"]},"Infographic":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"prompt":{"type":"string"},"renderMode":{"type":"string","enum":["html","ai_image"]},"templateKey":{"type":["string","null"]},"stylePreset":{"type":["string","null"]},"aspect":{"type":"string","enum":["portrait","square","landscape"]},"width":{"type":"integer"},"height":{"type":"integer"},"brandKitApplied":{"type":"boolean"},"status":{"type":"string","enum":["queued","running","ready","failed","cancelled"]},"error":{"type":["string","null"]},"phase":{"type":["string","null"],"enum":["writing","drawing",null]},"content":{"type":["object","null"],"properties":{"title":{"type":"string","minLength":1,"maxLength":80},"subtitle":{"type":"string","maxLength":140},"sections":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["stat","list","steps","comparison","timeline","text"]},"heading":{"type":"string","minLength":1,"maxLength":56},"columns":{"type":"array","prefixItems":[{"type":"string","maxLength":24},{"type":"string","maxLength":24}]},"items":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":64,"default":""},"text":{"type":"string","maxLength":280,"default":""},"value":{"type":"string","maxLength":14,"default":""},"a":{"type":"string","maxLength":48,"default":""},"b":{"type":"string","maxLength":48,"default":""}}},"minItems":1,"maxItems":6}},"required":["kind","heading","items"]},"minItems":2,"maxItems":6},"footer":{"type":"string","maxLength":80},"sourcesNote":{"type":"string","maxLength":120}},"required":["title","sections"]},"shortened":{"type":"boolean"},"usesPostText":{"type":"boolean"},"kbItemCount":{"type":"integer"},"imageId":{"type":["string","null"]},"currentVersionId":{"type":["string","null"]},"url":{"type":["string","null"],"description":"Presigned GET of the current version (1 h)."},"versions":{"type":"array","items":{"$ref":"#/components/schemas/InfographicVersion"}},"jobId":{"type":["string","null"]},"canEdit":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","prompt","renderMode","templateKey","stylePreset","aspect","width","height","brandKitApplied","status","error","phase","content","shortened","usesPostText","kbItemCount","imageId","currentVersionId","url","versions","jobId","canEdit","createdAt","updatedAt"]},"InfographicVersion":{"type":"object","properties":{"id":{"type":"string"},"versionNo":{"type":"integer"},"instruction":{"type":["string","null"]},"status":{"type":"string","enum":["queued","running","ready","failed","cancelled"]},"error":{"type":["string","null"]},"url":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","versionNo","instruction","status","error","url","createdAt"]},"Deleted":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]},"JobStatus":{"type":"object","properties":{"jobRef":{"type":"string"},"status":{"type":"string","enum":["queued","running","progress","done","failed"]},"percent":{"type":"number","minimum":0,"maximum":100},"message":{"type":"string"},"result":{"type":"object","additionalProperties":{}},"at":{"type":"string","format":"date-time"}},"required":["jobRef","status"]}},"parameters":{}},"paths":{"/api/v1/key":{"get":{"tags":["Account"],"summary":"Describe this API key","security":[{"apiKey":[]}],"responses":{"200":{"description":"The key, its organization and plan, and the workspaces it reaches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyInfo"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/credits":{"get":{"tags":["Account"],"summary":"Credit balance","security":[{"apiKey":[]}],"responses":{"200":{"description":"The balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalance"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/carousel-templates":{"get":{"tags":["Carousels"],"summary":"List carousel templates","security":[{"apiKey":[]}],"responses":{"200":{"description":"Built-in carousel templates; premium ones are locked below Pro.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarouselTemplateList"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/posts/generate":{"post":{"tags":["Posts"],"summary":"Generate a post (1–3 versions)","description":"Writes 1–3 versions in your voice. Costs `post.generate` credits once per request. Send `Accept: text/event-stream` to stream the writing.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","example":"order-8812-post-1"},"required":true,"description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","maxLength":8000,"default":""},"contentStyleId":{"type":["string","null"],"minLength":1,"maxLength":100},"kbItemIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":10},"url":{"type":"string","maxLength":2048,"format":"uri"},"uploadObjectId":{"type":"string","format":"uuid"},"plannedDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"theme":{"type":"string","maxLength":200},"answers":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","maxLength":500},"answer":{"type":"string","maxLength":2000}},"required":["question","answer"]},"maxItems":3},"sourceRefs":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["corpus_post","trending_item","lead_magnet"]},"id":{"type":"string","minLength":1,"maxLength":64}},"required":["type","id"]},"maxItems":3},"idempotencyKey":{"type":"string","minLength":8,"maxLength":100,"pattern":"^[\\w.:-]+$"},"versions":{"type":"integer","minimum":1,"maximum":3,"default":3}}}}}},"responses":{"200":{"description":"The drafts (or a question).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateResult"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/posts/generate-batch":{"post":{"tags":["Posts"],"summary":"Generate 5 variations","description":"Five drafts from five angles in one request (`post.batch`). Failed drafts are listed in `failed` and not charged.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","example":"order-8812-post-1"},"required":true,"description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","maxLength":8000,"default":""},"contentStyleId":{"type":["string","null"],"minLength":1,"maxLength":100},"kbItemIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":10},"url":{"type":"string","maxLength":2048,"format":"uri"},"uploadObjectId":{"type":"string","format":"uuid"},"plannedDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"theme":{"type":"string","maxLength":200},"answers":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","maxLength":500},"answer":{"type":"string","maxLength":2000}},"required":["question","answer"]},"maxItems":3},"sourceRefs":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["corpus_post","trending_item","lead_magnet"]},"id":{"type":"string","minLength":1,"maxLength":64}},"required":["type","id"]},"maxItems":3},"idempotencyKey":{"type":"string","minLength":8,"maxLength":100,"pattern":"^[\\w.:-]+$"}}}}}},"responses":{"200":{"description":"The drafts (or a question).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateResult"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/posts":{"post":{"tags":["Posts"],"summary":"Save a post you wrote","description":"Free. Send `text` (LinkedIn text; styled Unicode becomes bold/italic) or `contentDoc`. Up to 3,000 characters.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"contentDoc":{"type":"object","properties":{"type":{"type":"string","enum":["doc"]},"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["paragraph"]},"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":20000},"marks":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic"]}},"required":["type"]},"maxItems":2}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["hardBreak"]}},"required":["type"]}]},"maxItems":3000}},"required":["type"]},"maxItems":3000}},"required":["type","content"]},"plannedDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"theme":{"type":"string","maxLength":200},"contentStyleId":{"type":["string","null"],"minLength":1,"maxLength":100},"source":{"type":"string","enum":["paste","import"],"default":"paste"}}}}}},"responses":{"201":{"description":"The new draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input breaks a rule (for example `post_too_long`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Posts"],"summary":"List posts","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","enum":["draft","pending_approval","approved","scheduled","publishing","published","failed","cancelled"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["drafts","in_review","approved","scheduled","published","archive"]},"required":false,"name":"tab","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of posts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostList"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/posts/timeline":{"get":{"tags":["Posts"],"summary":"Post timeline","description":"Published posts of the last 90 days and future scheduled posts (no drafts), up to 100.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"}],"responses":{"200":{"description":"The timeline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Timeline"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/posts/{postId}":{"get":{"tags":["Posts"],"summary":"Get a post","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"postId","in":"path"}],"responses":{"200":{"description":"The post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Posts"],"summary":"Update a post","description":"Content (≤ 3,000 characters) and/or details. Only drafts, failed and unlocked scheduled posts are editable (409 `post_locked`).","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"postId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contentStyleId":{"type":["string","null"],"minLength":1,"maxLength":100},"plannedDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"theme":{"type":["string","null"],"maxLength":200},"documentTitle":{"type":["string","null"],"maxLength":200},"content":{"type":"string","maxLength":20000},"contentDoc":{"type":"object","properties":{"type":{"type":"string","enum":["doc"]},"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["paragraph"]},"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":20000},"marks":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic"]}},"required":["type"]},"maxItems":2}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["hardBreak"]}},"required":["type"]}]},"maxItems":3000}},"required":["type"]},"maxItems":3000}},"required":["type","content"]}}}}}},"responses":{"200":{"description":"The updated post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input breaks a rule (for example `post_too_long`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Posts"],"summary":"Delete a post","description":"Drafts, failed, archived and approved-but-unscheduled posts. A scheduled post needs `cancel-schedule` first; published posts are deleted on LinkedIn (409).","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"postId","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/posts/{postId}/schedule":{"post":{"tags":["Scheduling"],"summary":"Schedule a post","description":"Needs a connected LinkedIn account and a time at least a minute ahead. With approvals on, editors may schedule only approved posts (403 `forbidden` with `details.reason: \"approval_required\"`). A post in review is 409.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"postId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scheduledAt":{"type":"string","format":"date-time"},"localDateTime":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$"},"firstComment":{"type":["string","null"],"maxLength":5000},"expect":{"type":"object","properties":{"scheduleVersion":{"type":"integer","minimum":0}},"required":["scheduleVersion"],"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"Scheduled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleState"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/posts/{postId}/cancel-schedule":{"post":{"tags":["Scheduling"],"summary":"Cancel a schedule","description":"The post goes back to a draft (approved posts stay approved).","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"postId","in":"path"}],"responses":{"200":{"description":"Not scheduled any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleState"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/content-styles":{"get":{"tags":["Content styles"],"summary":"List content styles","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"includeArchived","in":"query"}],"responses":{"200":{"description":"Presets and custom styles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentStyleList"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Content styles"],"summary":"Create a content style","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"type":["string","null"],"maxLength":240},"guidance":{"type":["string","null"],"maxLength":4000},"examples":{"type":"array","items":{"type":"string","minLength":1,"maxLength":3000},"maxItems":5}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"The new style.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentStyle"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/content-styles/{styleId}":{"get":{"tags":["Content styles"],"summary":"Get a content style","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100,"example":"preset:story"},"required":true,"name":"styleId","in":"path"}],"responses":{"200":{"description":"The style.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentStyle"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Content styles"],"summary":"Update a content style","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100,"example":"preset:story"},"required":true,"name":"styleId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"type":["string","null"],"maxLength":240},"guidance":{"type":["string","null"],"maxLength":4000}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated style.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentStyle"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Content styles"],"summary":"Archive a content style","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100,"example":"preset:story"},"required":true,"name":"styleId","in":"path"}],"responses":{"200":{"description":"The archived style.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentStyle"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/content-styles/{styleId}/examples":{"post":{"tags":["Content styles"],"summary":"Add example posts to a style","description":"Up to 5 texts per call, 20 per style.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100,"example":"preset:story"},"required":true,"name":"styleId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"examples":{"type":"array","items":{"type":"string","minLength":1,"maxLength":3000},"minItems":1,"maxItems":20}},"required":["examples"],"additionalProperties":false}}}},"responses":{"200":{"description":"The style with its examples.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentStyle"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input breaks a rule (for example `post_too_long`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/content-styles/{styleId}/examples/{index}":{"delete":{"tags":["Content styles"],"summary":"Remove an example from a style","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100,"example":"preset:story"},"required":true,"name":"styleId","in":"path"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":99,"example":0},"required":true,"name":"index","in":"path"},{"schema":{"type":"string","pattern":"^[0-9a-f]{16}$"},"required":true,"name":"key","in":"query"}],"responses":{"200":{"description":"The style without that example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentStyle"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/carousels":{"post":{"tags":["Carousels"],"summary":"Create an AI carousel","description":"Plans and draws the slides, then builds the PDF. Credits (`carousel.create`) are held now and charged when the PDF is built. One generation per organization at a time (409 `carousel_in_progress`).","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","example":"order-8812-post-1"},"required":true,"description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","maxLength":50000},"slides":{"type":"array","items":{"type":"string","maxLength":50000},"maxItems":100},"slideCount":{"type":"integer","minimum":3,"maximum":12,"default":8},"size":{"type":"string","enum":["portrait","square"],"default":"portrait"},"stylePreset":{"type":["string","null"],"enum":["photo","editorial_illustration","flat_vector","3d_clay","line_art","watercolor","isometric","minimal","bold_poster","risograph","paper_cut","blueprint",null]},"references":{"type":"array","items":{"type":"object","properties":{"objectId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["style","subject","logo"]}},"required":["objectId","role"],"additionalProperties":false},"maxItems":20,"default":[]},"useBrandKit":{"type":"boolean","default":false}},"additionalProperties":false}}}},"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarouselStarted"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/carousels/{id}":{"get":{"tags":["Carousels"],"summary":"Get a carousel","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The carousel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Carousel"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/carousels/{id}/changes":{"post":{"tags":["Carousels"],"summary":"Change a carousel","description":"Add, redraw, remove or move slides. 10 credits per slide added or redrawn (only for slides that succeed), at most 50 per change; removing and moving are free.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","example":"order-8812-post-1"},"required":true,"description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ops":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","enum":["add"]},"prompt":{"type":"string","maxLength":50000},"position":{"type":"integer","minimum":0,"maximum":1000}},"required":["op","prompt"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["redraw"]},"slideId":{"type":"string","format":"uuid"},"instruction":{"type":"string","maxLength":50000},"referenceObjectIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20}},"required":["op","slideId"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["remove"]},"slideId":{"type":"string","format":"uuid"}},"required":["op","slideId"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["move"]},"slideId":{"type":"string","format":"uuid"},"toPosition":{"type":"integer","minimum":0,"maximum":1000}},"required":["op","slideId","toPosition"],"additionalProperties":false}]},"minItems":1,"maxItems":40},"expectedRevision":{"type":"integer","minimum":0}},"required":["ops"],"additionalProperties":false}}}},"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarouselChangeStarted"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/infographics":{"post":{"tags":["Infographics"],"summary":"Create an infographic","description":"`infographic.generate` credits, held now and charged when the image is ready. Counts toward the daily image cap.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","example":"order-8812-post-1"},"required":true,"description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","maxLength":50000},"postContent":{"type":"string","maxLength":100000},"kbItemIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"renderMode":{"type":"string","enum":["html","ai_image"],"default":"html"},"templateKey":{"type":"string","enum":["infographic-flat-grid","infographic-bright-data","infographic-mono-line","infographic-notebook","infographic-magazine","infographic-dark-data","infographic-blueprint","infographic-poster-print"]},"stylePreset":{"type":["string","null"],"enum":["photo","editorial_illustration","flat_vector","3d_clay","line_art","watercolor","isometric","minimal","bold_poster","risograph","paper_cut","blueprint",null]},"references":{"type":"array","items":{"type":"object","properties":{"objectId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["style","subject","logo"]}},"required":["objectId","role"],"additionalProperties":false},"maxItems":20,"default":[]},"aspect":{"type":"string","enum":["portrait","square","landscape"],"default":"portrait"},"useBrandKit":{"type":"boolean","default":false}},"required":["prompt"],"additionalProperties":false}}}},"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfographicStarted"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input breaks a rule (for example `post_too_long`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Infographics"],"summary":"List infographics","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of infographics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfographicList"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/infographics/{id}":{"get":{"tags":["Infographics"],"summary":"Get an infographic","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The infographic.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Infographic"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Infographics"],"summary":"Delete an infographic","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces/{workspaceId}/infographics/{id}/edit":{"post":{"tags":["Infographics"],"summary":"Edit an infographic","description":"`infographic.edit` credits per change, charged when the new version is ready.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","example":"order-8812-post-1"},"required":true,"description":"Required. ≤ 100 printable characters. A retry with the same key and body returns the first answer and is never charged twice; the same key with another body → 409 `idempotency_conflict`. Answers are kept 24 h.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"instruction":{"type":"string","maxLength":50000},"referenceObjectIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]}},"required":["instruction"],"additionalProperties":false}}}},"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfographicStarted"}}}},"400":{"description":"Invalid input (`validation_error`, `idempotency_key_required`, `linkedin_not_connected`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with `details.reason` (`request_in_progress`, `already_done`, `item_moved`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input breaks a rule (for example `post_too_long`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/jobs/{jobId}":{"get":{"tags":["Jobs"],"summary":"Job status","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"example":"carousel-build:0b3f…:0"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"The last known state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatus"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/jobs/{jobId}/events":{"get":{"tags":["Jobs"],"summary":"Job progress (SSE)","description":"Server-sent events: the last event first, then each update until `done` or `failed`; a `: keep-alive` comment every 15 s; closed after 10 minutes (reconnect to resume).","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"example":"carousel-build:0b3f…:0"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"An event stream.","content":{"text/event-stream":{"schema":{"type":"string"}}}},"401":{"description":"`api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown, revoked or expired key, or its creator left the organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_required` (trial ended or no live subscription) or `insufficient_credits`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_limit` (the plan lacks `api_access`, or a daily cap was reached) or `forbidden` (the key's role can't do this).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the id does not exist or the key can't reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`; see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}