{"components":{"responses":{},"schemas":{"TokenResponse":{"description":"A short-lived JWT access token, a refresh token and the user.","properties":{"access_token":{"description":"Short-lived Bearer JWT","example":"eyJhbGciOiJ...","type":"string"},"expires_in":{"description":"Access token lifetime in seconds","example":900,"type":"integer"},"refresh_token":{"description":"Opaque refresh token; rotates on every use","example":"M2Zk...opaque","type":"string"},"token_type":{"example":"bearer","type":"string"},"user":{"$ref":"#/components/schemas/User"}},"required":["access_token","refresh_token","token_type","expires_in","user"],"title":"TokenResponse","type":"object"},"ProfileUpdateInput":{"properties":{"locale":{"enum":["ru","en"],"type":"string"}},"required":["locale"],"title":"ProfileUpdateInput","type":"object"},"PublishingStatus":{"properties":{"accounts":{"items":{"$ref":"#/components/schemas/SocialAccount"},"type":"array"},"bot":{"$ref":"#/components/schemas/ServiceBot"},"channels":{"items":{"$ref":"#/components/schemas/PublishingChannel"},"type":"array"},"connected_platforms":{"description":"Platforms with at least one attached channel","items":{"type":"string"},"type":"array"},"telegram_link":{"description":"Personal Telegram linking: linked=false comes with the t.me /start url and embed_url (connector-hosted instruction page for an iframe, accepts ?theme=light|dark) to bind the user's Telegram identity; linked=true once consumed","nullable":true,"properties":{"embed_url":{"description":"Iframe-embeddable connection instruction; append ?theme=light|dark","nullable":true,"type":"string"},"linked":{"type":"boolean"},"url":{"nullable":true,"type":"string"}},"required":["linked"],"type":"object"}},"required":["channels","connected_platforms","accounts"],"title":"PublishingStatus","type":"object"},"KnowledgeDigest":{"properties":{"key_facts":{"items":{"type":"string"},"type":"array"},"summary":{"type":"string"}},"title":"KnowledgeDigest","type":"object"},"Profile":{"properties":{"attributes":{"type":"object"},"dimension_id":{"type":"integer"},"id":{"type":"integer"},"is_active":{"type":"boolean"},"label":{"nullable":true,"type":"string"},"position":{"type":"integer"},"slug":{"type":"string"}},"title":"Profile","type":"object"},"LogoutRequest":{"properties":{"refresh_token":{"description":"The refresh token to revoke","type":"string"}},"required":["refresh_token"],"title":"LogoutRequest","type":"object"},"Artifact":{"properties":{"content":{"nullable":true,"type":"string"},"key":{"type":"string"},"kind":{"enum":["text","image"],"type":"string"},"mime":{"nullable":true,"type":"string"},"source":{"enum":["seed","generation"],"type":"string"},"url":{"description":"Presigned image URL","nullable":true,"type":"string"}},"title":"Artifact","type":"object"},"Dimension":{"properties":{"id":{"type":"integer"},"is_active":{"type":"boolean"},"key":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}},"title":"Dimension","type":"object"},"VisibilityInput":{"properties":{"visibility":{"enum":["private","authenticated","public"],"type":"string"}},"required":["visibility"],"title":"VisibilityInput","type":"object"},"Brief":{"properties":{"id":{"type":"integer"},"image_needed":{"type":"boolean"},"inserted_at":{"format":"date-time","type":"string"},"intent":{"nullable":true,"type":"string"},"knowledge":{"items":{"type":"object"},"type":"array"},"payload":{"type":"object"},"preset_key":{"nullable":true,"type":"string"},"product_id":{"nullable":true,"type":"integer"},"targets":{"items":{"type":"object"},"type":"array"}},"required":["id"],"title":"Brief","type":"object"},"ProductInput":{"properties":{"name":{"type":"string"},"payload":{"description":"Must include a non-empty \"pitch\"","type":"object"}},"required":["name"],"title":"ProductInput","type":"object"},"RefreshRequest":{"properties":{"refresh_token":{"description":"A valid refresh token","type":"string"}},"required":["refresh_token"],"title":"RefreshRequest","type":"object"},"Error":{"properties":{"errors":{"description":"Either a `detail` string or per-field validation messages.","example":{"detail":"invalid_credentials"},"type":"object"}},"required":["errors"],"title":"Error","type":"object"},"Publication":{"properties":{"channel":{"$ref":"#/components/schemas/PublishingChannel"},"error":{"nullable":true,"type":"string"},"external_url":{"nullable":true,"type":"string"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"kind":{"enum":["text","image","carousel"],"type":"string"},"platform":{"type":"string"},"published_at":{"format":"date-time","nullable":true,"type":"string"},"scheduled_at":{"format":"date-time","nullable":true,"type":"string"},"status":{"enum":["scheduled","queued","publishing","published","failed","canceled","deleted"],"type":"string"},"text":{"nullable":true,"type":"string"}},"required":["id","status","kind"],"title":"Publication","type":"object"},"ServiceBot":{"nullable":true,"properties":{"platform":{"type":"string"},"username":{"description":"Bot the client must add as channel admin before attaching it","nullable":true,"type":"string"}},"required":["platform"],"title":"ServiceBot","type":"object"},"GoogleAuthRequest":{"description":"Google sign-in. `token` is a Google OAuth access token.","properties":{"token":{"description":"Google access token","type":"string"}},"required":["token"],"title":"GoogleAuthRequest","type":"object"},"SocialAccount":{"properties":{"channels":{"items":{"$ref":"#/components/schemas/PublishingChannel"},"type":"array"},"id":{"type":"integer"},"name":{"description":"Platform-side account name","nullable":true,"type":"string"},"platform":{"description":"Catalog platform slug, e.g. telegram","type":"string"},"status":{"enum":["connected","expired","revoked"],"type":"string"}},"required":["id","platform","status","channels"],"title":"SocialAccount","type":"object"},"FeedPost":{"description":"A feed post: one text body with its images nested. `total` in the feed response counts posts, not generations. An image-only post has content=null and the picture as its single images entry.","properties":{"brief_id":{"type":"integer"},"content":{"description":"Post text; null for image-only posts","nullable":true,"type":"string"},"feedback_comment":{"nullable":true,"type":"string"},"format_slug":{"nullable":true,"type":"string"},"id":{"description":"Share slug of the post's text (or image-only) generation","type":"string"},"images":{"description":"Post images in order (multiple for carousels)","items":{"properties":{"generation_id":{"description":"Image generation share slug","type":"string"},"order":{"type":"integer"},"url":{"description":"Presigned image URL","nullable":true,"type":"string"}},"type":"object"},"type":"array"},"inserted_at":{"format":"date-time","type":"string"},"kind":{"enum":["text","image"],"type":"string"},"platform_slug":{"nullable":true,"type":"string"},"run_id":{"type":"string"},"stage":{"enum":["reference","platform"],"type":"string"},"variant_group":{"type":"string"},"verdict":{"enum":["like","dislike"],"nullable":true,"type":"string"}},"required":["id","images"],"title":"FeedPost","type":"object"},"ConnectLinkRequest":{"properties":{"platform":{"description":"OAuth platform slug, e.g. x","type":"string"}},"required":["platform"],"title":"ConnectLinkRequest","type":"object"},"AddChannelRequest":{"properties":{"channel":{"description":"@handle, t.me link or platform chat id of the destination","type":"string"},"platform":{"description":"Platform slug for the service-bot flow; defaults to telegram","type":"string"},"product_id":{"description":"Bind the channel to one of the user's products","nullable":true,"type":"integer"}},"required":["channel"],"title":"AddChannelRequest","type":"object"},"ConnectAccountRequest":{"properties":{"credentials":{"description":"Per-connector secret map, e.g. {\"bot_token\": \"...\"} for Telegram","type":"object"},"platform":{"description":"Catalog platform slug, e.g. telegram","type":"string"}},"required":["platform","credentials"],"title":"ConnectAccountRequest","type":"object"},"CorpusInput":{"properties":{"filters":{"type":"object"},"k":{"description":"Top-K results","example":8,"type":"integer"},"query":{"type":"string"}},"required":["query"],"title":"CorpusInput","type":"object"},"GenerateReferenceInput":{"properties":{"variants":{"example":2,"minimum":1,"type":"integer"}},"title":"GenerateReferenceInput","type":"object"},"KnowledgeSourceType":{"properties":{"description":{"description":"What this source type does, in the requested locale","type":"string"},"name":{"description":"Human-readable name in the requested locale","type":"string"},"type":{"enum":["landing","corpus"],"type":"string"}},"title":"KnowledgeSourceType","type":"object"},"BriefPlan":{"properties":{"plan":{"properties":{"fields":{"type":"object"},"missing":{"items":{"type":"string"},"type":"array"},"preset_key":{"type":"string"},"reasoning":{"nullable":true,"type":"string"}},"type":"object"}},"title":"BriefPlan","type":"object"},"PublishingChannel":{"properties":{"external_id":{"type":"string"},"id":{"type":"integer"},"kind":{"enum":["channel","group","page","profile"],"type":"string"},"name":{"nullable":true,"type":"string"},"product_id":{"description":"Product the channel is bound to; null accepts any of the user's content","nullable":true,"type":"integer"},"username":{"nullable":true,"type":"string"}},"required":["id","external_id","kind"],"title":"PublishingChannel","type":"object"},"User":{"description":"An authenticated user.","properties":{"email":{"example":"alice@example.com","format":"email","type":"string"},"email_confirmed_at":{"format":"date-time","nullable":true,"type":"string"},"id":{"example":1,"type":"integer"},"identities":{"description":"Which OAuth providers are linked to the account.","example":{"apple":false,"facebook":false,"google":true},"properties":{"apple":{"type":"boolean"},"facebook":{"type":"boolean"},"google":{"type":"boolean"}},"type":"object"},"locale":{"description":"Interface locale; catalog descriptions are returned in it","enum":["ru","en"],"type":"string"},"name":{"example":"Alice","nullable":true,"type":"string"},"role":{"example":"user","type":"string"},"username":{"example":"alice","nullable":true,"type":"string"}},"required":["id","email"],"title":"User","type":"object"},"ProfileInput":{"properties":{"attributes":{"type":"object"},"is_active":{"type":"boolean"},"label":{"nullable":true,"type":"string"},"position":{"type":"integer"},"slug":{"type":"string"}},"required":["slug"],"title":"ProfileInput","type":"object"},"FeedbackInput":{"properties":{"comment":{"nullable":true,"type":"string"},"generation_slug":{"description":"Public share slug of the rated generation (ownership is checked)","nullable":true,"type":"string"},"prompt_id":{"description":"Rate a catalog prompt directly, when not rating a generation","nullable":true,"type":"integer"},"target":{"enum":["reference","platform"],"nullable":true,"type":"string"},"verdict":{"enum":["like","dislike"],"type":"string"}},"required":["verdict"],"title":"FeedbackInput","type":"object"},"UploadInput":{"properties":{"content_type":{"example":"image/png","type":"string"},"data":{"description":"base64-encoded image bytes","format":"byte","type":"string"},"key":{"description":"Artifact key within the brief (e.g. \"logo\")","type":"string"}},"required":["key","data"],"title":"UploadInput","type":"object"},"KnowledgeSourceInput":{"properties":{"auth_header":{"description":"Encrypted at rest; never returned","nullable":true,"type":"string"},"name":{"nullable":true,"type":"string"},"type":{"enum":["landing","corpus"],"type":"string"},"url":{"description":"http(s) URL","type":"string"}},"required":["url","type"],"title":"KnowledgeSourceInput","type":"object"},"PublicationInput":{"properties":{"channel_id":{"type":"integer"},"generation_ids":{"description":"Share slugs of the done generations to combine (the feed post's id and its images[].generation_id): at most one text, any number of images","items":{"type":"string"},"type":"array"},"scheduled_at":{"description":"ISO8601 UTC; omit to publish immediately","format":"date-time","nullable":true,"type":"string"}},"required":["channel_id","generation_ids"],"title":"PublicationInput","type":"object"},"LoginRequest":{"properties":{"email":{"example":"alice@example.com","format":"email","type":"string"},"password":{"format":"password","type":"string"}},"required":["email","password"],"title":"LoginRequest","type":"object"},"DimensionInput":{"properties":{"is_active":{"type":"boolean"},"key":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}},"required":["key","label"],"title":"DimensionInput","type":"object"},"KnowledgeSource":{"properties":{"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"is_active":{"type":"boolean"},"name":{"nullable":true,"type":"string"},"type":{"enum":["landing","corpus"],"type":"string"},"url":{"type":"string"}},"title":"KnowledgeSource","type":"object"},"DimensionUpdateInput":{"properties":{"is_active":{"type":"boolean"},"label":{"type":"string"},"position":{"type":"integer"}},"required":["label"],"title":"DimensionUpdateInput","type":"object"},"ProductPlanInput":{"properties":{"description":{"description":"Free-text brand/product description","type":"string"}},"required":["description"],"title":"ProductPlanInput","type":"object"},"BriefInput":{"properties":{"image_needed":{"type":"boolean"},"intent":{"nullable":true,"type":"string"},"knowledge":{"items":{"type":"object"},"type":"array"},"payload":{"type":"object"},"preset_key":{"nullable":true,"type":"string"},"product_id":{"nullable":true,"type":"integer"},"targets":{"items":{"type":"object"},"type":"array"}},"required":["payload"],"title":"BriefInput","type":"object"},"Product":{"properties":{"covered_topics":{"items":{"properties":{"brief_id":{"nullable":true,"type":"integer"},"created_at":{"type":"string"},"id":{"type":"string"},"source":{"type":"string"},"summary":{"type":"string"}},"type":"object"},"type":"array"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"name":{"type":"string"},"payload":{"description":"Brand-knowledge values keyed by product-field","type":"object"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","name"],"title":"Product","type":"object"},"StudyInput":{"properties":{"input":{"description":"A URL or raw text","type":"string"}},"required":["input"],"title":"StudyInput","type":"object"},"Generation":{"properties":{"content":{"nullable":true,"type":"string"},"feedback_comment":{"description":"Operator feed only","nullable":true,"type":"string"},"format_slug":{"nullable":true,"type":"string"},"id":{"description":"Non-guessable share slug (not the PK)","type":"string"},"image_url":{"description":"Presigned image URL","nullable":true,"type":"string"},"inserted_at":{"format":"date-time","type":"string"},"kind":{"enum":["text","image"],"type":"string"},"latency_ms":{"nullable":true,"type":"integer"},"model":{"nullable":true,"type":"string"},"platform_slug":{"nullable":true,"type":"string"},"provider":{"description":"apikey | oauth","nullable":true,"type":"string"},"stage":{"enum":["reference","platform"],"type":"string"},"variant_group":{"type":"string"},"verdict":{"description":"Latest feedback verdict (operator feed only)","enum":["like","dislike"],"nullable":true,"type":"string"},"visibility":{"enum":["private","authenticated","public"],"type":"string"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["id"],"title":"Generation","type":"object"},"ConnectLink":{"properties":{"connect":{"description":"Open embed_url in a new tab (providers forbid framing OAuth) where the user authorizes their own account; the account and its channel land via the account.added webhook","properties":{"embed_url":{"type":"string"},"expires_at":{"format":"date-time","type":"string"},"platform":{"type":"string"}},"required":["platform","embed_url"],"type":"object"}},"required":["connect"],"title":"ConnectLink","type":"object"},"ReviseInput":{"properties":{"instruction":{"example":"Сделай дружелюбнее","type":"string"}},"required":["instruction"],"title":"ReviseInput","type":"object"},"ProductAsset":{"properties":{"key":{"description":"S3 object key to store in the product payload (e.g. brand_assets)","type":"string"},"url":{"description":"Presigned preview URL","type":"string"}},"required":["key"],"title":"ProductAsset","type":"object"},"PlanInput":{"properties":{"intent":{"description":"Free-text content intent","type":"string"},"product_id":{"nullable":true,"type":"integer"}},"required":["intent"],"title":"PlanInput","type":"object"},"GeneratePlatformsInput":{"properties":{"slide_counts":{"additionalProperties":{"maximum":10,"minimum":2,"type":"integer"},"description":"Slide count per carousel target, keyed by \"platform/format\".","example":{"instagram/carousel":5},"type":"object"},"targets":{"items":{"properties":{"format_slugs":{"example":["post","carousel"],"items":{"type":"string"},"type":"array"},"platform_slug":{"example":"instagram","type":"string"}},"type":"object"},"type":"array"}},"required":["targets"],"title":"GeneratePlatformsInput","type":"object"},"Feedback":{"properties":{"applied":{"type":"boolean"},"applied_at":{"format":"date-time","nullable":true,"type":"string"},"applied_system":{"nullable":true,"type":"string"},"applied_user":{"nullable":true,"type":"string"},"comment":{"nullable":true,"type":"string"},"generation_id":{"nullable":true,"type":"integer"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"prompt_id":{"nullable":true,"type":"integer"},"reasoning":{"nullable":true,"type":"string"},"suggested_system":{"nullable":true,"type":"string"},"suggested_user":{"nullable":true,"type":"string"},"target":{"enum":["reference","platform"],"nullable":true,"type":"string"},"verdict":{"enum":["like","dislike"],"type":"string"}},"required":["id"],"title":"Feedback","type":"object"},"ProductField":{"properties":{"description":{"nullable":true,"type":"string"},"group":{"type":"string"},"help_text":{"nullable":true,"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"options":{"type":"object"},"placeholder":{"nullable":true,"type":"string"},"position":{"type":"integer"},"required":{"type":"boolean"},"type":{"type":"string"},"use_as_reference":{"type":"boolean"}},"title":"ProductField","type":"object"},"RegisterRequest":{"properties":{"email":{"example":"alice@example.com","format":"email","type":"string"},"name":{"example":"Alice","nullable":true,"type":"string"},"password":{"format":"password","maxLength":72,"minLength":8,"type":"string"},"username":{"example":"alice","nullable":true,"type":"string"}},"required":["email","password"],"title":"RegisterRequest","type":"object"},"ProductAssetInput":{"properties":{"content_type":{"description":"image/png | image/jpeg | image/webp | image/gif (default image/png)","example":"image/png","type":"string"},"data":{"description":"base64-encoded image bytes","format":"byte","type":"string"}},"required":["data"],"title":"ProductAssetInput","type":"object"}},"securitySchemes":{"bearer":{"bearerFormat":"JWT","description":"JWT access token issued by the auth endpoints.","scheme":"bearer","type":"http"}}},"info":{"description":"Authentication API with email/password and Apple/Google/Facebook sign-in.","title":"PostCraft API","version":"1.0.0"},"openapi":"3.0.0","paths":{"/api/v1/generations":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.GenerationController.feed","parameters":[{"description":"Stage filter; `all` keeps both stages (default `platform`)","in":"query","name":"stage","required":false,"schema":{"enum":["platform","reference","all"],"type":"string"}},{"description":"Platform slug filter","in":"query","name":"platform","required":false,"schema":{"type":"string"}},{"description":"Format slug filter","in":"query","name":"format","required":false,"schema":{"type":"string"}},{"description":"Page number (>= 1)","in":"query","name":"page","required":false,"schema":{"type":"integer"}},{"description":"Page size (1..50)","in":"query","name":"per_page","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"feed":{"items":{"$ref":"#/components/schemas/FeedPost"},"type":"array"},"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"description":"Number of posts (not generations)","type":"integer"}},"type":"object"}}},"description":"Feed"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid stage"}},"security":[{"bearer":[]}],"summary":"Operator feed: finished posts across briefs with their latest verdict","tags":["generations"]}},"/api/v1/briefs/{brief_id}/artifacts":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.UploadController.index","parameters":[{"description":"","in":"path","name":"brief_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"artifacts":{"items":{"$ref":"#/components/schemas/Artifact"},"type":"array"}},"type":"object"}}},"description":"Artifacts"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"List a brief's artifact pool","tags":["uploads"]}},"/api/v1/generations/{id}/choose":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.GenerationController.choose","parameters":[{"description":"Generation share slug","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"generation":{"$ref":"#/components/schemas/Generation"}},"type":"object"}}},"description":"Generation"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not the owner"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Pick a variant (clears its siblings, promotes its artifact)","tags":["generations"]}},"/api/v1/logout_all":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AuthController.logout_all","parameters":[],"responses":{"204":{"content":{"application/json":{}},"description":"All refresh tokens revoked"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid access token"}},"security":[{"bearer":[]}],"summary":"Revoke all of the current user's refresh tokens (log out everywhere)","tags":["auth"]}},"/api/v1/register":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AuthController.register","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"description":"Registration params","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}},"description":"Token"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation errors"}},"summary":"Register with email and password","tags":["auth"]}},"/api/v1/briefs/{brief_id}/generate-platforms":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.GenerationController.generate_platforms","parameters":[{"description":"","in":"path","name":"brief_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratePlatformsInput"}}},"description":"Targets","required":false},"responses":{"202":{"content":{"application/json":{"schema":{"properties":{"generations":{"items":{"$ref":"#/components/schemas/Generation"},"type":"array"}},"type":"object"}}},"description":"Enqueued generations"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No chosen reference"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Stage 2: adapt the chosen reference to platform/format targets","tags":["generations"]}},"/api/v1/knowledge/study":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.KnowledgeController.study","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyInput"}}},"description":"Source","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeDigest"}}},"description":"Digest"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid input"}},"security":[{"bearer":[]}],"summary":"Summarize a URL or raw text into a digest","tags":["knowledge"]}},"/api/v1/publishing/accounts":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublishingController.connect","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectAccountRequest"}}},"description":"Credentials","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialAccount"}}},"description":"Account"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Platform rejected the request"}},"security":[{"bearer":[]}],"summary":"Connect a platform account (Telegram: bot token)","tags":["publishing"]}},"/api/v1/briefs/{brief_id}/uploads":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.UploadController.create","parameters":[{"description":"","in":"path","name":"brief_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadInput"}}},"description":"Upload","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"artifact":{"$ref":"#/components/schemas/Artifact"}},"type":"object"}}},"description":"Artifact"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid image data"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Upload a brand image into a brief's artifact pool","tags":["uploads"]}},"/api/v1/briefs/{brief_id}/generations":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.GenerationController.index","parameters":[{"description":"","in":"path","name":"brief_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"generations":{"items":{"$ref":"#/components/schemas/Generation"},"type":"array"}},"type":"object"}}},"description":"Generations"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"List a brief's generations (status, result, warnings, image_url)","tags":["generations"]}},"/api/v1/products/{product_id}/audience/propose":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.propose","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"dimensions":{"items":{"type":"object"},"type":"array"}},"type":"object"}}},"description":"Proposal"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"AI: propose audience dimensions and segments","tags":["audiences"]}},"/api/v1/products/{product_id}/knowledge/sources/{id}":{"delete":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.KnowledgeController.delete_source","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}},{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Delete a knowledge source","tags":["knowledge"]},"patch":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.KnowledgeController.update_source","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}},{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSourceInput"}}},"description":"Source","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"source":{"$ref":"#/components/schemas/KnowledgeSource"}},"type":"object"}}},"description":"Source"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation errors"}},"security":[{"bearer":[]}],"summary":"Update a knowledge source","tags":["knowledge"]}},"/api/v1/products/{product_id}/dimensions/{dimension_id}/profiles":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.create_profile","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}},{"description":"","in":"path","name":"dimension_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileInput"}}},"description":"Profile","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"profile":{"$ref":"#/components/schemas/Profile"}},"type":"object"}}},"description":"Profile"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Create a profile under a dimension","tags":["audiences"]}},"/api/v1/products/{product_id}/knowledge/sources":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.KnowledgeController.list_sources","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/KnowledgeSource"},"type":"array"},"types":{"items":{"$ref":"#/components/schemas/KnowledgeSourceType"},"type":"array"}},"type":"object"}}},"description":"Sources"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"List a product's knowledge sources and the source-type catalog","tags":["knowledge"]},"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.KnowledgeController.create_source","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSourceInput"}}},"description":"Source","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"source":{"$ref":"#/components/schemas/KnowledgeSource"}},"type":"object"}}},"description":"Source"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation errors"}},"security":[{"bearer":[]}],"summary":"Add a knowledge source to a product","tags":["knowledge"]}},"/api/v1/products/{id}":{"delete":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProductController.delete","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Delete a product","tags":["products"]},"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProductController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"product":{"$ref":"#/components/schemas/Product"}},"type":"object"}}},"description":"Product"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Get a product","tags":["products"]},"patch":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProductController.update (2)","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"}}},"description":"Product","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"product":{"$ref":"#/components/schemas/Product"}},"type":"object"}}},"description":"Product"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation errors"}},"security":[{"bearer":[]}],"summary":"Update a product","tags":["products"]},"put":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProductController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"}}},"description":"Product","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"product":{"$ref":"#/components/schemas/Product"}},"type":"object"}}},"description":"Product"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation errors"}},"security":[{"bearer":[]}],"summary":"Update a product","tags":["products"]}},"/api/v1/briefs":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.BriefController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"briefs":{"items":{"$ref":"#/components/schemas/Brief"},"type":"array"}},"type":"object"}}},"description":"Briefs"}},"security":[{"bearer":[]}],"summary":"List the current user's briefs","tags":["briefs"]},"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.BriefController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefInput"}}},"description":"Brief","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"brief":{"$ref":"#/components/schemas/Brief"}},"type":"object"}}},"description":"Brief"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation errors"}},"security":[{"bearer":[]}],"summary":"Submit a brief (snapshots the product)","tags":["briefs"]}},"/api/v1/briefs/plan":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.BriefController.plan","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanInput"}}},"description":"Intent","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefPlan"}}},"description":"Plan"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown product"}},"security":[{"bearer":[]}],"summary":"AI planner: free-text intent -> preset + prefilled fields","tags":["briefs"]}},"/api/v1/briefs/{id}":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.BriefController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"brief":{"$ref":"#/components/schemas/Brief"}},"type":"object"}}},"description":"Brief"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Get a brief","tags":["briefs"]}},"/api/v1/publishing/accounts/{account_id}/channels":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublishingController.add_channel","parameters":[{"description":"","in":"path","name":"account_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddChannelRequest"}}},"description":"Channel","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishingChannel"}}},"description":"Channel"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Platform rejected the request"}},"security":[{"bearer":[]}],"summary":"Attach a posting channel to an account","tags":["publishing"]}},"/api/v1/product-fields":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProductController.fields","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/ProductField"},"type":"array"}},"type":"object"}}},"description":"Fields"}},"security":[{"bearer":[]}],"summary":"List the product-field schema (brand/audience/voice) in the user's locale","tags":["products"]}},"/api/v1/publications":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublicationController.index","parameters":[{"description":"","in":"query","name":"product_id","required":false,"schema":{"type":"integer"}},{"description":"","in":"query","name":"status","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"publications":{"items":{"$ref":"#/components/schemas/Publication"},"type":"array"}},"type":"object"}}},"description":"Publications"}},"security":[{"bearer":[]}],"summary":"List publications, optionally for one product","tags":["publications"]},"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublicationController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationInput"}}},"description":"Publication","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}},"description":"Publication"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Publish done generations to a channel","tags":["publications"]}},"/api/v1/products/{product_id}/assets":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProductAssetController.create","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductAssetInput"}}},"description":"Asset","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"asset":{"$ref":"#/components/schemas/ProductAsset"}},"type":"object"}}},"description":"Asset"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid image data"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Upload a brand-asset image for a product","tags":["uploads"]}},"/api/v1/products/{product_id}/knowledge/sources/{id}/corpus":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.KnowledgeController.corpus","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}},{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorpusInput"}}},"description":"Query","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Corpus response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Corpus unavailable"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Query a corpus knowledge source for a summary and key facts","tags":["knowledge"]}},"/api/v1/publishing/accounts/{id}":{"delete":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublishingController.disconnect","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Disconnected"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Disconnect an account (removes its channels and history)","tags":["publishing"]}},"/api/v1/generations/{id}/visibility":{"patch":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.GenerationController.set_visibility","parameters":[{"description":"Generation share slug","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisibilityInput"}}},"description":"Visibility","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"generation":{"$ref":"#/components/schemas/Generation"}},"type":"object"}}},"description":"Generation"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not the owner"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Set a generation's visibility (private | authenticated | public)","tags":["generations"]}},"/api/v1/briefs/{brief_id}/generate-reference":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.GenerationController.generate_reference","parameters":[{"description":"","in":"path","name":"brief_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateReferenceInput"}}},"description":"Options","required":false},"responses":{"202":{"content":{"application/json":{"schema":{"properties":{"generations":{"items":{"$ref":"#/components/schemas/Generation"},"type":"array"}},"type":"object"}}},"description":"Enqueued generations"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Stage 1: enqueue reference variants (text/advice/image)","tags":["generations"]}},"/api/v1/feedback":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.FeedbackController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackInput"}}},"description":"Feedback","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"feedback":{"$ref":"#/components/schemas/Feedback"}},"type":"object"}}},"description":"Feedback"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation errors"}},"security":[{"bearer":[]}],"summary":"Record like/dislike feedback on a prompt or generation","tags":["feedback"]}},"/api/v1/products/{product_id}/dimensions/{id}":{"delete":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.delete_dimension","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}},{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Delete a dimension","tags":["audiences"]},"patch":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.update_dimension","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}},{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionUpdateInput"}}},"description":"Dimension","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"dimension":{"$ref":"#/components/schemas/Dimension"}},"type":"object"}}},"description":"Dimension"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Update a dimension","tags":["audiences"]}},"/api/v1/products/{product_id}/dimensions":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.index_dimensions","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"dimensions":{"items":{"$ref":"#/components/schemas/Dimension"},"type":"array"}},"type":"object"}}},"description":"Dimensions"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"List a product's dimensions","tags":["audiences"]},"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.create_dimension","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionInput"}}},"description":"Dimension","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"dimension":{"$ref":"#/components/schemas/Dimension"}},"type":"object"}}},"description":"Dimension"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Create a dimension","tags":["audiences"]}},"/api/v1/refresh":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AuthController.refresh","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"description":"Refresh params","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}},"description":"Token"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing, expired, revoked or reused refresh token"}},"summary":"Exchange a refresh token for a new access + refresh token pair","tags":["auth"]}},"/api/v1/form":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.BriefController.form","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Form"}},"security":[{"bearer":[]}],"summary":"Brief form metadata: basic fields, presets and platforms (in the user's locale)","tags":["briefs"]}},"/api/v1/me":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProfileController.show","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Current user"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid token"}},"security":[{"bearer":[]}],"summary":"Get the current authenticated user","tags":["profile"]},"patch":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProfileController.update","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdateInput"}}},"description":"Profile changes","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Updated user"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid token"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation errors"}},"security":[{"bearer":[]}],"summary":"Update the current user's profile (locale)","tags":["profile"]}},"/api/v1/products/{product_id}/audience/example":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.example","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"dimension":{"$ref":"#/components/schemas/Dimension"},"profile":{"$ref":"#/components/schemas/Profile"}},"type":"object"}}},"description":"Example"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Scaffold a starter audience segment (idempotent)","tags":["audiences"]}},"/api/v1/feedback/{id}/apply":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.FeedbackController.apply","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"feedback":{"$ref":"#/components/schemas/Feedback"}},"type":"object"}}},"description":"Feedback"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Admin only"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Apply the suggested edit to the catalog prompt (admin only)","tags":["feedback"]}},"/api/v1/logout":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AuthController.logout","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutRequest"}}},"description":"Logout params","required":false},"responses":{"204":{"content":{"application/json":{}},"description":"Refresh token revoked"}},"summary":"Revoke a refresh token","tags":["auth"]}},"/api/v1/generations/{id}/revise":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.GenerationController.revise","parameters":[{"description":"Generation share slug","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviseInput"}}},"description":"Instruction","required":false},"responses":{"202":{"content":{"application/json":{"schema":{"properties":{"generation":{"$ref":"#/components/schemas/Generation"}},"type":"object"}}},"description":"Revision"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not the owner"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Revise a generation (new variant in the parent chain)","tags":["generations"]}},"/api/v1/publishing/channels":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublishingController.attach_channel","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddChannelRequest"}}},"description":"Channel","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishingChannel"}}},"description":"Channel"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No service bot configured"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Platform rejected the request"}},"security":[{"bearer":[]}],"summary":"Attach a channel through the service bot (the client-side flow)","tags":["publishing"]}},"/api/v1/me/identities/{provider}":{"delete":{"callbacks":{},"description":"The last linked identity cannot be removed (it would lock the account out).","operationId":"PostCraftWeb.Api.V1.ProfileController.unlink_identity","parameters":[{"description":"OAuth provider","example":"google","in":"path","name":"provider","required":true,"schema":{"enum":["apple","google","facebook"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Updated user"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid token"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown provider or identity not linked"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Cannot unlink the last sign-in method"}},"security":[{"bearer":[]}],"summary":"Unlink an OAuth provider from the current user","tags":["profile"]},"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProfileController.link_identity","parameters":[{"description":"OAuth provider","example":"google","in":"path","name":"provider","required":true,"schema":{"enum":["apple","google","facebook"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthRequest"}}},"description":"Provider credential. Apple: {code,app_type?}. Google/Facebook: {token}.","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Updated user"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing/invalid token or provider credential"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown provider"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Provider already linked or identity in use by another account"}},"security":[{"bearer":[]}],"summary":"Link an OAuth provider (apple, google or facebook) to the current user","tags":["profile"]}},"/api/v1/publishing/channels/{id}":{"delete":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublishingController.remove_channel","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Removed"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Detach a posting channel","tags":["publishing"]}},"/api/v1/auth/{provider}":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AuthController.oauth","parameters":[{"description":"OAuth provider","example":"google","in":"path","name":"provider","required":true,"schema":{"enum":["apple","google","facebook"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthRequest"}}},"description":"Provider credential. Apple: {code,name?,app_type?}. Google/Facebook: {token}.","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}},"description":"Token"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid provider token"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown provider"}},"summary":"Sign in with an OAuth provider (apple, google or facebook)","tags":["auth"]}},"/api/v1/publishing/status":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublishingController.status","parameters":[{"description":"Narrow channels to ones usable for this product","in":"query","name":"product_id","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishingStatus"}}},"description":"Status"}},"security":[{"bearer":[]}],"summary":"Posting status: the service bot to add, connected channels, BYO accounts","tags":["publishing"]}},"/api/v1/products/{product_id}/audience":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.audience","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"audience":{"items":{"properties":{"key":{"type":"string"},"label":{"type":"string"},"options":{"items":{"properties":{"label":{"type":"string"},"slug":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Audience"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"List a product's audience as dimensions with profile options","tags":["audiences"]}},"/api/v1/products/{product_id}/profiles/{id}":{"delete":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.delete_profile","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}},{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Delete a profile","tags":["audiences"]},"patch":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.update_profile","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}},{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileInput"}}},"description":"Profile","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"profile":{"$ref":"#/components/schemas/Profile"}},"type":"object"}}},"description":"Profile"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Update a profile","tags":["audiences"]}},"/api/v1/products/plan":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProductController.plan","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPlanInput"}}},"description":"Description","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"plan":{"type":"object"}},"type":"object"}}},"description":"Plan"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid input"}},"security":[{"bearer":[]}],"summary":"AI: pre-fill product fields from a free-text description","tags":["products"]}},"/api/v1/publications/{id}/cancel":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublicationController.cancel","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}},"description":"Publication"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Cancel a scheduled or queued publication","tags":["publications"]}},"/api/v1/feedback/{id}/retarget":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.FeedbackController.retarget","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"target":{"type":"string"}},"type":"object"}}},"description":"Target","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"feedback":{"$ref":"#/components/schemas/Feedback"}},"type":"object"}}},"description":"Feedback"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Recompute the suggestion for another target (reference/platform)","tags":["feedback"]}},"/api/v1/products":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProductController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"products":{"items":{"$ref":"#/components/schemas/Product"},"type":"array"}},"type":"object"}}},"description":"Products"}},"security":[{"bearer":[]}],"summary":"List the current user's products","tags":["products"]},"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.ProductController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"}}},"description":"Product","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"product":{"$ref":"#/components/schemas/Product"}},"type":"object"}}},"description":"Product"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation errors"}},"security":[{"bearer":[]}],"summary":"Create a product","tags":["products"]}},"/api/v1/briefs/preview-reference-prompts":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.BriefController.preview_reference_prompts","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefInput"}}},"description":"Brief","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Prompts"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown product"}},"security":[{"bearer":[]}],"summary":"Preview the assembled reference prompts without persisting","tags":["briefs"]}},"/api/v1/products/{product_id}/profiles":{"get":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AudienceController.index_profiles","parameters":[{"description":"","in":"path","name":"product_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"profiles":{"items":{"$ref":"#/components/schemas/Profile"},"type":"array"}},"type":"object"}}},"description":"Profiles"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"List all profiles for a product (across dimensions)","tags":["audiences"]}},"/api/v1/login":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.AuthController.login","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"description":"Login params","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}},"description":"Token"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid credentials"}},"summary":"Log in with email and password","tags":["auth"]}},"/api/v1/publishing/connect-link":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.PublishingController.connect_link","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectLinkRequest"}}},"description":"Platform","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectLink"}}},"description":"Connect link"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Platform rejected the request"}},"security":[{"bearer":[]}],"summary":"Start an OAuth connect (X): returns an embed_url to open in a new tab","tags":["publishing"]}},"/api/v1/generations/{id}":{"delete":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.GenerationController.delete","parameters":[{"description":"Generation share slug","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"content":{"application/json":{}},"description":"Deleted"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not the owner"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Delete a generation","tags":["generations"]}},"/api/v1/feedback/{id}/suggest":{"post":{"callbacks":{},"operationId":"PostCraftWeb.Api.V1.FeedbackController.suggest","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"feedback":{"$ref":"#/components/schemas/Feedback"}},"type":"object"}}},"description":"Feedback"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"security":[{"bearer":[]}],"summary":"Ask the model for an improved prompt template","tags":["feedback"]}}},"security":[],"servers":[{"url":"https://api.postcraft.ebat.me","variables":{}}],"tags":[]}