{"openapi":"3.0.3","info":{"title":"Publora API","description":"Affordable REST API for scheduling and publishing social media posts\nacross X\/Twitter, LinkedIn, Instagram, Threads, TikTok, YouTube,\nFacebook, Bluesky, Mastodon, and Telegram.\n\nFree Starter plan, no credit card needed. Pro is priced per connected\naccount: from $5.99\/account\/month, or $3.99 billed yearly, with automatic\nvolume discounts from the 6th account. See https:\/\/publora.com\/pricing.\n","version":"1.0.0","contact":{"email":"support@publora.com","url":"https:\/\/publora.com"}},"servers":[{"url":"https:\/\/api.publora.com\/api\/v1","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"Company Context","description":"Agency Accounts, Workspaces, capabilities and publishing channels"},{"name":"Company Publishing","description":"Agency drafts, media, scheduling, recovery and client reviews"},{"name":"Posts","description":"Create, update, delete, and list posts"},{"name":"Connections","description":"Manage platform connections"},{"name":"Media","description":"Upload media files"},{"name":"Platform Analytics","description":"On-demand Mastodon and Bluesky post and profile statistics"},{"name":"LinkedIn Analytics","description":"LinkedIn-specific analytics and interactions"},{"name":"Webhooks","description":"Manage webhook endpoints for real-time notifications"},{"name":"Logs","description":"Post logs and debugging"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-publora-key","description":"API key from Settings > API Keys. Format: sk_timestamp.hexstring"}},"responses":{"CompanyInvalidInput":{"description":"Invalid Company content input (AGENCY_CORE_CONTENT_INPUT_INVALID).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"CompanyAuthenticationFailed":{"description":"Missing, invalid or revoked API key, in the API-key envelope `{error, code?}`. Repeated failures for one key return 429 API_KEY_AUTH_RATE_LIMITED with Retry-After.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyAuthError"}}}},"CompanyBillingRequired":{"description":"Company billing access is required (COMPANY_BILLING_REQUIRED).","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"CompanyAccessDenied":{"description":"AGENCY_CORE_ACCESS_DENIED: the Workspace header is missing or invalid, the Workspace is not accessible, the role lacks the capability or the Account is not an Agency. Refusals of the API key itself (API_ACCESS_REQUIRED, MCP_ACCESS_REQUIRED, USER_INACTIVE) use the API-key envelope.","content":{"application\/json":{"schema":{"anyOf":[{"$ref":"#\/components\/schemas\/CompanyDomainError"},{"$ref":"#\/components\/schemas\/CompanyAuthError"}]}}}},"CompanyResourceNotFound":{"description":"Post or media does not exist in the selected Workspace.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"CompanyConflict":{"description":"Content or media state conflict, or AGENCY_CORE_IDEMPOTENCY_IN_FLIGHT \/ AGENCY_CORE_IDEMPOTENCY_KEY_CONFLICT. Refetch before sending a changed request; for an in-flight request wait Retry-After and resend the identical body and key.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"CompanyMediaMismatch":{"description":"AGENCY_CORE_MEDIA_TYPE_MISMATCH: invalid body or Idempotency-Key, unsupported type, or uploaded bytes that do not match the reservation; AGENCY_CORE_MEDIA_SIZE_EXCEEDED: file size above the limit. Media commands have no 400.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"CompanyUnavailable":{"description":"Company service or dependency unavailable.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"CompanyContextUnavailable":{"description":"AGENCY_CORE_C2_UNAVAILABLE: every context failure, including an unknown or inaccessible Workspace. Re-read `\/company\/contexts\/v2` or retry later.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"CompanyContextInternalError":{"description":"AGENCY_CORE_INTERNAL_ERROR, an unexpected context failure.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"CompanyScheduleInvalid":{"description":"AGENCY_CORE_CONTENT_INPUT_INVALID: invalid body, time, query or Idempotency-Key, or the draft fails a publishing check (channels, ready media, client approval, platform rules). With `includeValidationDetails=true`, `validationErrors` lists the failed checks.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyValidationErrorResponse"}}}},"CompanyApprovalInvalid":{"description":"COMPANY_APPROVAL_INVALID: invalid body, or a missing, malformed or inaccessible post group ID (approval operations return 400 instead of 404). AGENCY_CORE_CONTENT_INPUT_INVALID: missing or invalid Idempotency-Key on a keyed command.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"CompanyApprovalUnavailable":{"description":"COMPANY_APPROVAL_UNAVAILABLE, AGENCY_CORE_CONTENT_UNAVAILABLE or AGENCY_CORE_CONTENT_GRAPH_INVALID. Retry the identical request later.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}}},"headers":{"RetryAfter":{"description":"Seconds to wait before retrying the identical request.","schema":{"type":"integer","minimum":1}}},"parameters":{"CompanyWebhookId":{"name":"webhookId","in":"path","required":true,"description":"Exact subscription ID from this Workspace webhook list.","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"CompanyWorkspaceId":{"name":"X-Publora-Workspace-Id","in":"header","required":true,"description":"Exact accessible Company Workspace ID returned by Company context.","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"CompanyIdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"Stable key. After an uncertain response retry the identical body and key; use a new key for a new intended operation.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[!-+--~]{1,255}$"}},"CompanyPostGroupId":{"name":"postGroupId","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"CompanyMediaFileId":{"name":"mediaFileId","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"CompanyAccountId":{"name":"accountId","in":"path","required":true,"description":"Exact Account ID from `\/company\/contexts\/v2`.","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"CompanyWorkspacePathId":{"name":"workspaceId","in":"path","required":true,"description":"Exact Workspace ID from `\/company\/contexts\/v2`.","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"CompanyIncludeValidationDetails":{"name":"includeValidationDetails","in":"query","required":false,"description":"Send `true` to add `validationErrors` to a failed publishing check. No other query parameter is accepted.","schema":{"type":"string","enum":["true"]}},"XPubloraClient":{"name":"x-publora-client","in":"header","required":false,"description":"Optional client identifier accepted by every API-key-authenticated operation. Any non-empty value is preserved; `api` is used when absent. Setting `mcp` triggers the MCP access entitlement check.","schema":{"type":"string"}}},"schemas":{"CompanyWebhookInput":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Trimmed, nonempty subscription name."},"url":{"type":"string","format":"uri","maxLength":2048,"pattern":"^https?:\/\/","description":"Trimmed public HTTP(S) URL. Private\/local destinations are refused and DNS is checked again at delivery. Redirects are not followed."},"events":{"type":"array","minItems":1,"maxItems":2,"uniqueItems":true,"items":{"type":"string","enum":["post.published","post.failed"]}},"isActive":{"type":"boolean","description":"Defaults to true on create; unchanged when omitted on update. Enabling resets the failure count."}}},"CompanyWebhook":{"type":"object","additionalProperties":false,"required":["id","name","url","events","isActive","failureCount","lastTriggeredAt","createdAt","updatedAt"],"properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$"},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","minItems":1,"maxItems":2,"uniqueItems":true,"items":{"type":"string","enum":["post.published","post.failed"]}},"isActive":{"type":"boolean"},"failureCount":{"type":"integer","minimum":0},"lastTriggeredAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CompanyWebhookListResponse":{"type":"object","additionalProperties":false,"required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","additionalProperties":false,"required":["accountId","workspaceId","items"],"properties":{"accountId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"workspaceId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"items":{"type":"array","maxItems":10,"items":{"$ref":"#\/components\/schemas\/CompanyWebhook"}}}}}},"CompanyWebhookResponse":{"type":"object","additionalProperties":false,"required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","additionalProperties":false,"required":["accountId","workspaceId","webhook"],"properties":{"accountId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"workspaceId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"webhook":{"$ref":"#\/components\/schemas\/CompanyWebhook"}}}}},"CompanyWebhookSecretResponse":{"type":"object","additionalProperties":false,"required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","additionalProperties":false,"required":["accountId","workspaceId","webhook","secret"],"properties":{"accountId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"workspaceId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"webhook":{"$ref":"#\/components\/schemas\/CompanyWebhook"},"secret":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Only returned by create\/rotation and identical retries of that operation. Store securely; normal list\/update responses never expose it."}}}}},"CompanyWebhookDeleteResponse":{"type":"object","additionalProperties":false,"required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","additionalProperties":false,"required":["accountId","workspaceId","webhookId","deleted"],"properties":{"accountId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"workspaceId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"webhookId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"deleted":{"type":"boolean","enum":[true]}}}}},"CompanyPlatformSettings":{"type":"object","additionalProperties":false,"properties":{"threads":{"type":"object","additionalProperties":false,"properties":{"replyControl":{"type":"string","enum":["","everyone","accounts_you_follow","mentioned_only"]}}},"tiktok":{"type":"object","additionalProperties":false,"properties":{"viewerSetting":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"allowComments":{"type":"boolean"},"allowDuet":{"type":"boolean"},"allowStitch":{"type":"boolean"},"autoAddMusic":{"type":"boolean","description":"Optional photo Direct Post setting. True lets TikTok automatically choose music; Publora cannot select or preview a specific track. For photos, false is sent explicitly; omission preserves existing behavior and does not enable music. Reject non-booleans and true on known non-photo media; false disables music and permits switching to video. Videos never send the provider parameter. Incomplete drafts without media are allowed. Changing it invalidates Company client approval."},"commercialContent":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandedContent":{"type":"boolean"},"aiGenerated":{"type":"boolean","default":false,"description":"Self-disclose realistic AI-generated video or images; TikTok shows its AI-generated label (is_aigc). Changing it invalidates Company client approval."}},"description":"viewerSetting is required to schedule; a draft may omit it. Commercial content requires a disclosure category at scheduling. A true category infers commercialContent when omitted; explicit false plus a true category is invalid. Branded content cannot use SELF_ONLY."},"instagram":{"type":"object","additionalProperties":false,"properties":{"videoType":{"type":"string","enum":["REELS","STORIES"]},"coverUrl":{"type":"string","maxLength":2048,"description":"Trimmed public HTTP(S) JPEG URL for a Reel cover; empty string clears it. Extensionless URLs are accepted; known non-JPEG image suffixes are rejected. Instagram fetches it at publish time. Supply your own URL; the Company API has no cover-upload endpoint. Ignored for Stories and feed images."},"shareToFeed":{"type":"boolean","default":true,"description":"Share a Reel to the feed; false publishes only as a Reel. Ignored for Stories and feed images."},"aiGenerated":{"type":"boolean","default":false,"description":"Self-disclose realistic AI-generated or AI-altered video, audio or images; Instagram shows its AI info label (is_ai_generated) on the published container, never on carousel children. Instagram cannot change the label after publishing. Changing it invalidates Company client approval."}},"description":"Stories require exactly one image or video; captions are omitted. coverUrl and shareToFeed apply only to Reel videos."},"youtube":{"type":"object","additionalProperties":false,"properties":{"privacy":{"type":"string","enum":["private","public","unlisted"]},"title":{"type":"string","maxLength":100},"madeForKids":{"type":"boolean"},"aiGenerated":{"type":"boolean","default":false,"description":"Self-disclose realistic AI-generated or AI-altered video or audio; sent as status.containsSyntheticMedia. Changing it invalidates Company client approval."},"tags":{"type":"array","maxItems":500,"items":{"type":"string","minLength":1,"maxLength":500},"description":"Trimmed tags; combined length including comma separators and quotes around tags containing spaces must not exceed 500 characters."},"playlist":{"type":"object","additionalProperties":false,"required":["id","platformId"],"properties":{"id":{"type":"string","maxLength":200},"platformId":{"type":"string","maxLength":300}},"description":"Use the exact sole selected youtube-<channelId> key in platformId. Both strings empty clear the playlist. Choose a new playlist when switching channels."},"thumbnail":{"type":"object","additionalProperties":false,"required":["mediaId"],"properties":{"mediaId":{"type":"string","maxLength":24,"pattern":"^(?:[a-f0-9]{24})?$"}},"description":"Ready youtube_thumbnail media on this exact Company post and Workspace; an empty mediaId clears it. Set it with PATCH after completing the upload; a create request cannot reference one. External URLs and personal media IDs are refused."}}},"linkedin":{"type":"object","additionalProperties":false,"properties":{"repostEnabled":{"type":"boolean"},"repostParentUrn":{"type":"string","maxLength":300},"repostVisibility":{"type":"string","enum":["","PUBLIC","CONNECTIONS"]}},"description":"Canonical share or ugcPost URN; empty commentary allowed and media forbidden. A parent infers repostEnabled; explicit false with a parent, or true without one, is invalid. Pages require PUBLIC visibility."},"telegram":{"type":"object","additionalProperties":false,"properties":{"disableNotification":{"type":"boolean"},"disableWebPagePreview":{"type":"boolean"},"protectContent":{"type":"boolean"}}},"twitter":{"type":"object","additionalProperties":false,"properties":{"aiGenerated":{"type":"boolean","default":false,"description":"Self-disclose AI-generated media; X shows its Made with AI label (made_with_ai). Sent only when the post attaches media, on the head tweet of a thread. Changing it invalidates Company client approval."}},"description":"aiGenerated is the only Company X setting; replyTo and quoteTweet remain personal-API only."}},"description":"Agency platform settings; discover the available formats and settings through GET \/company\/platforms. This complete map replaces saved settings; only selected platforms may carry entries."},"CompanyDraftInput":{"type":"object","additionalProperties":false,"properties":{"content":{"type":"string","maxLength":100000},"notes":{"type":"string","maxLength":10000},"topic":{"type":"string","maxLength":500},"platforms":{"type":"array","maxItems":20,"items":{"type":"string","maxLength":300},"uniqueItems":true,"description":"Exact Company channel keys `<platform>-<platformId>` from `\/company\/connections`; [] permits a channel-less draft."},"platformContents":{"type":"object","additionalProperties":{"type":"object","additionalProperties":false,"required":["content","isBase"],"properties":{"content":{"type":"string","maxLength":100000},"isBase":{"type":"boolean"}}}},"isPlatformSpecific":{"type":"boolean","description":"If supplied, sameContent is also required and must have the opposite value."},"sameContent":{"type":"boolean"},"platformSettings":{"$ref":"#\/components\/schemas\/CompanyPlatformSettings"},"threadingSettings":{"type":"object","additionalProperties":false,"properties":{}},"videoTimestamp":{"type":"number","minimum":0,"maximum":86400},"firstComment":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","maxLength":25000},"platforms":{"type":"array","items":{"type":"string","enum":["twitter","threads","bluesky","tiktok","instagram","mastodon","youtube","linkedin","telegram","facebook"]}}},"nullable":true,"description":"One first comment under supported own posts. null clears; firstComments arrays and delays remain personal-only."},"repostSourceSnapshot":{"type":"object","nullable":true,"additionalProperties":false,"required":["postedId","commentary","capturedAt"],"properties":{"postedId":{"type":"string","pattern":"^urn:li:(share|ugcPost):[0-9]+$"},"commentary":{"type":"string","maxLength":30000},"authorName":{"type":"string","nullable":true},"publishedAt":{"type":"string","format":"date-time","nullable":true},"capturedAt":{"type":"string","format":"date-time"}},"description":"Original LinkedIn post saved as the review preview of a Company Page reshare; it must match the enabled LinkedIn repost target. null clears."}}},"CompanyMediaReservationInput":{"type":"object","additionalProperties":false,"required":["fileName","contentType","sizeBytes"],"properties":{"fileName":{"type":"string","minLength":1,"maxLength":255,"description":"No control characters or surrounding whitespace."},"contentType":{"type":"string","enum":["image\/jpeg","image\/png","image\/gif","image\/webp","image\/tiff","image\/avif","video\/mp4","video\/quicktime","video\/webm","application\/pdf"]},"sizeBytes":{"type":"integer","minimum":1,"description":"Exact byte count of the upload. At most 100 MiB for images and documents and 512 MiB for video."},"type":{"type":"string","enum":["image","video","document"]},"purpose":{"type":"string","enum":["youtube_thumbnail"],"description":"Omit for ordinary media. Auxiliary thumbnails require JPEG\/PNG, type image, at most 2097152 bytes and at least 640x360 actual pixels."}}},"CompanyDomainError":{"type":"object","additionalProperties":false,"required":["success","code","message"],"properties":{"success":{"type":"boolean","enum":[false]},"code":{"type":"string"},"message":{"type":"string"}}},"CompanyObjectId":{"type":"string","pattern":"^[a-f0-9]{24}$"},"CompanyAuthError":{"type":"object","description":"API-key authentication envelope shared with the personal API; it is not the Company domain error envelope. Coded refusals add `code`, for example API_ACCESS_REQUIRED, MCP_ACCESS_REQUIRED, USER_INACTIVE or API_KEY_AUTH_RATE_LIMITED.","properties":{"error":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}}},"CompanyValidationIssue":{"type":"object","required":["code","message","platform","channelKey","field"],"properties":{"code":{"type":"string","description":"Machine-readable reason, for example CONTENT_TOO_LONG, MEDIA_REQUIRED, MEDIA_NOT_READY, PLATFORM_SETTING_REQUIRED, PLATFORMS_REQUIRED or APPROVAL_REQUIRED."},"message":{"type":"string","maxLength":500,"description":"Human-readable text; do not parse it."},"platform":{"type":"string","nullable":true},"channelKey":{"type":"string","nullable":true},"field":{"type":"string","maxLength":100,"nullable":true}}},"CompanyValidationErrorResponse":{"type":"object","additionalProperties":false,"required":["success","code","message"],"properties":{"success":{"type":"boolean","enum":[false]},"code":{"type":"string"},"message":{"type":"string"},"validationErrors":{"type":"array","maxItems":100,"description":"Present only with `includeValidationDetails=true` when a publishing check failed.","items":{"$ref":"#\/components\/schemas\/CompanyValidationIssue"}}}},"CompanyCommandResult":{"type":"string","enum":["applied","replayed"],"description":"`applied` for a new command, `replayed` for an identical retry with the same Idempotency-Key. A replay returns the original result and the same status code."},"CompanyAccountCapabilities":{"type":"object","required":["canCreateWorkspace","canArchiveWorkspace","canInviteMembers","canManageMembers","canInviteAdmins","canManagePeople","canViewAudit"],"properties":{"canCreateWorkspace":{"type":"boolean"},"canArchiveWorkspace":{"type":"boolean"},"canInviteMembers":{"type":"boolean"},"canManageMembers":{"type":"boolean"},"canInviteAdmins":{"type":"boolean"},"canManagePeople":{"type":"boolean"},"canViewAudit":{"type":"boolean"}}},"CompanyWorkspaceCapabilities":{"type":"object","required":["canViewContent","canWriteDrafts","canScheduleOrPublish","canManageConnections","canManageAccess","canRename","canViewAnalytics","canUploadMedia","canViewAudit"],"properties":{"canViewContent":{"type":"boolean","description":"Read drafts, posts, media, reviews and channels."},"canWriteDrafts":{"type":"boolean","description":"Create and edit drafts and recover failed posts."},"canScheduleOrPublish":{"type":"boolean","description":"Schedule, reschedule, unschedule and request or cancel client reviews."},"canManageConnections":{"type":"boolean"},"canManageAccess":{"type":"boolean"},"canRename":{"type":"boolean"},"canViewAnalytics":{"type":"boolean","description":"Reserved; currently always false."},"canUploadMedia":{"type":"boolean","description":"Reserve, complete and delete draft media. Requires canWriteDrafts."},"canViewAudit":{"type":"boolean"}}},"CompanyAccountBilling":{"type":"object","description":"Agency billing state. With `payment_required`, Company mutations except unscheduling return 402 COMPANY_BILLING_REQUIRED.","required":["status","trialStartedAt","trialEndsAt","serverNow","purchasedQuantity","paidPeriodStart","paidPeriodEnd","planKey","subscriptionStatus","cancelAtPeriodEnd"],"properties":{"status":{"type":"string","enum":["granted_unlimited","paid","trial","payment_required"]},"trialStartedAt":{"type":"string","format":"date-time","nullable":true},"trialEndsAt":{"type":"string","format":"date-time","nullable":true},"serverNow":{"type":"string","format":"date-time"},"purchasedQuantity":{"type":"integer","nullable":true},"paidPeriodStart":{"type":"string","format":"date-time","nullable":true},"paidPeriodEnd":{"type":"string","format":"date-time","nullable":true},"planKey":{"type":"string","nullable":true},"subscriptionStatus":{"type":"string","nullable":true},"cancelAtPeriodEnd":{"type":"boolean"}}},"CompanyContextWorkspace":{"type":"object","required":["id","name","logoUrl","status","roleSlug","isDefault","purpose","isSubjectWorkspace","commandVersion","capabilities"],"properties":{"id":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"name":{"type":"string"},"logoUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["active"]},"roleSlug":{"type":"string","enum":["manager","publisher","contributor","viewer"]},"isDefault":{"type":"boolean"},"purpose":{"type":"string","enum":["collaborative","member_publishing"]},"isSubjectWorkspace":{"type":"boolean"},"commandVersion":{"type":"integer","minimum":1},"capabilities":{"$ref":"#\/components\/schemas\/CompanyWorkspaceCapabilities"}}},"CompanyContextAccount":{"type":"object","required":["id","membershipId","name","logoUrl","kind","status","accountRole","presentationMode","runtimeMode","publishingPaused","commandVersion","capabilities","workspaces"],"properties":{"id":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"membershipId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"name":{"type":"string"},"logoUrl":{"type":"string","nullable":true},"kind":{"type":"string","enum":["personal","team","agency"]},"status":{"type":"string","enum":["active"]},"billing":{"$ref":"#\/components\/schemas\/CompanyAccountBilling"},"accountRole":{"type":"string","enum":["owner","admin","member"]},"presentationMode":{"type":"string","enum":["workspaces","people"]},"runtimeMode":{"type":"string","enum":["legacy_personal","agency_core"]},"publishingPaused":{"type":"boolean"},"commandVersion":{"type":"integer","minimum":1},"capabilities":{"$ref":"#\/components\/schemas\/CompanyAccountCapabilities"},"workspaces":{"type":"array","description":"Default Workspace first. Always empty for Corporate accounts.","items":{"$ref":"#\/components\/schemas\/CompanyContextWorkspace"}}},"description":"`billing` is present only for `kind: agency`. Company content endpoints work only in Agency Workspaces; Corporate accounts (`kind: team`, `presentationMode: people`) list no Workspaces."},"CompanyContextResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["schemaVersion","defaultContext","singleContext","accounts"],"properties":{"schemaVersion":{"type":"integer","enum":[2]},"defaultContext":{"type":"object","nullable":true,"description":"Set only when exactly one Account\/Workspace pair exists.","required":["accountId","workspaceId"],"properties":{"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"}}},"singleContext":{"type":"boolean"},"accounts":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyContextAccount"}}}}}},"CompanyConnection":{"type":"object","required":["id","accountId","workspaceId","platform","platformId","username","displayName","profileImageUrl","profileUrl","connectionSubtype","subscriptionType","status","lastSuccessfulPost","lastErrorAt","addedAt"],"properties":{"id":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"platform":{"type":"string","enum":["twitter","threads","bluesky","tiktok","instagram","mastodon","youtube","linkedin","telegram","facebook"]},"platformId":{"type":"string","nullable":true,"description":"The draft channel key is `<platform>-<platformId>`."},"username":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"profileImageUrl":{"type":"string","nullable":true},"profileUrl":{"type":"string","nullable":true},"connectionSubtype":{"type":"string","enum":["personal","company",null],"nullable":true},"subscriptionType":{"type":"string","enum":["None","Basic","Premium","PremiumPlus",null],"nullable":true,"description":"X subscription tier where known."},"status":{"type":"string","enum":["active","reconnect_required"]},"lastSuccessfulPost":{"type":"string","format":"date-time","nullable":true},"lastErrorAt":{"type":"string","format":"date-time","nullable":true},"addedAt":{"type":"string","format":"date-time","nullable":true},"linkedinReconnectRecommended":{"type":"boolean","description":"LinkedIn channels only, with `includeLinkedinReconnectRecommended=1`."},"activationStatus":{"type":"string","enum":["pending"],"description":"Present only while the channel waits for billing activation; it cannot be scheduled yet."},"externalOwners":{"type":"array","description":"Present only for channels attributed to a trusted integration.","items":{"type":"object","properties":{"instanceId":{"type":"string"},"companyId":{"type":"string"},"credentialId":{"type":"string"}}}}}},"CompanyConnectionListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["accountId","workspaceId","items"],"properties":{"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"items":{"type":"array","description":"All publishing channels of the Workspace, oldest first; not paginated.","items":{"$ref":"#\/components\/schemas\/CompanyConnection"}}}}}},"CompanyRepostSourceSnapshot":{"type":"object","additionalProperties":false,"required":["postedId","commentary","capturedAt"],"properties":{"postedId":{"type":"string","pattern":"^urn:li:(share|ugcPost):[0-9]+$"},"commentary":{"type":"string","maxLength":30000},"authorName":{"type":"string","nullable":true},"publishedAt":{"type":"string","format":"date-time","nullable":true},"capturedAt":{"type":"string","format":"date-time"}}},"CompanyApprovalSummary":{"type":"object","required":["status","requestedAt","decidedAt","expiresAt"],"properties":{"status":{"$ref":"#\/components\/schemas\/CompanyApprovalStatus"},"requestedAt":{"type":"string","format":"date-time","nullable":true},"decidedAt":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true}}},"CompanyApprovalStatus":{"type":"string","enum":["none","pending","approved","changes_requested","declined","outdated"]},"CompanyPostGroupStatus":{"type":"string","enum":["draft","scheduled","published","failed","partially_published"]},"CompanyPostGroup":{"type":"object","required":["id","accountId","workspaceId","scheduledTime","platforms","platformContents","isPlatformSpecific","sameContent","topic","content","notes","videoTimestamp","mediaFileIds","postIds","status","processingStatus","platformSettings","threadingSettings","errorMessage","createdAt","updatedAt"],"properties":{"id":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"approval":{"allOf":[{"$ref":"#\/components\/schemas\/CompanyApprovalSummary"}],"description":"Only with `includeApproval=true`. A declined review is left out unless the request sends `Accept: application\/vnd.publora.company-approval.v2+json`."},"scheduledTime":{"type":"string","format":"date-time","nullable":true},"platforms":{"type":"array","description":"Selected channel keys `<platform>-<platformId>`.","items":{"type":"string"}},"platformContents":{"type":"object","additionalProperties":{"type":"object","required":["content","isBase"],"properties":{"content":{"type":"string"},"isBase":{"type":"boolean"}}}},"isPlatformSpecific":{"type":"boolean"},"sameContent":{"type":"boolean"},"topic":{"type":"string"},"content":{"type":"string"},"notes":{"type":"string"},"videoTimestamp":{"type":"number"},"mediaFileIds":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyObjectId"}},"postIds":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyObjectId"}},"status":{"$ref":"#\/components\/schemas\/CompanyPostGroupStatus"},"processingStatus":{"type":"string","enum":["pending","processing","finished",null],"nullable":true},"platformSettings":{"$ref":"#\/components\/schemas\/CompanyPlatformSettings"},"firstComment":{"type":"object","description":"Present only when set.","required":["text"],"properties":{"text":{"type":"string"},"platforms":{"type":"array","items":{"type":"string"}}}},"repostSourceSnapshot":{"allOf":[{"$ref":"#\/components\/schemas\/CompanyRepostSourceSnapshot"}],"description":"Only with `includeRepostSource=true` for a LinkedIn Page reshare."},"threadingSettings":{"type":"object","description":"Always empty."},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CompanyPost":{"type":"object","description":"One channel of a post group, with its publication result.","required":["id","accountId","workspaceId","postGroupId","content","platform","platformId","status","error","postedId","permalink","publishedAt","createdAt","updatedAt"],"properties":{"id":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"postGroupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"content":{"type":"string"},"platform":{"type":"string"},"platformId":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","pending","processing","published","failed"]},"error":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true},"message":{"type":"string","maxLength":200,"nullable":true},"platformStatusCode":{"type":"integer","minimum":100,"maximum":599,"nullable":true},"platformError":{"type":"string","maxLength":200,"nullable":true},"failedAt":{"type":"string","format":"date-time","nullable":true},"retryable":{"type":"boolean","nullable":true},"publishOutcomeUnknown":{"type":"boolean","nullable":true,"description":"True when the platform may have published the post. Check the platform before recovering."}}},"publishDeferral":{"type":"object","description":"Only with `includePublishDeferral=true` while publication is deferred.","required":["reason","deferredAt"],"properties":{"reason":{"type":"string","enum":["global_stop","account_paused","account_suspended","dependency_unavailable","billing_required"]},"deferredAt":{"type":"string","format":"date-time"}}},"postedId":{"type":"string","nullable":true},"permalink":{"type":"string","format":"uri","nullable":true},"firstCommentResult":{"$ref":"#\/components\/schemas\/FirstCommentResult"},"publishedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CompanyPostGroupDetailResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["group","posts"],"properties":{"group":{"$ref":"#\/components\/schemas\/CompanyPostGroup"},"posts":{"type":"array","maxItems":20,"items":{"$ref":"#\/components\/schemas\/CompanyPost"}}}}}},"CompanyDraftResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["result","accountId","workspaceId","groupId","postIds"],"properties":{"result":{"$ref":"#\/components\/schemas\/CompanyCommandResult"},"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"groupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"postIds":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyObjectId"}}}}}},"CompanyScheduleInput":{"type":"object","additionalProperties":false,"required":["scheduledTime"],"properties":{"scheduledTime":{"type":"string","format":"date-time","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$","description":"UTC with exactly three fractional digits, for example 2026-11-20T09:00:00.000Z. A past or current time publishes as soon as possible; keep the same value on retries."}}},"CompanyScheduleResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["result","accountId","workspaceId","groupId","scheduledTime","postCount"],"properties":{"result":{"$ref":"#\/components\/schemas\/CompanyCommandResult"},"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"groupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"scheduledTime":{"type":"string","format":"date-time"},"postCount":{"type":"integer","minimum":1}}}}},"CompanyUnscheduleResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["result","accountId","workspaceId","groupId","status","postCount"],"properties":{"result":{"$ref":"#\/components\/schemas\/CompanyCommandResult"},"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"groupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"status":{"type":"string","enum":["draft"]},"postCount":{"type":"integer","minimum":1}}}}},"CompanyRecoverResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["result","accountId","workspaceId","sourceGroupId","groupId","status","postIds","recoveredPlatforms","excludedPlatforms","mediaCount"],"properties":{"result":{"$ref":"#\/components\/schemas\/CompanyCommandResult"},"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"sourceGroupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"groupId":{"allOf":[{"$ref":"#\/components\/schemas\/CompanyObjectId"}],"description":"The new draft; the failed source post group is not changed."},"status":{"type":"string","enum":["draft"]},"postIds":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyObjectId"}},"recoveredPlatforms":{"type":"array","description":"Channel keys copied into the new draft.","items":{"type":"string"}},"excludedPlatforms":{"type":"array","description":"Channels left out because they published or their outcome is unknown.","items":{"type":"object","required":["key","reason"],"properties":{"key":{"type":"string"},"reason":{"type":"string","enum":["published","unknown_outcome"]}}}},"mediaCount":{"type":"integer","minimum":0}}}}},"CompanyApprovalRequestInput":{"type":"object","additionalProperties":false,"properties":{"managerComment":{"type":"string","maxLength":5000,"description":"Optional note shown to the client."},"scheduledTime":{"type":"string","format":"date-time","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$","nullable":true,"description":"Optional future UTC time with exactly three fractional digits. When set, the client's approval schedules this exact version; do not schedule it again. If the time passes before the decision, the approved post stays a draft."}}},"CompanyApproval":{"type":"object","required":["postGroupId","status","requestedAt","decidedAt","expiresAt","reviewId","managerComment","reviewUrl","expired","decision","notificationStatus"],"properties":{"postGroupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"status":{"$ref":"#\/components\/schemas\/CompanyApprovalStatus"},"requestedAt":{"type":"string","format":"date-time","nullable":true},"decidedAt":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"The review page expires 30 days after the request."},"publication":{"type":"object","description":"Present only when the review was requested with a `scheduledTime`.","required":["scheduledTime","status"],"properties":{"scheduledTime":{"type":"string","format":"date-time"},"status":{"$ref":"#\/components\/schemas\/CompanyPostGroupStatus"}}},"reviewId":{"type":"string","nullable":true},"managerComment":{"type":"string"},"reviewUrl":{"type":"string","format":"uri","nullable":true,"description":"Private review page for the client. Publora does not send it: deliver it yourself, treat it as a bearer credential and keep it out of logs."},"expired":{"type":"boolean"},"decision":{"type":"object","nullable":true,"required":["decision","comment","decidedAt","attachments"],"properties":{"decision":{"type":"string","enum":["approved","changes_requested","declined"]},"comment":{"type":"string"},"decidedAt":{"type":"string","format":"date-time"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"},"url":{"type":"string","format":"uri"}}}}}},"notificationStatus":{"type":"string","enum":["pending","sending","sent","failed",null],"nullable":true,"description":"Delivery of the decision email to the user who requested the review."}}},"CompanyApprovalReadResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"$ref":"#\/components\/schemas\/CompanyApproval"},{"type":"object","required":["canRequestApproval"],"properties":{"canRequestApproval":{"type":"boolean","description":"True for a draft when the caller can request reviews. Otherwise false, and `reviewUrl` is null."}}}]}}},"CompanyApprovalCommandResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"type":"object","required":["result"],"properties":{"result":{"$ref":"#\/components\/schemas\/CompanyCommandResult"}}},{"$ref":"#\/components\/schemas\/CompanyApproval"}]}}},"CompanyApprovalNotificationResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["notificationStatus"],"properties":{"notificationStatus":{"type":"string","enum":["pending","sending","sent","failed",null],"nullable":true,"description":"`sending` means another attempt is in progress; try again after a few minutes."}}}}},"CompanyPlatformVariant":{"type":"object","properties":{"variants":{"type":"array","items":{"type":"string"}},"contentMaxChars":{"type":"integer"},"media":{"type":"object","properties":{"requirement":{"type":"string","enum":["required","optional"]},"maxItems":{"type":"integer"},"kinds":{"type":"array","items":{"type":"string"}},"maxImages":{"type":"integer"},"maxVideos":{"type":"integer"},"maxDocuments":{"type":"integer"},"mixedMedia":{"type":"boolean"}}},"settings":{"type":"object","description":"Allowed `platformSettings` keys for this platform.","additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["boolean","string","array","object"]},"required":{"type":"boolean","description":"Required when the draft is scheduled."},"values":{"type":"array","items":{"type":"string"}},"maxLength":{"type":"integer"},"maxItems":{"type":"integer"},"maxTotalLength":{"type":"integer"},"properties":{"type":"object"}}}}}},"CompanyPlatformsResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["publishablePlatforms","connectOnlyPlatforms","basicVariants"],"properties":{"publishablePlatforms":{"type":"array","items":{"type":"string"}},"connectOnlyPlatforms":{"type":"array","description":"Platforms that can be connected but not published, currently `pinterest`.","items":{"type":"string"}},"basicVariants":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/CompanyPlatformVariant"}},"xPostCharacterLimits":{"type":"object","description":"Only with `includeXPremiumLimits=true`.","properties":{"standard":{"type":"integer"},"bySubscriptionType":{"type":"object","additionalProperties":{"type":"integer"}}}}}}}},"CompanyMediaPreview":{"type":"object","required":["id","url","type","mimeType","status"],"properties":{"id":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"url":{"type":"string","format":"uri","nullable":true,"description":"Set only when `status` is `ready`."},"type":{"type":"string","enum":["image","video","document",null],"nullable":true},"mimeType":{"type":"string","nullable":true},"status":{"type":"string","enum":["uploading","ready","failed","deleting"]},"purpose":{"type":"string","enum":["youtube_thumbnail"]}}},"CompanyMediaListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["accountId","workspaceId","postGroupId","mediaFileIds","items"],"properties":{"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"postGroupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"mediaFileIds":{"type":"array","description":"Draft media in publishing order.","items":{"$ref":"#\/components\/schemas\/CompanyObjectId"}},"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyMediaPreview"}},"youtubeThumbnail":{"allOf":[{"$ref":"#\/components\/schemas\/CompanyMediaPreview"}],"description":"Present only when a YouTube thumbnail is selected."}}}}},"CompanyMediaReservationResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["accountId","workspaceId","mediaFileId","postGroupId","uploadUrl","uploadHeaders","fileUrl","contentType","type","sizeBytes","expiresAt","status"],"properties":{"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"mediaFileId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"postGroupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"uploadUrl":{"type":"string","format":"uri","description":"Presigned PUT URL, valid until `expiresAt`."},"uploadHeaders":{"type":"object","description":"Send every header exactly, plus Content-Length equal to `sizeBytes`.","required":["Content-Type","If-None-Match"],"properties":{"Content-Type":{"type":"string"},"If-None-Match":{"type":"string","enum":["*"]}}},"fileUrl":{"type":"string","format":"uri"},"contentType":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"sizeBytes":{"type":"integer"},"purpose":{"type":"string","enum":["youtube_thumbnail"]},"expiresAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["uploading"]}}}}},"CompanyMediaCompleteResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["accountId","workspaceId","mediaFileId","postGroupId","status","contentType","type","sizeBytes","metadata","bytesProbedAt"],"properties":{"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"mediaFileId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"postGroupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"status":{"type":"string","enum":["ready"]},"contentType":{"type":"string","nullable":true},"type":{"type":"string","enum":["image","video","document",null],"nullable":true},"sizeBytes":{"type":"integer"},"purpose":{"type":"string","enum":["youtube_thumbnail"]},"fileUrl":{"type":"string","format":"uri","description":"Thumbnails only."},"metadata":{"type":"object","required":["width","height","durationSeconds"],"properties":{"width":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"durationSeconds":{"type":"number","nullable":true}}},"bytesProbedAt":{"type":"string","format":"date-time","nullable":true}}}}},"CompanyMediaDeleteResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["accountId","workspaceId","mediaFileId","postGroupId","status","deletionAfter"],"properties":{"accountId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"workspaceId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"mediaFileId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"postGroupId":{"$ref":"#\/components\/schemas\/CompanyObjectId"},"status":{"type":"string","enum":["deleting"]},"deletionAfter":{"type":"string","format":"date-time","description":"Storage cleanup runs after this time."}}}}},"YouTubePlaylistReference":{"type":"object","nullable":true,"additionalProperties":false,"default":{"id":"","platformId":""},"description":"Reference to a YouTube playlist for platformSettings.youtube.playlist. Send empty strings for both fields to clear the playlist.","properties":{"id":{"type":"string","nullable":true,"default":"","description":"YouTube playlist id","example":"PLxxxxxxxx"},"platformId":{"type":"string","nullable":true,"default":"","description":"Compound YouTube platform id from platforms; must match the single selected YouTube channel","example":"youtube-UCxxxxxxxx"}}},"YouTubeThumbnailReference":{"type":"object","nullable":true,"additionalProperties":false,"description":"Reference to a Publora-tracked custom thumbnail for platformSettings.youtube.thumbnail. Send an empty url to clear the thumbnail. Set via update-post only (the upload requires a postGroupId).","properties":{"mediaId":{"type":"string","nullable":true,"description":"Publora media id returned by the YouTube thumbnail upload endpoint","example":"665f..."},"id":{"type":"string","nullable":true,"description":"REST alias for mediaId"},"url":{"type":"string","nullable":true,"description":"Publora-hosted thumbnail URL returned by the upload endpoint","example":"https:\/\/media.publora.com\/..."},"path":{"type":"string","nullable":true,"description":"REST alias for url"}}},"PlatformSettingsInput":{"type":"object","additionalProperties":false,"description":"Per-platform settings for tiktok, instagram, youtube, threads, twitter, telegram, and linkedin. Unknown platform or nested paths are rejected with 400 PLATFORM_SETTING_UNKNOWN. Merged with defaults on create-post and with existing settings on update-post (omitted fields are preserved).","properties":{"instagram":{"type":"object","additionalProperties":false,"properties":{"videoType":{"type":"string","enum":["REELS","STORIES"],"default":"REELS","description":"How videos are published"},"coverUrl":{"type":"string","description":"Custom Reels cover image (alias: cover_url). Publicly accessible http(s) URL to a JPEG \u2014 Instagram fetches it server-side at publish time. Empty string clears the custom cover. Invalid URLs are rejected with 400. Ignored for Stories and image posts.","example":"https:\/\/cdn.example.com\/covers\/reel-cover.jpg"},"cover_url":{"type":"string","description":"REST alias for coverUrl; normalized to coverUrl before storage","example":"https:\/\/cdn.example.com\/covers\/reel-cover.jpg"},"shareToFeed":{"type":"boolean","description":"For Reels, false prevents sharing the Reel to the main feed"},"aiGenerated":{"type":"boolean","default":false,"description":"Self-disclose realistic AI-generated or AI-altered video, audio or images; Instagram shows its AI info label (is_ai_generated) on the published container (single media, Reel, Story or carousel parent, never carousel children). Instagram cannot change the label after publishing, so update-post refuses a change with 409 POST_PUBLISH_IN_PROGRESS once publishing has started. REST also accepts the string encodings true\/false\/1\/0\/yes\/no\/on\/off."}}},"tiktok":{"type":"object","additionalProperties":false,"properties":{"viewerSetting":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"],"default":"PUBLIC_TO_EVERYONE"},"allowComments":{"type":"boolean","default":false},"allowDuet":{"type":"boolean","default":false},"allowStitch":{"type":"boolean","default":false},"autoAddMusic":{"type":"boolean","description":"Optional photo Direct Post setting. True lets TikTok automatically choose music; Publora cannot select or preview a specific track. For photos, false is sent explicitly; omission preserves existing behavior and does not enable music. Reject non-booleans and true on known non-photo media; false disables music and permits switching to video. Videos never send the provider parameter. Incomplete drafts without media are allowed."},"commercialContent":{"type":"boolean","default":false},"brandOrganic":{"type":"boolean","default":false},"brandedContent":{"type":"boolean","default":false},"aiGenerated":{"type":"boolean","default":false,"description":"Self-disclose realistic AI-generated video or images; TikTok shows its AI-generated label. Sent as is_aigc in post_info for video Direct Post (always present) and at the top level of the photo content\/init request (only when true). REST also accepts the string encodings true\/false\/1\/0\/yes\/no\/on\/off."}}},"youtube":{"type":"object","additionalProperties":false,"properties":{"privacy":{"type":"string","enum":["private","public","unlisted"],"default":"public"},"title":{"type":"string","default":""},"madeForKids":{"type":"boolean","default":false},"aiGenerated":{"type":"boolean","default":false,"description":"Self-disclose realistic AI-generated or AI-altered video or audio; sent as status.containsSyntheticMedia only when true. Not needed for scripts, titles, thumbnails, beauty filters or clearly unrealistic content. REST also accepts the string encodings true\/false\/1\/0\/yes\/no\/on\/off."},"tags":{"description":"Video tags. REST accepts an array or a comma-separated string and caps the normalized combined tag budget at 500 characters.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"categoryId":{"type":"string","description":"Optional YouTube snippet.categoryId"},"playlist":{"$ref":"#\/components\/schemas\/YouTubePlaylistReference"},"thumbnail":{"$ref":"#\/components\/schemas\/YouTubeThumbnailReference"}}},"threads":{"type":"object","additionalProperties":false,"properties":{"replyControl":{"type":"string","enum":["everyone","accounts_you_follow","mentioned_only",""],"default":""}}},"twitter":{"type":"object","additionalProperties":false,"description":"X reply and quote targets, plus the made_with_ai disclosure. On self-serve X API tiers, the target author must have mentioned the connected account in that post, quoted one of its posts, or the connected account must have authored the target. Publora cannot prevalidate this relationship; X can reject publication later with X_REPLY_NOT_AUTHORIZED.","properties":{"replyTo":{"type":"string","default":"","description":"Full x.com\/twitter.com status URL or bare 1-19 digit post ID. Publishes the post (or thread head) as a reply. Empty string clears.","example":"https:\/\/x.com\/customer\/status\/1234567890123456789"},"quoteTweet":{"type":"string","default":"","description":"Full x.com\/twitter.com status URL or bare 1-19 digit post ID. Quotes from the post or thread head; may be combined with replyTo and media. Empty string clears.","example":"987654321098765432"},"aiGenerated":{"type":"boolean","default":false,"description":"Self-disclose AI-generated media; X shows its Made with AI label (made_with_ai). Sent only when the post attaches media, on the single post or the head tweet of a thread; a text-only post is published without it. REST also accepts the string encodings true\/false\/1\/0\/yes\/no\/on\/off."}}},"telegram":{"type":"object","additionalProperties":false,"properties":{"disableNotification":{"type":"boolean","default":false},"disableWebPagePreview":{"type":"boolean","default":false},"protectContent":{"type":"boolean","default":false}}},"linkedin":{"type":"object","additionalProperties":false,"description":"LinkedIn repost (reshare) settings. When a repost is enabled, the group's content becomes the reshare commentary (3,000-char limit) and media is forbidden \u2014 scheduling a repost group with media fails validation with code MEDIA_TYPE_NOT_SUPPORTED.","properties":{"repostEnabled":{"type":"boolean","default":false},"repostParentUrn":{"type":"string","default":"","description":"Canonical urn:li:share:* or urn:li:ugcPost:* parent. Required when repostEnabled is true; an empty value means a normal post."},"repostVisibility":{"type":"string","enum":["PUBLIC","CONNECTIONS",""],"default":"","description":"Repost visibility. CONNECTIONS is personal-profile-only; company-page reposts must use PUBLIC."}}}}},"PlatformConnection":{"type":"object","properties":{"platformId":{"type":"string","description":"Unique ID in format platform-id (e.g., twitter-123456789)","example":"twitter-123456789"},"username":{"type":"string","nullable":true,"description":"Platform username or handle. Null for a Telegram channel without a public username (a private channel); displayName then holds the channel title.","example":"@yourhandle"},"displayName":{"type":"string","nullable":true,"description":"Display name on the platform. Null when the platform did not provide one.","example":"Your Name"},"profileImageUrl":{"type":"string","format":"uri","nullable":true,"description":"Profile image URL. Null when not available.","example":"https:\/\/pbs.twimg.com\/profile_images\/..."},"profileUrl":{"type":"string","format":"uri","nullable":true,"description":"URL to the user's profile on the platform. Can be null if not available for the platform.","example":"https:\/\/twitter.com\/yourhandle"},"accessTokenExpiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Effective credential expiry, derived the same way as tokenStatus. Null when no authoritative date exists: always for YouTube, and for platforms that do not expire on a schedule (Facebook, X\/Twitter, Mastodon, Bluesky). Do not compare this against the current time to decide about reconnecting - read connectionStatus instead.","example":"2026-05-15T10:30:00.000Z"},"tokenStatus":{"type":"string","enum":["valid","expiring_soon","expired","unknown"],"description":"Credential expiry health; use it to warn ahead of expiry (expiring_soon). 'expired' also covers connections the platform revoked, where accessTokenExpiresAt may still be null or in the future. Telegram connections store no expiry date and always report unknown. To decide whether a reconnect is needed, read connectionStatus.","example":"valid"},"connectionStatus":{"type":"string","enum":["active","reconnect_required"],"description":"Whether Publora can publish with this connection now: not flagged for reconnection (set when Facebook, Instagram, Threads, LinkedIn or TikTok rejects the stored credential, or when X or YouTube reports the account suspended; other platforms record a rejected credential only in lastError), credentials stored, and an access token that has not expired or can be renewed while publishing. Read this to decide whether to prompt a reconnect. Computed from stored data without calling the platform; use test-connection for a live check.","example":"active"},"tokenExpiresIn":{"type":"string","nullable":true,"description":"Human-readable time until token expiration","example":"29 days"},"lastSuccessfulPost":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp of last successful post"},"lastError":{"$ref":"#\/components\/schemas\/ConnectionLastError"},"subscriptionType":{"type":"string","nullable":true,"description":"X only: the last tier Publora read from X - None, Basic, Premium or PremiumPlus. Fetched at connect time and re-checked when publishing to X at most once every 24 hours. Premium and PremiumPlus raise the X length limit from 280 to 25,000 characters. Null on other platforms, and on X until a fetch succeeds.","example":"Premium"}}},"ConnectionLastError":{"type":"object","nullable":true,"description":"Last connection error, or null","properties":{"message":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"}}},"LinkedInUrnTranslation":{"type":"object","description":"Present only when LinkedIn translated an activity URN before processing the reaction","required":["from","to"],"properties":{"from":{"type":"string"},"to":{"type":"string"}}},"Webhook":{"type":"object","properties":{"_id":{"type":"string","example":"507f1f77bcf86cd799439011"},"name":{"type":"string","example":"My Webhook"},"url":{"type":"string","format":"uri","example":"https:\/\/example.com\/webhook"},"events":{"type":"array","items":{"type":"string","enum":["post.scheduled","post.published","post.failed","post.demoted","token.expiring"],"description":"token.expiring is defined and subscribable but is not currently dispatched; do not depend on it"},"example":["post.published","post.failed"]},"isActive":{"type":"boolean","example":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"PostLog":{"type":"object","properties":{"_id":{"type":"string"},"postGroupId":{"type":"string"},"platform":{"type":"string"},"postId":{"type":"string"},"event":{"type":"string","enum":["scheduled","processing","publish_attempted","publish_succeeded","publish_failed","publish_retry","status_changed","media_finalize_succeeded","media_finalize_failed","linkedin_document_upload_succeeded","linkedin_document_upload_failed"],"description":"Stable PostLog event type"},"error":{"type":"string","description":"Optional; omitted when no error was stored"},"httpStatus":{"type":"integer","nullable":true,"description":"Optional; may be null or omitted when not applicable"},"retryCount":{"type":"integer","description":"Optional; omitted when no value was stored"},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Post":{"type":"object","properties":{"platform":{"type":"string","enum":["twitter","linkedin","instagram","threads","tiktok","youtube","facebook","bluesky","mastodon","telegram","pinterest"],"example":"twitter"},"platformId":{"type":"string","nullable":true,"description":"Platform connection ID. Always present; null if the post has no connection resolved.","example":"123456789"},"content":{"type":"string","example":"Hello from Publora API!"},"status":{"type":"string","enum":["draft","scheduled","pending","processing","published","failed"],"example":"published"},"postedId":{"type":"string","nullable":true,"description":"Platform-specific post ID. Always present; null until the post is published.","example":"1234567890123456789"},"permalink":{"type":"string","nullable":true,"description":"Public URL of the published post. Always present; null until the post\nis published, and null for platforms that expose no permalink.\n","example":"https:\/\/x.com\/publora\/status\/1234567890123456789"},"isThread":{"type":"boolean","description":"True when this target was published as a multi-part chain (X\/Twitter\nor Meta Threads). Always present.\n","example":false},"threadParts":{"type":"array","description":"Per-part publication progress for a chain. Always present; empty when\nthe target is not a chain. Returned by get-post only \u2014 list-posts\nomits it. Parts already marked published are live on the platform, and a\npartially published chain is terminal and not retried, so inspect this\narray instead of resubmitting the post after a partial failure.\n","items":{"$ref":"#\/components\/schemas\/ThreadPart"}},"firstCommentResult":{"nullable":true,"description":"Legacy alias for firstCommentResults[0], or null when none applies.\n","allOf":[{"$ref":"#\/components\/schemas\/FirstCommentResult"}]},"firstCommentResults":{"type":"array","description":"Ordered results for this target, corresponding to group firstComments.","items":{"$ref":"#\/components\/schemas\/FirstCommentResult"}}}},"ThreadPart":{"type":"object","description":"One message of a multi-part chain.","properties":{"index":{"type":"integer","description":"Zero-based position of the part in the chain.","example":0},"content":{"type":"string","description":"The text of that part, exactly as published.","example":"First message."},"status":{"type":"string","enum":["pending","published","failed"],"example":"published"},"publishedId":{"type":"string","nullable":true,"description":"The platform's own ID for that part; null until confirmed. The\ntarget's postedId equals threadParts[0].publishedId.\n","example":"17900000000000001"}}},"FirstCommentInput":{"type":"object","description":"One text comment Publora posts under the account's own post. Supported platforms:\nLinkedIn (profiles and company Pages), X, Threads, Bluesky, Mastodon; other targets\nare skipped and reported in warnings[]. Length is validated per\napplicable platform with that platform's own counting. Best effort:\nattempted at most once, never retried; a failed comment never changes\nthe published post.\n","required":["text"],"additionalProperties":false,"properties":{"text":{"type":"string","maxLength":25000,"description":"The comment. Stored verbatim, measured and posted trimmed;\nwhitespace-only text clears the comment.\n","example":"Full write-up with the numbers: https:\/\/example.com\/launch-week"},"platforms":{"type":"array","description":"Platform TYPES that get the comment (never connection IDs). Omit\nor send [] for every supported target. Types the post is not\npublished to only produce a FIRST_COMMENT_PLATFORM_NOT_TARGETED\nwarning.\n","items":{"type":"string","enum":["linkedin","twitter","threads","bluesky","mastodon","instagram","facebook","youtube","tiktok","telegram"]},"example":["linkedin"]}}},"FirstCommentsInput":{"type":"array","maxItems":3,"description":"Up to three ordered first comments. Send this or legacy firstComment,\nnever both. Null or [] clears them. Later comments run only after the\npreceding comment is posted; failure stops the sequence.\n","items":{"$ref":"#\/components\/schemas\/FirstCommentSequenceItem"}},"FirstCommentSequenceItem":{"type":"object","required":["text"],"additionalProperties":false,"properties":{"text":{"type":"string","maxLength":25000,"description":"Comment text; per-platform limits are also validated."},"platforms":{"type":"array","description":"Platform types, never connection IDs; omit for all supported targets.","items":{"type":"string","enum":["linkedin","twitter","threads","bluesky","mastodon","instagram","facebook","youtube","tiktok","telegram"]}},"delaySeconds":{"type":"integer","minimum":0,"maximum":86400,"description":"Delay after publication for item 0, or after the previous comment\nposts for later items. Omitted means zero; actual delivery is\nwithin one scheduler tick of the due time.\n"}}},"FirstCommentResult":{"type":"object","description":"Outcome of one ordered first comment on a platform target.","properties":{"status":{"type":"string","enum":["pending","posted","failed","skipped"],"description":"pending = waiting for due time or attempt; posted; failed; skipped.\n","example":"posted"},"dueAt":{"type":"string","format":"date-time","nullable":true,"description":"Earliest scheduler time for the attempt."},"commentId":{"type":"string","nullable":true,"description":"The platform's ID of the comment: LinkedIn comment URN, X tweet ID,\nThreads media ID, Bluesky at:\/\/ URI, Mastodon status ID.\n","example":"urn:li:comment:(urn:li:activity:7654321,1234)"},"skipReason":{"type":"string","nullable":true,"description":"Why nothing was attempted. Older records may retain workspace_post or unsupported_account_type."},"attemptedAt":{"type":"string","format":"date-time","nullable":true},"postedAt":{"type":"string","format":"date-time","nullable":true},"error":{"type":"object","nullable":true,"description":"Present for status = failed.","properties":{"code":{"type":"string","example":"FIRST_COMMENT_PERMISSION_REQUIRED"},"message":{"type":"string","nullable":true},"platformStatusCode":{"type":"integer","nullable":true},"outcomeUnknown":{"type":"boolean","description":"True when the comment request was sent but no definitive answer\ncame back: the comment may exist on the platform. Check there\nbefore commenting manually.\n"}}}}},"Warning":{"type":"object","description":"A non-fatal notice about a request that still succeeded. The `warnings`\narray is only present when at least one warning applies \u2014 the key is\nomitted, not empty, otherwise.\n\nTreat `code` as the contract: `message` is human-readable and may change\nat any time. Which fields accompany `code` depends on the code itself.\n","properties":{"code":{"type":"string","enum":["SCHEDULED_TIME_COERCED","FIRST_COMMENT_PLATFORM_NOT_TARGETED","FIRST_COMMENT_UNSUPPORTED_PLATFORMS"],"description":"- `SCHEDULED_TIME_COERCED` \u2014 the requested `scheduledTime` was in the\n  past and was clamped to server time. Carries `requested` and\n  `effective`.\n- `FIRST_COMMENT_PLATFORM_NOT_TARGETED` \u2014 `firstComment.platforms`\n  lists platform types the post is not published to; they are\n  ignored. Carries `platforms`.\n- `FIRST_COMMENT_UNSUPPORTED_PLATFORMS` \u2014 some targets are on\n  platforms without first-comment support; the comment is skipped\n  there. Carries `platforms`.\n\nPending media validation is not a warning: \/update-post refuses to\nschedule with a 503 `MediaPendingError` instead.\n","example":"SCHEDULED_TIME_COERCED"},"message":{"type":"string","description":"Human-readable explanation. Do not match on this string \u2014 match on code.","example":"Requested scheduled time 2026-03-01T14:00:00.000Z was in the past and was changed to server time 2026-03-01T14:02:11.412Z."},"requested":{"type":"string","format":"date-time","description":"SCHEDULED_TIME_COERCED only. The scheduledTime you sent.","example":"2026-03-01T14:00:00.000Z"},"effective":{"type":"string","format":"date-time","description":"SCHEDULED_TIME_COERCED only. The scheduledTime actually stored.","example":"2026-03-01T14:02:11.412Z"},"platforms":{"type":"array","description":"FIRST_COMMENT_* codes only. The platform types the warning is about.","items":{"type":"string"},"example":["instagram"]}}},"PlatformPostMetrics":{"type":"object","description":"Engagement counters for one post. Every key is always present; a metric the\nplatform does not expose is `null`, never `0`. Neither Mastodon nor Bluesky\nreports impressions, reach or clicks, and Mastodon has no saves.\n","properties":{"reactions":{"type":"integer","nullable":true,"description":"Mastodon favourites, Bluesky likes","example":42},"comments":{"type":"integer","nullable":true,"description":"Replies","example":3},"reposts":{"type":"integer","nullable":true,"description":"Mastodon boosts, Bluesky reposts","example":7},"quotes":{"type":"integer","nullable":true,"description":"Quote posts. Mastodon reports this on 4.5+ only, otherwise null.","example":1},"saves":{"type":"integer","nullable":true,"description":"Bluesky bookmarks. Always null on Mastodon.","example":2},"impressions":{"type":"integer","nullable":true,"description":"Always null on both platforms"},"reach":{"type":"integer","nullable":true,"description":"Always null on both platforms"},"clicks":{"type":"integer","nullable":true,"description":"Always null on both platforms"}}},"PlatformProfileMetrics":{"type":"object","description":"Follower counters for one connected account.","properties":{"followers":{"type":"integer","nullable":true,"example":1234},"following":{"type":"integer","nullable":true,"example":321},"posts":{"type":"integer","nullable":true,"example":987}}},"PlatformAnalyticsIssue":{"type":"string","description":"Why one connection could not be answered. Reported per connection rather\nthan failing the request.\n","enum":["CONNECTION_NOT_FOUND","AUTH_REVOKED","FORBIDDEN","RATE_LIMITED","FETCH_FAILED"]},"AccountQuota":{"type":"object","properties":{"metric":{"type":"string","example":"posts.platform_monthly"},"scope":{"type":"string","enum":["account","connection"],"description":"`account`: one shared limit. `connection`: a separate limit for each connection."},"usageScope":{"type":"string","example":"legacy_workspace"},"unit":{"type":"string","enum":["platform_post","day","channel"]},"limit":{"type":"integer","nullable":true,"description":"null means unlimited"},"used":{"type":"integer"},"remaining":{"type":"integer","nullable":true,"description":"null when unlimited, or when scope is connection (read connections[])"},"resetAt":{"type":"string","format":"date-time","nullable":true}}},"AccountContext":{"type":"object","properties":{"plane":{"type":"string","enum":["personal"]},"actorUserId":{"type":"string"},"snapshotAt":{"type":"string","format":"date-time"},"serverTime":{"type":"string","format":"date-time"},"effectiveQuotaTime":{"type":"string","format":"date-time","description":"The date used to select the monthly quota period"},"plan":{"type":"object","properties":{"key":{"type":"string","example":"starter"},"name":{"type":"string","example":"Starter"},"source":{"type":"string"}}},"features":{"type":"object","properties":{"publishing":{"type":"boolean"},"apiAccess":{"type":"boolean"},"mcpAccess":{"type":"boolean"},"analytics":{"type":"boolean","description":"Needed by the Mastodon and Bluesky statistics endpoints"},"mentionables":{"type":"boolean","description":"Needed by the LinkedIn mentionables endpoint"}}},"quotas":{"type":"object","properties":{"monthlyPosts":{"allOf":[{"$ref":"#\/components\/schemas\/AccountQuota"},{"type":"object","properties":{"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"periodTimeZone":{"type":"string","example":"UTC"},"connections":{"type":"array","description":"Per-connection usage when scope is connection; otherwise empty","items":{"type":"object","properties":{"platformSelection":{"type":"string","example":"linkedin-ABC123"},"used":{"type":"integer"},"limit":{"type":"integer","nullable":true},"remaining":{"type":"integer","nullable":true}}}}}}]},"scheduledPosts":{"$ref":"#\/components\/schemas\/AccountQuota"},"scheduleHorizon":{"type":"object","properties":{"metric":{"type":"string","example":"posts.schedule_horizon_days"},"unit":{"type":"string","example":"day"},"limit":{"type":"integer","nullable":true},"maxScheduledDate":{"type":"string","format":"date-time","nullable":true,"description":"Latest time a post can be scheduled; null when there is no horizon"},"resetAt":{"type":"string","nullable":true}}},"connections":{"$ref":"#\/components\/schemas\/AccountQuota"}}},"allowedPlatforms":{"type":"array","nullable":true,"description":"Platform types the plan allows; null means all platforms","items":{"type":"string"}},"advisory":{"type":"boolean","description":"Always true; the snapshot reserves nothing"}}},"Error":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable message. Do not match on this string \u2014 match on code where present.","example":"Invalid API key"},"code":{"type":"string","description":"Stable machine-readable error code. Present on the newer error paths\n(scheduling, platformSettings validation, idempotency); older errors\nreturn `error` only. Always prefer this over the `error` text.\n","example":"SCHEDULED_TIME_IN_PAST"},"field":{"type":"string","description":"`PLATFORM_SETTING_UNKNOWN` only. The exact dotted path of the rejected\nkey, relative to the `platformSettings` object (no `platformSettings.`\nprefix).\n","example":"youtube.thumbnail.typo"},"serverTime":{"type":"string","format":"date-time","description":"`SCHEDULED_TIME_IN_PAST` only. Current server time (UTC) when the\nrequest was rejected \u2014 compare against your clock to diagnose skew.\n","example":"2026-03-01T14:02:11.412Z"}}},"MediaUrlRateLimitError":{"type":"object","required":["error","code","retryAfterSec"],"properties":{"error":{"type":"string","example":"Media URL ingestion rate limit reached (60 URLs\/hour). Retry later or use the presigned get-upload-url flow."},"code":{"type":"string","enum":["MEDIA_URL_RATE_LIMITED"]},"retryAfterSec":{"type":"integer","description":"Seconds until this fixed-window limit may be retried","example":60}}},"MediaPendingError":{"type":"object","description":"\/update-post refused to schedule because attached media is still\npending. The post was not scheduled or changed; validation progress on\nthe media is kept for the retry. Sent with a `Retry-After` header.\n","required":["error","code","retryable"],"properties":{"code":{"type":"string","enum":["MEDIA_UPLOAD_PENDING","MEDIA_VALIDATION_PENDING"],"description":"- `MEDIA_UPLOAD_PENDING` \u2014 the upload has no object in storage yet\n  (the `PUT` has not finished or never happened).\n- `MEDIA_VALIDATION_PENDING` \u2014 validation did not finish within the\n  wait; retry with the same media.\n"},"error":{"type":"string","example":"Media upload is still pending. The post was not scheduled; finish the upload and retry scheduling."},"mediaFileId":{"type":"string","nullable":true,"description":"The first attached media file that is not ready.","example":"507f1f77bcf86cd799439012"},"mediaStatus":{"type":"string","nullable":true,"example":"uploading"},"pendingCode":{"type":"string","description":"The last transient validation result.","example":"MEDIA_UPLOAD_PENDING"},"attempts":{"type":"integer","description":"Validation passes made during the wait.","example":18},"retryable":{"type":"boolean","enum":[true]},"retryAfterSec":{"type":"integer","description":"Seconds to wait before retrying; same as the `Retry-After` header.","example":5},"suggestions":{"type":"array","description":"One recovery hint, worded for MCP tools when `x-publora-client` is `mcp`.","items":{"type":"string"}}}},"ThreadsPermissionsUnavailableError":{"type":"object","description":"Scheduling a Threads chain needed a permission check that Publora could\nnot complete. Not an account problem; retry shortly and never ask the\nuser to reconnect. No `retryable` field and no `Retry-After` header.\n","required":["error","code"],"properties":{"code":{"type":"string","enum":["THREADS_PERMISSIONS_UNAVAILABLE"]},"error":{"type":"string","example":"Unable to check Threads permissions. Please try scheduling again shortly."}}}}},"paths":{"\/company\/webhooks":{"get":{"tags":["Company Publishing","Webhooks"],"operationId":"listCompanyWebhooks","summary":"List this Workspace\u2019s webhook subscriptions","description":"Agency Workspace settings managers only. Personal webhook endpoints do not access Company subscriptions.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"}],"responses":{"200":{"description":"Secret-free subscriptions for the exact selected Workspace.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyWebhookListResponse"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"503":{"description":"COMPANY_WEBHOOK_UNAVAILABLE: dependency or transaction unavailable. Retry the identical operation\/key later.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}}}},"post":{"tags":["Company Publishing","Webhooks"],"operationId":"createCompanyWebhook","summary":"Create a Workspace post-event subscription","description":"Agency Workspace settings managers only. Personal webhook endpoints do not access Company subscriptions.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/CompanyWebhookInput"}],"required":["name","url","events"]}}}},"responses":{"201":{"description":"Successful Workspace-scoped response. Mutation and idempotent response snapshot commit together; identical retries return the original result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyWebhookSecretResponse"}}}},"400":{"description":"COMPANY_WEBHOOK_INPUT_INVALID: invalid fields, URL, events, webhook ID or idempotency key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"409":{"description":"COMPANY_WEBHOOK_LIMIT (maximum 10 including disabled), COMPANY_WEBHOOK_CONFLICT, COMPANY_WEBHOOK_IDEMPOTENCY_CONFLICT or COMPANY_WEBHOOK_IDEMPOTENCY_IN_FLIGHT. In-flight responses include Retry-After; keep the original body and key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"description":"COMPANY_WEBHOOK_UNAVAILABLE: dependency or transaction unavailable. Retry the identical operation\/key later.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}}}}},"\/company\/webhooks\/{webhookId}":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyWebhookId"}],"patch":{"tags":["Company Publishing","Webhooks"],"operationId":"updateCompanyWebhook","summary":"Edit, enable or disable a Workspace subscription","description":"Agency Workspace settings managers only. Personal webhook endpoints do not access Company subscriptions.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/CompanyWebhookInput"}],"minProperties":1}}}},"responses":{"200":{"description":"Successful Workspace-scoped response. Mutation and idempotent response snapshot commit together; identical retries return the original result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyWebhookResponse"}}}},"400":{"description":"COMPANY_WEBHOOK_INPUT_INVALID: invalid fields, URL, events, webhook ID or idempotency key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"description":"COMPANY_WEBHOOK_NOT_FOUND: no such subscription in the selected Workspace.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"409":{"description":"COMPANY_WEBHOOK_CONFLICT, COMPANY_WEBHOOK_IDEMPOTENCY_CONFLICT or COMPANY_WEBHOOK_IDEMPOTENCY_IN_FLIGHT. In-flight responses include Retry-After; keep the original body and key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"description":"COMPANY_WEBHOOK_UNAVAILABLE: dependency or transaction unavailable. Retry the identical operation\/key later.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}}}},"delete":{"tags":["Company Publishing","Webhooks"],"operationId":"deleteCompanyWebhook","summary":"Delete a Workspace subscription","description":"Agency Workspace settings managers only. Personal webhook endpoints do not access Company subscriptions.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Successful Workspace-scoped response. Mutation and idempotent response snapshot commit together; identical retries return the original result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyWebhookDeleteResponse"}}}},"400":{"description":"COMPANY_WEBHOOK_INPUT_INVALID: invalid fields, URL, events, webhook ID or idempotency key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"description":"COMPANY_WEBHOOK_NOT_FOUND: no such subscription in the selected Workspace.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"409":{"description":"COMPANY_WEBHOOK_CONFLICT, COMPANY_WEBHOOK_IDEMPOTENCY_CONFLICT or COMPANY_WEBHOOK_IDEMPOTENCY_IN_FLIGHT. In-flight responses include Retry-After; keep the original body and key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"description":"COMPANY_WEBHOOK_UNAVAILABLE: dependency or transaction unavailable. Retry the identical operation\/key later.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}}}}},"\/company\/webhooks\/{webhookId}\/regenerate-secret":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyWebhookId"}],"post":{"tags":["Company Publishing","Webhooks"],"operationId":"regenerateCompanyWebhookSecret","summary":"Rotate the Workspace subscription signing secret","description":"Agency Workspace settings managers only. Personal webhook endpoints do not access Company subscriptions.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Successful Workspace-scoped response. Mutation and idempotent response snapshot commit together; identical retries return the original result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyWebhookSecretResponse"}}}},"400":{"description":"COMPANY_WEBHOOK_INPUT_INVALID: invalid fields, URL, events, webhook ID or idempotency key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"description":"COMPANY_WEBHOOK_NOT_FOUND: no such subscription in the selected Workspace.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"409":{"description":"COMPANY_WEBHOOK_CONFLICT, COMPANY_WEBHOOK_IDEMPOTENCY_CONFLICT or COMPANY_WEBHOOK_IDEMPOTENCY_IN_FLIGHT. In-flight responses include Retry-After; keep the original body and key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"description":"COMPANY_WEBHOOK_UNAVAILABLE: dependency or transaction unavailable. Retry the identical operation\/key later.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}}}}},"\/company\/contexts\/v2":{"get":{"tags":["Company Context"],"operationId":"getCompanyContexts","summary":"List the Accounts and Workspaces of the API key owner","description":"Start Agency work here. Pass an exact `accounts[].workspaces[].id` as `X-Publora-Workspace-Id` and check that Workspace's `capabilities` before acting. `defaultContext` is set only when exactly one Account\/Workspace pair exists. Corporate accounts (`kind: team`, `presentationMode: people`) list no Workspaces; their members publish their own posts with the personal API.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"responses":{"200":{"description":"Accounts with Workspaces and capabilities; `accounts` is empty without Company memberships.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyContextResponse"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"500":{"$ref":"#\/components\/responses\/CompanyContextInternalError"},"503":{"$ref":"#\/components\/responses\/CompanyContextUnavailable"}}}},"\/company\/accounts\/{accountId}\/workspaces\/{workspaceId}\/context":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyAccountId"},{"$ref":"#\/components\/parameters\/CompanyWorkspacePathId"}],"get":{"tags":["Company Context"],"operationId":"getCompanyWorkspaceContext","summary":"Read the context of one Agency Workspace","description":"Same shape as `\/company\/contexts\/v2`, limited to this Account and Workspace, for example to refresh capabilities before a command. An unknown or inaccessible Workspace returns 503 AGENCY_CORE_C2_UNAVAILABLE, not 403 or 404.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"responses":{"200":{"description":"One Account with one Workspace; `defaultContext` is that pair.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyContextResponse"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"500":{"$ref":"#\/components\/responses\/CompanyContextInternalError"},"503":{"$ref":"#\/components\/responses\/CompanyContextUnavailable"}}}},"\/company\/connections":{"get":{"tags":["Company Context"],"operationId":"listCompanyConnections","summary":"List the publishing channels of a Workspace","description":"Requires `canViewContent`. Draft channel keys are `<platform>-<platformId>`. A channel with `status: reconnect_required` must be reconnected before scheduling. Pinterest is connect-only and is not listed.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"name":"includeLinkedinReconnectRecommended","in":"query","required":false,"description":"Send `1` to add `linkedinReconnectRecommended` to LinkedIn channels.","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"Every publishing channel of the selected Workspace.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyConnectionListResponse"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"503":{"description":"AGENCY_CORE_CONNECTION_UNAVAILABLE. Retry later.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}}}}},"\/company\/platforms":{"get":{"tags":["Company Publishing"],"operationId":"getCompanyPublishingFormats","summary":"Discover available Company publishing formats","description":"Publishable and connect-only platforms with the content, media and `platformSettings` limits of Agency drafts. No Workspace header is needed.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"name":"includeXPremiumLimits","in":"query","required":false,"description":"Send `true` to add `xPostCharacterLimits` for X Premium channels.","schema":{"type":"string","enum":["true"]}}],"responses":{"200":{"description":"Platform formats and settings.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyPlatformsResponse"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"}}}},"\/company\/post-groups":{"post":{"tags":["Company Publishing"],"operationId":"createCompanyDraft","summary":"Create an Agency draft","description":"Requires `canWriteDrafts`. Every field is optional; `{}` creates an empty draft. `platforms` takes channel keys from `\/company\/connections`. Discover formats and settings with `\/company\/platforms`. This operation never schedules; use the schedule command.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDraftInput"}}}},"responses":{"201":{"description":"Draft created. An identical retry returns the original result with `result` set to `replayed`.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDraftResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyInvalidInput"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"$ref":"#\/components\/responses\/CompanyBillingRequired"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"409":{"$ref":"#\/components\/responses\/CompanyConflict"},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}}},"\/company\/post-groups\/{postGroupId}":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"}],"get":{"tags":["Company Publishing"],"operationId":"getCompanyPostGroup","summary":"Read an Agency post group and its channel posts","description":"Requires `canViewContent`. `group.status` and `posts[].status` report the publication result: failed posts carry `error`, published posts `postedId` and `permalink`. Send `Accept: application\/vnd.publora.company-approval.v2+json, application\/json` to also receive declined reviews with `includeApproval=true`; the response then uses that media type.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"name":"includeApproval","in":"query","required":false,"description":"`true` adds `group.approval`.","schema":{"type":"string","enum":["true","false"]}},{"name":"includePublishDeferral","in":"query","required":false,"description":"`true` adds `posts[].publishDeferral` while publication is deferred.","schema":{"type":"string","enum":["true","false"]}},{"name":"includeRepostSource","in":"query","required":false,"description":"`true` adds `group.repostSourceSnapshot` for a LinkedIn Page reshare.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Post group and up to 20 channel posts.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyPostGroupDetailResponse"}},"application\/vnd.publora.company-approval.v2+json":{"schema":{"$ref":"#\/components\/schemas\/CompanyPostGroupDetailResponse"}}}},"400":{"description":"AGENCY_CORE_CONTENT_INPUT_INVALID, an unknown query parameter or value.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"$ref":"#\/components\/responses\/CompanyResourceNotFound"},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}},"patch":{"tags":["Company Publishing"],"operationId":"updateCompanyDraft","summary":"Update an Agency draft","description":"Requires `canWriteDrafts`. Partial update of a draft; send at least one field. Omitted `platforms` keep the current selection. Changing text, channels, media or settings makes a requested client review outdated.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/CompanyDraftInput"}],"minProperties":1}}}},"responses":{"200":{"description":"Draft updated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDraftResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyInvalidInput"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"$ref":"#\/components\/responses\/CompanyBillingRequired"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"$ref":"#\/components\/responses\/CompanyResourceNotFound"},"409":{"description":"AGENCY_CORE_GROUP_NOT_EDITABLE (not a draft), AGENCY_CORE_GROUP_CONFLICT or AGENCY_CORE_POST_CONFLICT (changed concurrently), or an idempotency conflict.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}}},"\/company\/post-groups\/{postGroupId}\/schedule":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"}],"post":{"tags":["Company Publishing"],"operationId":"scheduleCompanyPostGroup","summary":"Schedule a draft","description":"Requires `canScheduleOrPublish`. The draft needs selected channels that are all usable, ready media and, while a client review is requested, the client's current approval. To publish now, send the current UTC time and keep the same value on retries. Move a scheduled post with reschedule.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"},{"$ref":"#\/components\/parameters\/CompanyIncludeValidationDetails"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyScheduleInput"}}}},"responses":{"200":{"description":"Scheduled. Publication runs asynchronously; read the post group for the result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyScheduleResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyScheduleInvalid"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"description":"COMPANY_BILLING_REQUIRED for the Account or a selected channel waiting for billing activation.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"$ref":"#\/components\/responses\/CompanyResourceNotFound"},"409":{"description":"AGENCY_CORE_GROUP_CONFLICT (not a draft, including an already scheduled post, or changed concurrently), AGENCY_CORE_POST_ALREADY_PROCESSING, AGENCY_CORE_POST_CONFLICT, AGENCY_CORE_CONNECTION_MISSING, or an idempotency conflict.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}}},"\/company\/post-groups\/{postGroupId}\/reschedule":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"}],"post":{"tags":["Company Publishing"],"operationId":"rescheduleCompanyPostGroup","summary":"Change the time of a scheduled post","description":"Requires `canScheduleOrPublish`. Works only before publishing starts; the same publishing checks as schedule run again.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"},{"$ref":"#\/components\/parameters\/CompanyIncludeValidationDetails"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyScheduleInput"}}}},"responses":{"200":{"description":"Rescheduled.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyScheduleResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyScheduleInvalid"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"description":"COMPANY_BILLING_REQUIRED for the Account or a selected channel waiting for billing activation.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"$ref":"#\/components\/responses\/CompanyResourceNotFound"},"409":{"description":"AGENCY_CORE_GROUP_NOT_RESCHEDULABLE (not scheduled), AGENCY_CORE_GROUP_CONFLICT, AGENCY_CORE_POST_ALREADY_PROCESSING, AGENCY_CORE_POST_CONFLICT, AGENCY_CORE_CONNECTION_MISSING, or an idempotency conflict.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}}},"\/company\/post-groups\/{postGroupId}\/unschedule":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"}],"post":{"tags":["Company Publishing"],"operationId":"unscheduleCompanyPostGroup","summary":"Return a scheduled post to a draft","description":"Requires `canScheduleOrPublish`. Works only before publishing starts. Allowed without active billing, so posts can be stopped while billing is required.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"responses":{"200":{"description":"The post group is a draft again.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyUnscheduleResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyInvalidInput"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"$ref":"#\/components\/responses\/CompanyResourceNotFound"},"409":{"description":"AGENCY_CORE_GROUP_NOT_UNSCHEDULABLE, AGENCY_CORE_POST_ALREADY_PROCESSING, AGENCY_CORE_POST_CONFLICT, or an idempotency conflict.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}}},"\/company\/post-groups\/{postGroupId}\/recover":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"}],"post":{"tags":["Company Publishing"],"operationId":"recoverCompanyPostGroup","summary":"Copy failed channels into a new draft","description":"Requires `canWriteDrafts`. For a failed or partially published post group, creates a new draft with the confirmed failed channels and copies the media; the source is not changed. Channels that published or whose outcome is unknown are listed in `excludedPlatforms`. A YouTube thumbnail is not copied.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"responses":{"201":{"description":"New draft created. An identical retry returns the original result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyRecoverResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyInvalidInput"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"$ref":"#\/components\/responses\/CompanyBillingRequired"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"$ref":"#\/components\/responses\/CompanyResourceNotFound"},"409":{"description":"AGENCY_CORE_GROUP_NOT_RECOVERABLE (no confirmed failed channel), AGENCY_CORE_RECOVERY_MEDIA_UNAVAILABLE, AGENCY_CORE_CONNECTION_MISSING, AGENCY_CORE_GROUP_CONFLICT, AGENCY_CORE_POST_CONFLICT, or an idempotency conflict.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"429":{"description":"AGENCY_CORE_MEDIA_WORKSPACE_QUOTA_EXCEEDED while copying media. Respect Retry-After.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"description":"AGENCY_CORE_RECOVERY_COPY_FAILED (no draft was created; retry the identical request), AGENCY_CORE_CONTENT_UNAVAILABLE or AGENCY_CORE_CONTENT_GRAPH_INVALID.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}}}}},"\/company\/post-groups\/{postGroupId}\/approval":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"}],"get":{"tags":["Company Publishing"],"operationId":"getCompanyPostApproval","summary":"Read the client review of a post group","description":"Requires `canViewContent`. Send `Accept: application\/vnd.publora.company-approval.v2+json, application\/json`; without it, a declined review or one requested with a `scheduledTime` returns 409 COMPANY_APPROVAL_CLIENT_UPDATE_REQUIRED.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"}],"responses":{"200":{"description":"Current review round; `status` is `none` when no review was requested.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyApprovalReadResponse"}},"application\/vnd.publora.company-approval.v2+json":{"schema":{"$ref":"#\/components\/schemas\/CompanyApprovalReadResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyApprovalInvalid"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"409":{"description":"COMPANY_APPROVAL_CLIENT_UPDATE_REQUIRED. Repeat the request with the v2 Accept header.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"$ref":"#\/components\/responses\/CompanyApprovalUnavailable"}}},"post":{"tags":["Company Publishing"],"operationId":"requestCompanyPostApproval","summary":"Request a client review","description":"Requires `canScheduleOrPublish`. Starts a new review round for the saved draft and replaces the previous one. Finish edits and media first. `reviewUrl` in the response is a private page for the client, valid until `expiresAt`; Publora does not send it, so deliver it yourself. Editing the draft afterwards makes the round outdated.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyApprovalRequestInput"}}}},"responses":{"200":{"description":"Review requested. An identical retry returns the original result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyApprovalCommandResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyApprovalInvalid"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"$ref":"#\/components\/responses\/CompanyBillingRequired"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"409":{"description":"COMPANY_APPROVAL_NOT_READY (not a draft, no channels or media not ready), COMPANY_APPROVAL_TARGET_UNAVAILABLE (a selected channel is no longer connected), COMPANY_APPROVAL_CONFLICT, or an idempotency conflict.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"description":"COMPANY_APPROVAL_SCHEDULING_UNAVAILABLE (a review with `scheduledTime` cannot be requested right now), COMPANY_APPROVAL_UNAVAILABLE, AGENCY_CORE_CONTENT_UNAVAILABLE or AGENCY_CORE_CONTENT_GRAPH_INVALID.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}}}},"delete":{"tags":["Company Publishing"],"operationId":"cancelCompanyPostApproval","summary":"Cancel the client review","description":"Requires `canScheduleOrPublish`. Removes the review from a draft, so it can be scheduled without the client's approval. Use it only when the user asks.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"responses":{"200":{"description":"Review removed; `status` is `none`.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyApprovalCommandResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyApprovalInvalid"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"$ref":"#\/components\/responses\/CompanyBillingRequired"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"409":{"description":"COMPANY_APPROVAL_CONFLICT (not a draft), or an idempotency conflict.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"$ref":"#\/components\/responses\/CompanyApprovalUnavailable"}}}},"\/company\/post-groups\/{postGroupId}\/approval\/notification":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"}],"post":{"tags":["Company Publishing"],"operationId":"retryCompanyApprovalNotification","summary":"Retry the review decision email","description":"Requires `canScheduleOrPublish`. When the client decides, Publora emails the user who requested the review. Call this when `notificationStatus` is `failed`. Not keyed; Idempotency-Key is ignored.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"responses":{"200":{"description":"Delivery state after the attempt.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyApprovalNotificationResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyApprovalInvalid"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"$ref":"#\/components\/responses\/CompanyBillingRequired"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"409":{"description":"COMPANY_APPROVAL_CONFLICT, the client has not decided yet.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"$ref":"#\/components\/responses\/CompanyApprovalUnavailable"}}}},"\/company\/post-groups\/{postGroupId}\/media":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"}],"get":{"tags":["Company Publishing"],"operationId":"getCompanyPostMedia","summary":"Read ordinary media and selected auxiliary YouTube thumbnail","description":"Requires `canViewContent`. `url` is set only for ready files. No query parameter is accepted.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"}],"responses":{"200":{"description":"Draft media in publishing order.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyMediaListResponse"}}}},"400":{"$ref":"#\/components\/responses\/CompanyInvalidInput"},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"$ref":"#\/components\/responses\/CompanyResourceNotFound"},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}}},"\/company\/post-groups\/{postGroupId}\/media\/reservations":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"}],"post":{"tags":["Company Publishing"],"operationId":"reserveCompanyPostMedia","summary":"Reserve ordinary media or an auxiliary YouTube thumbnail","description":"Requires `canUploadMedia` on a draft. PUT the exact bytes to `uploadUrl` with every `uploadHeaders` entry, then call complete. Limits: 35 media per draft; per Workspace 20 pending uploads and 250 reservations or 10 GiB per 24 hours. An identical retry returns the same reservation with a freshly signed URL.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"},{"$ref":"#\/components\/parameters\/CompanyIdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyMediaReservationInput"}}}},"responses":{"201":{"description":"Upload reserved.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyMediaReservationResponse"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"$ref":"#\/components\/responses\/CompanyBillingRequired"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"409":{"$ref":"#\/components\/responses\/CompanyConflict"},"422":{"$ref":"#\/components\/responses\/CompanyMediaMismatch"},"429":{"description":"AGENCY_CORE_MEDIA_WORKSPACE_QUOTA_EXCEEDED, the Workspace upload budget or pending-upload limit was reached. Respect Retry-After.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyDomainError"}}}},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}}},"\/company\/post-groups\/{postGroupId}\/media\/{mediaFileId}\/complete":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"},{"$ref":"#\/components\/parameters\/CompanyMediaFileId"}],"post":{"tags":["Company Publishing"],"operationId":"completeCompanyPostMedia","summary":"Verify a Company media upload","description":"Requires `canUploadMedia`. Not keyed; completing a ready file returns the same result. On 409 AGENCY_CORE_MEDIA_UPLOAD_PENDING retry after Retry-After; after AGENCY_CORE_MEDIA_RESERVATION_EXPIRED delete the file and reserve again.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"responses":{"200":{"description":"Upload verified; the file is ready.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyMediaCompleteResponse"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"$ref":"#\/components\/responses\/CompanyBillingRequired"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"$ref":"#\/components\/responses\/CompanyResourceNotFound"},"409":{"$ref":"#\/components\/responses\/CompanyConflict"},"422":{"$ref":"#\/components\/responses\/CompanyMediaMismatch"},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}}},"\/company\/post-groups\/{postGroupId}\/media\/{mediaFileId}":{"parameters":[{"$ref":"#\/components\/parameters\/CompanyPostGroupId"},{"$ref":"#\/components\/parameters\/CompanyMediaFileId"}],"delete":{"tags":["Company Publishing"],"operationId":"removeCompanyPostMedia","summary":"Detach media and accept delayed storage cleanup","description":"Requires `canUploadMedia`. Detaches the file from the draft and deletes it from storage after `deletionAfter`. A requested client review becomes outdated. Not keyed; a repeat returns the same result.","parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"},{"$ref":"#\/components\/parameters\/CompanyWorkspaceId"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"responses":{"202":{"description":"Detached; storage cleanup is pending.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyMediaDeleteResponse"}}}},"401":{"$ref":"#\/components\/responses\/CompanyAuthenticationFailed"},"402":{"$ref":"#\/components\/responses\/CompanyBillingRequired"},"403":{"$ref":"#\/components\/responses\/CompanyAccessDenied"},"404":{"$ref":"#\/components\/responses\/CompanyResourceNotFound"},"409":{"$ref":"#\/components\/responses\/CompanyConflict"},"422":{"$ref":"#\/components\/responses\/CompanyMediaMismatch"},"503":{"$ref":"#\/components\/responses\/CompanyUnavailable"}}}},"\/platform-connections":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"get":{"summary":"List connected social accounts","description":"Returns all social media accounts connected to your Publora account.","operationId":"getPlatformConnections","tags":["Connections"],"responses":{"200":{"description":"List of connected accounts","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"connections":{"type":"array","items":{"$ref":"#\/components\/schemas\/PlatformConnection"}}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to fetch platform connections"}}}}}}},"\/platform-limits":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"get":{"summary":"Get live per-platform posting limits","description":"Return Publora's per-platform limits (characters, images, videos,\ndocuments, GIFs, thumbnails, and requirements) as live JSON, sourced\nfrom the shared @publora\/platform-limits package. These are the\nAPI-specific limits Publora validates against before scheduling \u2014 use\nthem to drive client-side validation instead of hard-coding values.\nNo parameters.\n","operationId":"getPlatformLimits","tags":["Posts"],"responses":{"200":{"description":"Per-platform limits","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"schemaVersion":{"type":"integer","example":1},"source":{"type":"string","example":"@publora\/platform-limits"},"packageVersion":{"type":"string","example":"1.0.0"},"limitsLastUpdated":{"type":"string","example":"2026-03-11"},"supportedPlatforms":{"type":"array","items":{"type":"string"},"example":["twitter","instagram","threads","tiktok","linkedin","youtube","facebook","mastodon","bluesky","telegram","pinterest"]},"platforms":{"type":"object","description":"Keyed by platform. Each value carries platform, displayName, characters, images, videos, requirements, plus documents, gifs, and thumbnails (null when the platform has no distinct spec).","additionalProperties":{"type":"object"}}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/account-context":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"get":{"summary":"Read plan, features and publishing quotas","description":"Read-only snapshot of the personal account behind the API key: plan,\navailable features,\npublishing quotas, schedule horizon and allowed platforms. Call it before\na batch of posts and after a quota or feature error. Quotas count platform\nposts; `limit: null` means unlimited. The snapshot is advisory\n(`advisory: true`): it reserves nothing, and every write is checked again.\nThe MCP tool `account_context` returns the same object.\n","operationId":"getAccountContext","tags":["Posts"],"parameters":[{"name":"scheduledTime","in":"query","required":false,"description":"ISO 8601 date-time with `Z` or an explicit offset. Selects the monthly\nquota period of a planned batch; omit it for the current period. A past\ntime resolves to the current period (see `effectiveQuotaTime`).\n","schema":{"type":"string","format":"date-time"},"example":"2026-11-03T09:00:00Z"}],"responses":{"200":{"description":"Account context snapshot","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"context":{"$ref":"#\/components\/schemas\/AccountContext"}}}}}},"400":{"description":"Malformed scheduledTime","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"scheduledTime must be a valid ISO date-time"},"code":{"type":"string","example":"INVALID_SCHEDULED_TIME"},"retryable":{"type":"boolean","example":false},"nextAction":{"type":"string","example":"CHANGE_SCHEDULE"}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"403":{"description":"API access is not enabled for this account","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Failed to read account context","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/create-post":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Create and schedule a social media post","description":"Create a post to be published across one or more social media platforms.\nSupports text, images, and video (1 video per post).\nThe image count per post is platform-specific: Twitter\/X, Bluesky, and\nMastodon allow up to 4; Instagram, LinkedIn, Facebook, and Telegram\nallow up to 10; Threads allows up to 20. There is no separate\n\"carousel\" field \u2014 a\ncarousel is formed implicitly by attaching multiple images to one\npostGroupId (Instagram: 2-10 images = carousel, 1 image = single photo),\nin upload order. See the Media Uploads guide for the full matrix.\nIf scheduledTime is provided, the post will be published at that time.\nIf omitted, the post is saved as a draft. Set publishNow=true to publish\nimmediately at server time.\n","operationId":"createPost","tags":["Posts"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Opt-in idempotency. Omit the header for the previous behaviour \u2014\nevery call creates a new post.\n\nSend a unique value (a UUID is a good choice) per logical operation\nto make retries safe:\n\n- Same key + identical body, original request finished \u2192 the original\n  status code and response body are replayed. No second post.\n- Same key + identical body, original request still in flight \u2192 `409`\n  (`IDEMPOTENCY_IN_FLIGHT`). Retry shortly.\n- Same key + different body \u2192 `422` (`IDEMPOTENCY_KEY_CONFLICT`).\n  Nothing is created.\n\nKeys are scoped to the API key's user, so they never collide across\naccounts.\nRecords expire 24 hours after they are created; reusing a key after\nthat window is treated as a brand-new request.\n","schema":{"type":"string"},"example":"6f1e2d3c-4b5a-4c7d-8e9f-0a1b2c3d4e5f"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["platforms"],"properties":{"content":{"type":"string","description":"Normally required and non-empty. May be omitted or empty only when a targeted LinkedIn connection has repost intent via platformSettings.linkedin.repostEnabled=true or a non-empty repostParentUrn; repost validation still requires a valid parent\/setting combination.","example":"Excited to share our new product launch! \ud83d\ude80 #launch"},"platforms":{"type":"array","items":{"type":"string"},"description":"Array of platform connection IDs (format: platform-platformId). Each ID must appear at most once; a repeated ID is rejected with 400 \"Platforms must not contain duplicates\".","example":["twitter-123456789","linkedin-ABC123"]},"scheduledTime":{"type":"string","format":"date-time","description":"ISO 8601 UTC datetime for scheduling. Omit for draft.\n\nIf the time is in the past, it is clamped to the current server\ntime and a `SCHEDULED_TIME_COERCED` warning is returned \u2014 the\npost is still created. Read the `scheduledTime` in the response\nfor the time actually stored.\n\nTimes less than 5 minutes in the past are always tolerated this\nway. Strict rejection for a time 5 or more minutes in the past\nis scheduled to begin on **2026-08-25**, unless production\nconfiguration overrides that date. Before strict mode it is\nclamped with a warning. Send a future time to avoid both.\n","example":"2027-03-01T14:00:00.000Z"},"publishNow":{"type":"boolean","default":false,"description":"`true` publishes immediately. The server uses its current time as\nscheduledTime, stores the post as `scheduled` and starts delivery at\nonce; the response does not wait for the platforms. The usual\nconnection, plan, content, media and first-comment validation applies.\nPublish Now uses the monthly post allowance (`POST_LIMIT_REACHED`) but\ntakes no slot in the scheduled-post queue and ignores the schedule\nhorizon. Combining it with a future scheduledTime or `status: \"draft\"`\nreturns 400 `PUBLISH_NOW_CONFLICT`; a non-boolean value returns 400\n`INVALID_PUBLISH_NOW`. Omitted or `false` keeps draft\/schedule behavior.\n","example":true},"platformSettings":{"$ref":"#\/components\/schemas\/PlatformSettingsInput"},"firstComment":{"$ref":"#\/components\/schemas\/FirstCommentInput"},"firstComments":{"nullable":true,"allOf":[{"$ref":"#\/components\/schemas\/FirstCommentsInput"}]},"mediaUrls":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"string","format":"uri"},"description":"Public https URLs downloaded server-side. Images: 25 MB each; videos: 150 MB each; aggregate: 300 MB. Ingestion is all-or-nothing."}}}}}},"responses":{"200":{"description":"Post created","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"postGroupId":{"type":"string","example":"507f1f77bcf86cd799439011"},"scheduledTime":{"type":"string","format":"date-time","nullable":true,"description":"The effective scheduled time that was actually stored. Always\npresent. `null` when the post was saved as a draft (no\nscheduledTime sent). This may differ from the value you sent\n\u2014 if so, a `SCHEDULED_TIME_COERCED` warning explains why.\nTrust this field over your requested value.\n","example":"2026-03-01T14:00:00.000Z"},"warnings":{"type":"array","description":"Non-fatal notices about a request that still succeeded. Only\npresent when at least one warning applies.\n","items":{"$ref":"#\/components\/schemas\/Warning"}}}}}}},"400":{"description":"Validation error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingContent":{"value":{"error":"Content is required"}},"invalidTime":{"value":{"error":"Invalid scheduled time format"}},"pastTime":{"summary":"scheduledTime 5+ minutes in the past (strict mode)","value":{"error":"Scheduled time is in the past. Server time is 2026-09-01T14:02:11.412Z UTC.","code":"SCHEDULED_TIME_IN_PAST","serverTime":"2026-09-01T14:02:11.412Z"}},"unknownPlatformSetting":{"summary":"Unrecognised platformSettings path \u2014 nothing was created","value":{"error":"Unknown platformSettings path: youtube.thumbnail.typo","code":"PLATFORM_SETTING_UNKNOWN","field":"youtube.thumbnail.typo"}},"idempotencyBodyTooComplex":{"summary":"Idempotency-Key sent with an excessively nested body","value":{"error":"Idempotency-Key request body is too deeply nested","code":"IDEMPOTENCY_BODY_TOO_COMPLEX"}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"403":{"description":"Access entitlement or plan limit denied; inspect the returned code\/error rather than matching an example string","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"409":{"description":"An earlier request with this `Idempotency-Key` is still in flight.\nNothing was created by this call \u2014 retry shortly to receive the\noriginal response. Match on `code`; the `error` text varies.\n","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"inFlight":{"value":{"error":"A request with this idempotency key is still in flight","code":"IDEMPOTENCY_IN_FLIGHT"}},"superseded":{"value":{"error":"Idempotency claim was superseded by another request","code":"IDEMPOTENCY_IN_FLIGHT"}}}}}},"422":{"description":"This `Idempotency-Key` was already used with a different request body.\nNothing was created \u2014 either replay the original body, or retry with a\nnew key.\n","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Idempotency key was already used with a different request body","code":"IDEMPOTENCY_KEY_CONFLICT"}}}},"429":{"description":"Media URL ingestion rate limit (60 URLs per fixed one-hour window)","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until retry"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MediaUrlRateLimitError"},"example":{"error":"Media URL ingestion rate limit reached (60 URLs\/hour). Retry later or use the presigned get-upload-url flow.","code":"MEDIA_URL_RATE_LIMITED","retryAfterSec":60}}}},"500":{"description":"Internal server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"503":{"description":"The Threads permission check needed to schedule a Threads chain could\nnot be completed. Nothing was created. Retry shortly; this never\nmeans the account must reconnect.\n","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ThreadsPermissionsUnavailableError"}}}}}}},"\/get-post\/{postGroupId}":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"get":{"summary":"Get post details and status","description":"Retrieve the details, platform statuses, and posted IDs for a post group.","operationId":"getPost","tags":["Posts"],"parameters":[{"name":"postGroupId","in":"path","required":true,"schema":{"type":"string"},"example":"507f1f77bcf86cd799439011"}],"responses":{"200":{"description":"Post details","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"postGroupId":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","published","failed","partially_published"],"description":"Post-group status. Always present."},"scheduledTime":{"type":"string","format":"date-time","nullable":true,"description":"The effective scheduled time stored for this post group.\nAlways present; `null` for drafts and for groups that were\nnever given a time.\n","example":"2026-03-01T14:00:00.000Z"},"platformSettings":{"type":"object","description":"Per-platform settings currently stored on this post group,\nkeyed by platform. Always present; `{}` when none are set.\nMirrors the platformSettings accepted by \/create-post and\n\/update-post.\n","example":{"youtube":{"privacy":"public","madeForKids":false}}},"firstComment":{"nullable":true,"description":"Legacy alias for firstComments[0], or null when none is set.\n","allOf":[{"$ref":"#\/components\/schemas\/FirstCommentInput"}]},"firstComments":{"type":"array","description":"Stored ordered first comments; old single-comment documents read as a one-element array.","items":{"$ref":"#\/components\/schemas\/FirstCommentSequenceItem"}},"platforms":{"type":"array","items":{"type":"string"},"description":"Platform connection IDs targeted by this post group (format:\nplatform-platformId). Always present; `[]` when none.\n","example":["twitter-123456789","linkedin-ABC123"]},"posts":{"type":"array","items":{"$ref":"#\/components\/schemas\/Post"}},"media":{"type":"array","description":"Attached media inventory in post-group order. Always present; empty when none is attached.","items":{"type":"object","properties":{"mediaId":{"type":"string"},"sourceFileName":{"type":"string","nullable":true},"fileName":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"mimeType":{"type":"string","nullable":true},"status":{"type":"string"},"failureReason":{"type":"string","nullable":true},"url":{"type":"string","nullable":true}}}}}}}}},"400":{"description":"postGroupId is not a valid ObjectId","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Invalid post group ID"}}}},"404":{"description":"Post not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/update-post\/{postGroupId}":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"put":{"summary":"Edit a draft or scheduled post","description":"Modify the content, target platforms, scheduled time, status, platformSettings,\nor mediaUrls of an existing draft or scheduled post.\nOnly post groups whose status is draft or scheduled can be updated. `pending`\nand `processing` belong to separate processing\/per-platform state, not\nto the post-group status enum.\nAt least one of publishNow, status, scheduledTime, content, platforms,\nplatformSettings, firstComment, firstComments, or mediaUrls must be provided.\n`publishNow: true` publishes a draft or scheduled post immediately at server\ntime. Every field is a patch \u2014 omit it to leave the stored\nvalue unchanged.\n`content` replaces the base text and rewrites each platform post to its effective\ncontent, preserving explicit per-account overrides. `platforms` replaces the whole\ntarget set (it is not merged); added connections are validated for ownership and\nplan entitlement, and adding a target to a scheduled post re-runs scheduling\nquota and post validation.\nplatformSettings are merged per-platform with existing settings \u2014\nomitted fields are preserved.\nUpdating a post group also updates all associated platform-specific posts.\nA content or platform edit is refused with POST_NOT_EDITABLE (400) or\nPOST_PUBLISH_IN_PROGRESS \/ POST_GROUP_VERSION_CONFLICT (409) rather than\npartially applied.\n","operationId":"updatePost","tags":["Posts"],"parameters":[{"name":"postGroupId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Opt-in idempotency. Omit the header for the previous behaviour \u2014\nevery call applies the update again.\n\nSend a unique value (a UUID is a good choice) per logical operation\nto make retries safe:\n\n- Same key + identical body, original request finished \u2192 the original\n  status code and response body are replayed. The update is not\n  re-applied.\n- Same key + identical body, original request still in flight \u2192 `409`\n  (`IDEMPOTENCY_IN_FLIGHT`). Retry shortly.\n- Same key + different body \u2192 `422` (`IDEMPOTENCY_KEY_CONFLICT`).\n  Nothing is changed.\n\nThe key is bound to this `postGroupId` as well as the body, so the\nsame key reused against a different post counts as a different\nrequest. Keys are scoped to the API key's user, so they never collide\nacross accounts.\nRecords expire 24 hours after they are created; reusing a key after\nthat window is treated as a brand-new request.\n","schema":{"type":"string"},"example":"6f1e2d3c-4b5a-4c7d-8e9f-0a1b2c3d4e5f"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","description":"At least one of publishNow, status, scheduledTime, content, platforms, platformSettings, firstComment, firstComments, or mediaUrls must be provided","properties":{"content":{"type":"string","description":"Replacement base post text. Every platform post without an explicit\nper-account override is rewritten to this text; overrides created in\nthe web editor are preserved. Editing the text of a Twitter or Threads\ntarget clears its derived thread split so it is recomputed.\n\nAn empty string is accepted while the post stays a draft. Scheduling\nstill enforces each platform's content and media rules.\n"},"platforms":{"type":"array","items":{"type":"string"},"description":"Replacement target set. The array REPLACES the stored one \u2014 it is not\nmerged, so send the complete final list. Use the exact connection IDs\nreturned by GET \/platform-connections; duplicates are rejected with\nINVALID_PLATFORMS and unknown\/foreign IDs with INVALID_PLATFORM_CONNECTION.\n\nIDs removed from the array have their platform posts deleted. An empty\narray is accepted only while the post remains a draft; scheduling an\nempty set returns PLATFORMS_REQUIRED.\n","example":["linkedin-ABC123","twitter-XYZ789"]},"status":{"type":"string","enum":["draft","scheduled"],"description":"New status"},"scheduledTime":{"type":"string","format":"date-time","description":"New ISO 8601 UTC scheduled time. Send a future time.\n\nIf the time is in the past, it is clamped to the current server\ntime and a `SCHEDULED_TIME_COERCED` warning is returned \u2014 the\nupdate still succeeds. Read the `scheduledTime` in the response\nfor the time actually stored.\n\nTimes less than 5 minutes in the past are always tolerated this\nway. Strict rejection for a time 5 or more minutes in the past\nis scheduled to begin on **2026-08-25**, unless production\nconfiguration overrides that date. Before strict mode it is\nclamped with a warning.\n\nThe same check applies to the post's existing scheduledTime when\nyou move a post to `status: \"scheduled\"` without sending a new\ntime \u2014 a long-stale draft can therefore be rejected.\n"},"publishNow":{"type":"boolean","description":"`true` publishes this draft or scheduled post immediately at server\ntime, with the same checks as create-post. A scheduled post moved to\nPublish Now frees its scheduled-queue slot and keeps its monthly\nreservation when the month and targets are unchanged. Combining it\nwith a future scheduledTime or `status: \"draft\"` returns 400\n`PUBLISH_NOW_CONFLICT`; a non-boolean value returns 400\n`INVALID_PUBLISH_NOW`.\n","example":true},"platformSettings":{"$ref":"#\/components\/schemas\/PlatformSettingsInput"},"firstComment":{"nullable":true,"description":"Legacy single-comment replacement, or null to remove it.\nDo not send with firstComments.\n","allOf":[{"$ref":"#\/components\/schemas\/FirstCommentInput"}]},"firstComments":{"nullable":true,"description":"Replace the ordered list; null or [] clears it. Do not send with firstComment.","allOf":[{"$ref":"#\/components\/schemas\/FirstCommentsInput"}]},"mediaUrls":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"string","format":"uri"},"description":"Public https URLs downloaded server-side and appended to existing media. Images: 25 MB each; videos: 150 MB each; aggregate: 300 MB. Ingestion is all-or-nothing."}}}}}},"responses":{"200":{"description":"Post updated","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string","example":"Post updated successfully"},"scheduledTime":{"type":"string","format":"date-time","nullable":true,"description":"The effective scheduled time that was actually stored. Always\npresent. `null` when the post has no scheduled time (e.g. it\nwas moved back to draft). This may differ from the value you\nsent \u2014 if so, a `SCHEDULED_TIME_COERCED` warning explains\nwhy. Trust this field over your requested value.\n","example":"2026-03-01T14:00:00.000Z"},"warnings":{"type":"array","description":"Non-fatal notices about a request that still succeeded. Only\npresent when at least one warning applies.\n","items":{"$ref":"#\/components\/schemas\/Warning"}},"postGroup":{"type":"object","properties":{"_id":{"type":"string"},"status":{"type":"string"},"content":{"type":"string","description":"The effective base text stored after the update. Always\npresent; an empty string when the post has no base text.\n","example":"Corrected launch announcement."},"platforms":{"type":"array","items":{"type":"string"},"description":"The effective target set stored after the update. Always\npresent; an empty array for a draft with no targets.\n","example":["linkedin-ABC123","twitter-XYZ789"]},"scheduledTime":{"type":"string","format":"date-time","description":"Only included if the post has a scheduled time. Duplicates\nthe top-level `scheduledTime`, which is always present and\nis the preferred field to read.\n"}}}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingFields":{"value":{"error":"At least one of status, scheduledTime, content, platforms, platformSettings, or mediaUrls must be provided"}},"invalidContent":{"summary":"content sent as a non-string","value":{"error":"Content must be a string","code":"INVALID_CONTENT","field":"content"}},"invalidPlatforms":{"summary":"platforms failed shape validation","value":{"error":"Platforms must not contain duplicates","code":"INVALID_PLATFORMS","field":"platforms"}},"invalidPlatformConnection":{"summary":"An added platform is not a connection owned by the caller","value":{"error":"Invalid platform connection(s): linkedin-NOPE. Check connected accounts or call GET \/platform-connections.","code":"INVALID_PLATFORM_CONNECTION","invalidPlatforms":["linkedin-NOPE"]}},"platformsRequired":{"summary":"Scheduling with an empty target set","value":{"error":"PLATFORMS_REQUIRED","code":"PLATFORMS_REQUIRED","message":"At least one platform is required to schedule a post. Add a platform or keep the post as a draft."}},"childNotEditable":{"summary":"A platform post has already reached a terminal state","value":{"error":"Cannot edit a post with a child in published status.","code":"POST_NOT_EDITABLE"}},"invalidStatus":{"value":{"error":"Status must be either 'draft' or 'scheduled'"}},"invalidTimeFormat":{"value":{"error":"Invalid scheduled time format"}},"pastTime":{"summary":"scheduledTime 5+ minutes in the past (strict mode)","value":{"error":"Scheduled time is in the past. Server time is 2026-09-01T14:02:11.412Z UTC.","code":"SCHEDULED_TIME_IN_PAST","serverTime":"2026-09-01T14:02:11.412Z"}},"unknownPlatformSetting":{"summary":"Unrecognised platformSettings path \u2014 nothing was changed","value":{"error":"Unknown platformSettings path: youtube.thumbnail.typo","code":"PLATFORM_SETTING_UNKNOWN","field":"youtube.thumbnail.typo"}},"idempotencyBodyTooComplex":{"summary":"Idempotency-Key sent with an excessively nested body","value":{"error":"Idempotency-Key request body is too deeply nested","code":"IDEMPOTENCY_BODY_TOO_COMPLEX"}},"cannotUpdate":{"value":{"error":"Cannot update post: post is currently in published status","code":"POST_NOT_EDITABLE"}},"invalidPostGroupId":{"summary":"postGroupId is not a valid ObjectId","value":{"error":"Invalid post group ID"}},"mediaNotUsable":{"summary":"Scheduling found attached media that cannot be used","description":"`code` is `MEDIA_UPLOAD_MISSING`, `MEDIA_VALIDATION_FAILED`,\n`MEDIA_REFERENCE_MISSING`, or the fallback `MEDIA_NOT_READY`.\nThe post was not changed; a media file the check marked\nfailed stays failed.\n","value":{"error":"Uploaded media is missing from storage. The upload did not complete; remove it and upload the file again.","code":"MEDIA_UPLOAD_MISSING","mediaFileId":"507f1f77bcf86cd799439012","mediaStatus":"failed","reason":"Uploaded media is missing from storage. The upload did not complete; remove it and upload the file again.","retryable":false,"suggestions":["The upload never produced an object in storage. DELETE \/api\/v1\/media\/:mediaId, \u2026"]}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"409":{"description":"The update conflicts with concurrent work and nothing was changed.\nEither an earlier request with this `Idempotency-Key` is still in\nflight, or the post is being published, or another write committed\nfirst. Match on `code`; the `error` text varies. Re-read the post\nwith GET \/get-post before retrying \u2014 do not blind-retry an edit that\nraces publishing.\n","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"inFlight":{"value":{"error":"A request with this idempotency key is still in flight","code":"IDEMPOTENCY_IN_FLIGHT"}},"superseded":{"value":{"error":"Idempotency claim was superseded by another request","code":"IDEMPOTENCY_IN_FLIGHT"}},"publishInProgress":{"summary":"The group or one of its platform posts is publishing","value":{"error":"Post publishing has already started; the post can no longer be edited.","code":"POST_PUBLISH_IN_PROGRESS"}},"versionConflict":{"summary":"Another edit committed first \u2014 this request changed nothing","value":{"error":"Post group state changed concurrently; please retry.","code":"POST_GROUP_VERSION_CONFLICT"}}}}}},"422":{"description":"This `Idempotency-Key` was already used with a different request body\n(or against a different postGroupId). Nothing was changed \u2014 either\nreplay the original body, or retry with a new key.\n","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Idempotency key was already used with a different request body","code":"IDEMPOTENCY_KEY_CONFLICT"}}}},"404":{"description":"Post not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Post group not found"}}}},"429":{"description":"Media URL ingestion rate limit reached (60 URLs per fixed one-hour window)","headers":{"Retry-After":{"description":"Seconds to wait before retrying","schema":{"type":"integer"}}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MediaUrlRateLimitError"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to update post"}}}},"503":{"description":"Scheduling was refused and the post was not changed. `code` tells the\ntwo cases apart:\n\n- `MEDIA_UPLOAD_PENDING` or `MEDIA_VALIDATION_PENDING`\n  (`MediaPendingError`): attached media is still pending. Validation\n  progress on the media is kept; retry after `Retry-After` seconds.\n- `THREADS_PERMISSIONS_UNAVAILABLE`\n  (`ThreadsPermissionsUnavailableError`): the Threads permission\n  check could not be completed. Only `code` and `error`, with no\n  `retryable` field and no `Retry-After` header; retry shortly.\n","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent only with `MediaPendingError`.","schema":{"type":"integer"}}},"content":{"application\/json":{"schema":{"oneOf":[{"$ref":"#\/components\/schemas\/MediaPendingError"},{"$ref":"#\/components\/schemas\/ThreadsPermissionsUnavailableError"}],"discriminator":{"propertyName":"code","mapping":{"MEDIA_UPLOAD_PENDING":"#\/components\/schemas\/MediaPendingError","MEDIA_VALIDATION_PENDING":"#\/components\/schemas\/MediaPendingError","THREADS_PERMISSIONS_UNAVAILABLE":"#\/components\/schemas\/ThreadsPermissionsUnavailableError"}}}}}}}}},"\/delete-post\/{postGroupId}":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"delete":{"summary":"Delete a scheduled post","description":"Delete a post group and all associated data. This operation removes:\n- The post group record\n- All platform-specific posts (Twitter, LinkedIn, Instagram, etc.)\n- All media file records from the database\n- All media files from S3 storage\n\nThe database deletion is atomic (uses MongoDB transaction). S3 deletion\nfailures are logged but do not fail the request.\n","operationId":"deletePost","tags":["Posts"],"parameters":[{"name":"postGroupId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Post deleted","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"400":{"description":"postGroupId is not a valid ObjectId","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Invalid post group ID"}}}},"404":{"description":"Post group not found (ID doesn't exist or belongs to another user)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Post group not found"}}}},"500":{"description":"Server error during deletion (transaction rolled back)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to delete post group"}}}}}}},"\/media\/{mediaId}":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"delete":{"summary":"Delete an uploaded media file","description":"Delete a media record and its stored object. If the media belonged to a\nscheduled post, the post is demoted to draft and must be scheduled again.\nMedia cannot be removed while its post is publishing or after the group\nhas reached published or failed status.\n","operationId":"deleteMedia","tags":["Media"],"parameters":[{"name":"mediaId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Media deleted","content":{"application\/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","example":true},"postGroupDemoted":{"type":"boolean"},"message":{"type":"string"},"groupAlreadyMissing":{"type":"boolean"},"mediaWasOrphan":{"type":"boolean"},"thumbnailCleared":{"type":"boolean"},"coverCleared":{"type":"boolean"}}}}}},"400":{"description":"Invalid media ID, or media belongs to a published or failed post","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Media file not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"409":{"description":"Post is publishing or changed state concurrently; retry later","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Failed to delete media","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/get-upload-url":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Get pre-signed URL for media upload","description":"Get a pre-signed S3 URL to upload images, videos, or PDF documents.\nUpload the file directly to S3 via HTTP PUT, then create a post.\nUpload URLs expire in 1 hour. The image count per post is\nplatform-specific (up to 4 for Twitter\/X, Bluesky, Mastodon; up to 10\nfor Instagram, LinkedIn, Facebook, Telegram; up to 20 for Threads), or 1 video per\npost. Attach multiple images to the same postGroupId to form a carousel;\nthese post-media count rules do not apply to PDF document assets.\n","operationId":"getUploadUrl","tags":["Media"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["fileName","contentType","postGroupId"],"properties":{"fileName":{"type":"string","example":"photo.jpg"},"contentType":{"type":"string","description":"MIME type. It must match an image\/*, video\/*, or application\/pdf upload.","example":"image\/jpeg"},"type":{"type":"string","enum":["image","video","document"],"description":"Optional media-type hint; inferred from contentType when omitted","example":"image"},"postGroupId":{"type":"string","description":"Post group to attach media to","example":"507f1f77bcf86cd799439011"}}}}}},"responses":{"200":{"description":"Upload URL generated","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"uploadUrl":{"type":"string","format":"uri","description":"Pre-signed S3 URL. PUT your file here."},"fileUrl":{"type":"string","format":"uri","description":"Public URL after upload"},"mediaId":{"type":"string","description":"Media record ID"}}}}}},"400":{"description":"Missing required fields","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingFields":{"value":{"error":"fileName, contentType, and postGroupId are required"}},"invalidPostGroupId":{"value":{"error":"Invalid postGroupId"}},"unsupportedContentType":{"value":{"error":"Only video, image, and PDF files are allowed"}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"serverError":{"value":{"error":"Server error"}}}}}}}}},"\/complete-media\/{mediaFileId}":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Probe and finalize an uploaded media file","description":"Optionally run the server-side media probe immediately after uploading\nbytes to the pre-signed URL. This call is not required: scheduling also\nprobes media that is still uploading.\n","operationId":"completeMedia","tags":["Media"],"parameters":[{"name":"mediaFileId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Media probe completed","content":{"application\/json":{"schema":{"type":"object","required":["success","mediaFile"],"properties":{"success":{"type":"boolean","example":true},"mediaFile":{"type":"object","required":["_id"],"properties":{"_id":{"type":"string"},"type":{"type":"string","nullable":true},"mimeType":{"type":"string","nullable":true},"fileName":{"type":"string","nullable":true},"url":{"type":"string","format":"uri","nullable":true},"status":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":true}}}}}}}},"400":{"description":"Invalid media ID or uploaded media failed validation","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Media file not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"409":{"description":"Media was deleted or failed concurrently while being probed","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Failed to complete media upload","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"503":{"description":"Media probe service or uploaded object is temporarily unavailable","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/attach-media\/{postGroupId}":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Attach a file to a post by reference","description":"Attach one image or video to an existing draft or scheduled post using a\nfile reference: an HTTPS download URL plus a stable file ID, the shape\nChatGPT supplies through `openai\/fileParams` to the MCP `attach_media`\ntool. Publora downloads the file right away through the same guarded\npipeline as `mediaUrls`, which detects the type from the bytes and probes\nthe file. Accepted: JPEG, PNG, GIF, WebP, TIFF and AVIF images up to 25 MB;\nMP4, MOV and WebM videos up to 150 MB. The file is attached with status\n`ready`, and no presigned PUT or complete-media call is needed.\nThe post is always left in `draft`. A scheduled post is demoted to draft\nand keeps its stored time; schedule it again with update-post. The body\naccepts only `file` and `fileName`, and publishing parameters are rejected\nwith INVALID_MEDIA_FILE. The response has the update-post shape and does\nnot include the media ID, so read `media[]` from get-post. Each attempt that\nreaches the download counts one URL against the media URL ingestion limit\nof 60 URLs per hour, shared with `mediaUrls`; idempotent replays don't count.\n","operationId":"attachMedia","tags":["Media"],"parameters":[{"name":"postGroupId","in":"path","required":true,"schema":{"type":"string"},"example":"507f1f77bcf86cd799439011"},{"name":"Idempotency-Key","in":"header","required":false,"description":"Recommended. Publora recognises a retry by the post ID, `file.file_id`\nand the sanitized file name. `download_url` and `mime_type` are\nexcluded, so a retry with a refreshed temporary URL replays the\noriginal response instead of attaching the file twice. Reusing the\nkey with a different post, file ID or file name returns 422. A failed\ndownload frees the key for a retry with a fresh reference. Without a\nkey, every call attaches another copy. Keys are kept for 24 hours.\n","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["file"],"additionalProperties":false,"properties":{"file":{"type":"object","required":["download_url","file_id"],"additionalProperties":false,"description":"File reference. A string is rejected, including a local path, base64 data or a bare URL.","properties":{"download_url":{"type":"string","format":"uri","minLength":1,"description":"HTTPS URL to download from; temporary signed URLs work. Same checks as mediaUrls: https only, no embedded credentials, port 443, no private or loopback hosts.","example":"https:\/\/files.example.com\/download\/abc123?signature=TEMPORARY"},"file_id":{"type":"string","minLength":1,"maxLength":512,"description":"Stable file identifier; part of the idempotency fingerprint","example":"file-abc123"},"mime_type":{"type":"string","description":"Hint only; the type is detected from the bytes","example":"image\/png"},"file_name":{"type":"string","description":"Original file name; used when fileName is absent","example":"image.png"}}},"fileName":{"type":"string","minLength":1,"maxLength":255,"description":"Descriptive file name with an extension. Takes precedence over\n`file.file_name`; if both are absent the name is `chatgpt-media`.\nOnly the last path segment is kept; it is trimmed, each run of\nwhitespace becomes `_`, and any character other than an ASCII\nletter, digit, `_`, `.` or `-` is removed. A name that ends up\nempty or only dots is rejected, including one taken from\n`file.file_name`. get-post returns the result as\n`media[].sourceFileName`.\n","example":"spring-launch-banner.png"}}},"example":{"file":{"download_url":"https:\/\/files.example.com\/download\/abc123?signature=TEMPORARY","file_id":"file-abc123","mime_type":"image\/png","file_name":"image.png"},"fileName":"spring-launch-banner.png"}}}},"responses":{"200":{"description":"File downloaded, validated and attached; the post is in draft","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string","example":"Post updated successfully"},"scheduledTime":{"type":"string","format":"date-time","nullable":true,"description":"The stored scheduled time. A post demoted from scheduled keeps\nits time while in draft; `null` when no time is stored.\n"},"postGroup":{"type":"object","properties":{"_id":{"type":"string"},"status":{"type":"string","enum":["draft"]},"content":{"type":"string"},"platforms":{"type":"array","items":{"type":"string"}},"scheduledTime":{"type":"string","format":"date-time","description":"Only included when a scheduled time is stored"}}}}},"example":{"success":true,"message":"Post updated successfully","scheduledTime":null,"postGroup":{"_id":"507f1f77bcf86cd799439011","status":"draft","content":"Our spring collection is here.","platforms":["linkedin-ABC123"]}}}}},"400":{"description":"One of: invalid file input (INVALID_MEDIA_FILE, nothing downloaded); an\ninvalid post ID; a failed download or validation (`Media ingestion\nfailed` with per-URL `mediaResults`, nothing attached, and the\nidempotency key freed); a post that can no longer be edited\n(POST_NOT_EDITABLE); or a YouTube target connection that is no longer\nthe caller's (INVALID_PLATFORM_CONNECTION, downloaded file discarded).\n","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Error"},{"type":"object","properties":{"mediaResults":{"type":"array","description":"Present when ingestion failed: one entry per URL","items":{"type":"object","properties":{"url":{"type":"string"},"ok":{"type":"boolean"},"code":{"type":"string","example":"MEDIA_URL_HTTP_ERROR"},"error":{"type":"string"}}}}}}]},"examples":{"publishingParameter":{"summary":"A field other than file or fileName","value":{"error":"Only file and fileName are accepted; attaching media leaves the post in draft","code":"INVALID_MEDIA_FILE"}},"localPath":{"summary":"file sent as a string instead of a resolved file object","value":{"error":"file must be a file object with download_url and file_id, not a local path or base64 string","code":"INVALID_MEDIA_FILE"}},"unsafeUrl":{"summary":"download_url fails the media URL checks","value":{"error":"Only https:\/\/ media URLs are allowed (got http:\/\/)","code":"INVALID_MEDIA_FILE"}},"invalidPostGroupId":{"value":{"error":"Invalid post group ID"}},"downloadFailed":{"summary":"The temporary URL expired before Publora fetched it","value":{"error":"Media ingestion failed","mediaResults":[{"url":"https:\/\/files.example.com\/download\/abc123?signature=EXPIRED","ok":false,"code":"MEDIA_URL_HTTP_ERROR","error":"Fetching https:\/\/files.example.com\/download\/abc123?signature=EXPIRED returned HTTP 403"}]}},"notEditable":{"value":{"error":"Cannot update post: post is currently in published status","code":"POST_NOT_EDITABLE"}},"invalidPlatformConnection":{"summary":"A YouTube target connection is no longer the caller's","value":{"error":"Invalid platform connection(s): youtube-UCxxxxxxxxxxxx. Check connected accounts or call GET \/platform-connections.","code":"INVALID_PLATFORM_CONNECTION","invalidPlatforms":["youtube-UCxxxxxxxxxxxx"]}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Post not found or owned by another user","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Post group not found"}}}},"409":{"description":"Nothing was changed. Either a request with this `Idempotency-Key` is\nstill in flight, or the post is being published, or another write\ncommitted first. Match on `code`, and re-read the post with get-post\nbefore retrying.\n","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"inFlight":{"value":{"error":"A request with this idempotency key is still in flight","code":"IDEMPOTENCY_IN_FLIGHT"}},"publishInProgress":{"value":{"error":"Publishing has already started; media cannot be changed. Duplicate the post to recover its content.","code":"POST_PUBLISH_IN_PROGRESS"}},"versionConflict":{"value":{"error":"Post group state changed concurrently; please retry.","code":"POST_GROUP_VERSION_CONFLICT"}}}}}},"422":{"description":"This `Idempotency-Key` was already used for a different post, file ID\nor file name. Nothing was changed.\n","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Idempotency key was already used with a different request body","code":"IDEMPOTENCY_KEY_CONFLICT"}}}},"429":{"description":"Media URL ingestion rate limit reached (60 URLs per fixed one-hour window)","headers":{"Retry-After":{"description":"Seconds to wait before retrying","schema":{"type":"integer"}}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MediaUrlRateLimitError"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to update post"}}}}}}},"\/upload-instagram-cover":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Upload a custom Instagram Reel cover image","description":"Upload a cover image for an Instagram Reel. The image is stored as a\nJPEG (PNG\/WebP are transcoded server-side; transparency is flattened\nonto white) and a public URL is returned. Set that URL as\nplatformSettings.instagram.coverUrl via update-post to use it as the\nReel cover. The target post group must be an editable (draft or\nscheduled) post you own and not currently publishing.\nCovers apply to Reels only and are ignored for Stories and images.\n","operationId":"uploadInstagramCover","tags":["Media"],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","required":["cover","postGroupId"],"properties":{"cover":{"type":"string","format":"binary","description":"Cover image (JPEG, PNG, or WebP; 8 MB max). PNG\/WebP are converted to JPEG."},"postGroupId":{"type":"string","description":"Editable post group (draft or scheduled) to attach the cover to","example":"507f1f77bcf86cd799439011"}}}}}},"responses":{"200":{"description":"Cover uploaded","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"cover":{"type":"object","properties":{"mediaId":{"type":"string","description":"Cover media record ID","example":"665f8a1b2c3d4e5f6a7b8c9d"},"url":{"type":"string","format":"uri","description":"Public JPEG URL \u2014 set as platformSettings.instagram.coverUrl via update-post","example":"https:\/\/media.publora.com\/images\/665f...-reel-cover.jpg"}}},"message":{"type":"string"}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingPostGroupId":{"value":{"error":"postGroupId is required"}},"invalidPostGroupId":{"value":{"error":"Invalid postGroupId"}},"missingFile":{"value":{"error":"cover file is required"}},"badType":{"value":{"error":"Instagram covers must be JPEG, PNG, or WebP images"}},"tooLarge":{"value":{"error":"Instagram covers must be 8 MB or smaller"}},"tooLargeAfterTranscode":{"value":{"error":"Instagram cover exceeds 8 MB after JPEG conversion; use a smaller image"}},"nonEditable":{"value":{"error":"Cannot upload Instagram cover for a non-editable post"}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Post group not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Post group not found"}}}},"409":{"description":"Post group is currently publishing","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Post group is currently being published; cannot upload Instagram cover. Retry once publishing completes."}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to upload Instagram cover"}}}}}}},"\/upload-youtube-thumbnail":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Upload a custom YouTube video thumbnail","description":"Upload a custom thumbnail for a YouTube video post. The image is stored\nas Publora-tracked media and a mediaId + url are returned; attach them\nvia platformSettings.youtube.thumbnail on update-post. A thumbnail\ncannot be set on create-post \u2014 the upload requires an existing\npostGroupId (draft or scheduled) that is not currently publishing.\nJPEG or PNG, 2 MB max, minimum 640x360 px (1280x720 recommended).\n","operationId":"uploadYouTubeThumbnail","tags":["Media"],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","required":["thumbnail","postGroupId"],"properties":{"thumbnail":{"type":"string","format":"binary","description":"Thumbnail image (JPEG or PNG; 2 MB max; min 640x360 px, 1280x720 recommended)."},"postGroupId":{"type":"string","description":"Editable post group (draft or scheduled) to attach the thumbnail to","example":"507f1f77bcf86cd799439011"}}}}}},"responses":{"200":{"description":"Thumbnail uploaded","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"thumbnail":{"type":"object","properties":{"mediaId":{"type":"string","description":"Thumbnail media record ID \u2014 set as platformSettings.youtube.thumbnail.mediaId via update-post","example":"665f8a1b2c3d4e5f6a7b8c9d"},"url":{"type":"string","format":"uri","description":"Public thumbnail URL \u2014 set as platformSettings.youtube.thumbnail.url via update-post","example":"https:\/\/media.publora.com\/images\/665f...-thumb.jpg"}}}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingPostGroupId":{"value":{"error":"postGroupId is required"}},"invalidPostGroupId":{"value":{"error":"Invalid postGroupId"}},"missingFile":{"value":{"error":"thumbnail file is required"}},"badType":{"value":{"error":"YouTube thumbnails must be JPEG or PNG images"}},"tooLarge":{"value":{"error":"YouTube thumbnails must be 2 MB or smaller"}},"tooSmall":{"value":{"error":"YouTube thumbnails must be at least 640x360 pixels"}},"nonEditable":{"value":{"error":"Cannot upload YouTube thumbnail for a non-editable post"}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Post group not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Post group not found"}}}},"409":{"description":"Post group is currently publishing","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Post group is currently being published; cannot upload YouTube thumbnail. Retry once publishing completes."}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to upload YouTube thumbnail"}}}}}}},"\/post-statistics":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Get Mastodon and Bluesky post statistics","description":"Engagement counters for up to 50 published Mastodon or Bluesky posts. Values are\nread from the platform when requested and cached for about 2 hours; nothing is\ncollected in the background, so there is no history.\n\nOnly posts Publora published for the caller, and stored a `postedId` for, can be\nqueried; any other id is answered `null` without contacting the platform. Publora\nbegan storing `postedId` for these two platforms on 2026-09-07. For a thread, only\nthe root part is addressable.\n\nRequires a plan with analytics; otherwise `403 ANALYTICS_PLAN_REQUIRED`.\n","operationId":"getPlatformPostStatistics","tags":["Platform Analytics"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["posts"],"properties":{"posts":{"type":"array","minItems":1,"maxItems":50,"description":"One entry per post. Platforms and connections may be mixed.","items":{"type":"object","required":["platform","platformId","postedId"],"properties":{"platform":{"type":"string","enum":["mastodon","bluesky"]},"platformId":{"type":"string","maxLength":512,"description":"Connection ID, with or without the `<platform>-` prefix","example":"bluesky-did:plc:3xcxmi4aiok5zyghylsa4dzw"},"postedId":{"type":"string","maxLength":512,"description":"Bluesky AT-URI or Mastodon status ID","example":"at:\/\/did:plc:3xcxmi4aiok5zyghylsa4dzw\/app.bsky.feed.post\/3muxmedtwxd2k"}}}}}},"example":{"posts":[{"platform":"bluesky","platformId":"bluesky-did:plc:3xcxmi4aiok5zyghylsa4dzw","postedId":"at:\/\/did:plc:3xcxmi4aiok5zyghylsa4dzw\/app.bsky.feed.post\/3muxmedtwxd2k"},{"platform":"mastodon","platformId":"mastodon-110300915972205108","postedId":"117232239423110999"}]}}}},"responses":{"200":{"description":"Statistics retrieved. A `null` value in `stats` means \"no data right now\" \u2014\na deleted post, an id that is not one of the caller's published posts, or a\nconnection listed in `issues`.\n","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"stats":{"type":"object","description":"Keyed by postedId","additionalProperties":{"allOf":[{"$ref":"#\/components\/schemas\/PlatformPostMetrics"}],"nullable":true}},"rateLimited":{"type":"boolean","description":"Present only when a connection was in a rate-limit cooldown"},"issues":{"type":"object","description":"Present only when non-empty. Keyed by connection ID in the `<platform>-<platformId>` form.","additionalProperties":{"$ref":"#\/components\/schemas\/PlatformAnalyticsIssue"}}}},"example":{"success":true,"stats":{"at:\/\/did:plc:3xcxmi4aiok5zyghylsa4dzw\/app.bsky.feed.post\/3muxmedtwxd2k":{"reactions":42,"comments":3,"reposts":7,"quotes":1,"saves":2,"impressions":null,"reach":null,"clicks":null},"117232239423110999":null}}}}},"400":{"description":"Bad request - missing or invalid parameters","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingPosts":{"value":{"error":"posts array is required"}},"tooMany":{"value":{"error":"Maximum 50 posts per request"}},"badEntry":{"value":{"error":"Each post must have string platform, platformId and postedId"}}}}}},"403":{"description":"The plan does not include analytics","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Analytics requires a Pro or Premium plan","code":"ANALYTICS_PLAN_REQUIRED"}}}},"504":{"description":"The request exceeded its 90-second budget","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Analytics request timed out","code":"ANALYTICS_REQUEST_TIMEOUT"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to fetch post statistics"}}}}}}},"\/profile-statistics":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Get Mastodon and Bluesky profile statistics","description":"Followers, following and post count of one connected Mastodon or Bluesky account.\nCached for about 2 hours. Requires a plan with analytics.\n","operationId":"getPlatformProfileStatistics","tags":["Platform Analytics"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["platform","platformId"],"properties":{"platform":{"type":"string","enum":["mastodon","bluesky"]},"platformId":{"type":"string","maxLength":512,"description":"Connection ID, with or without the `<platform>-` prefix","example":"mastodon-110300915972205108"}}}}}},"responses":{"200":{"description":"Profile retrieved","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"profile":{"allOf":[{"$ref":"#\/components\/schemas\/PlatformProfileMetrics"}],"nullable":true,"description":"null when the account could not be read"},"cached":{"type":"boolean","description":"true when the answer came from the cache"},"fetchedAt":{"type":"string","format":"date-time","nullable":true},"rateLimited":{"type":"boolean","description":"Present only during a rate-limit cooldown"},"unavailable":{"type":"string","enum":["AUTH_REVOKED","FORBIDDEN"],"description":"Present only when the connection is marked unavailable for analytics"}}},"example":{"success":true,"profile":{"followers":1234,"following":321,"posts":987},"cached":true,"fetchedAt":"2026-09-08T09:00:00.000Z"}}}},"400":{"description":"Bad request - missing or invalid parameters","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"platform and platformId are required"}}}},"403":{"description":"The plan does not include analytics","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Analytics requires a Pro or Premium plan","code":"ANALYTICS_PLAN_REQUIRED"}}}},"404":{"description":"The connection is not the caller's","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"mastodon connection not found"}}}},"504":{"description":"The request exceeded its 90-second budget","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Analytics request timed out","code":"ANALYTICS_REQUEST_TIMEOUT"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to fetch profile statistics"}}}}}}},"\/linkedin-post-statistics":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Get LinkedIn post analytics","description":"Retrieve analytics for a LinkedIn post: impressions, reach, reactions, comments, reshares.\nResults are cached for 2 hours. Use queryTypes: \"ALL\" to get all 5 metrics at once.\n","operationId":"getLinkedInPostStatistics","tags":["LinkedIn Analytics"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["postedId","platformId"],"properties":{"postedId":{"type":"string","description":"LinkedIn URN or share ID","example":"urn:li:share:7123456789012345678"},"platformId":{"type":"string","description":"LinkedIn connection ID","example":"linkedin-Tz9W5i6ZYG"},"queryType":{"type":"string","enum":["IMPRESSION","MEMBERS_REACHED","RESHARE","REACTION","COMMENT"],"description":"Single metric to fetch"},"queryTypes":{"oneOf":[{"type":"array","items":{"type":"string","enum":["IMPRESSION","MEMBERS_REACHED","RESHARE","REACTION","COMMENT"]}},{"type":"string","enum":["ALL"]}],"description":"Multiple metrics or ALL","example":"ALL"}}}}}},"responses":{"200":{"description":"Statistics retrieved","content":{"application\/json":{"schema":{"oneOf":[{"type":"object","description":"Single metric response","properties":{"success":{"type":"boolean"},"count":{"type":"integer","example":1542},"cached":{"type":"boolean"}}},{"type":"object","description":"Multiple metrics response","properties":{"success":{"type":"boolean"},"metrics":{"type":"object","properties":{"IMPRESSION":{"type":"integer"},"MEMBERS_REACHED":{"type":"integer"},"RESHARE":{"type":"integer"},"REACTION":{"type":"integer"},"COMMENT":{"type":"integer"}}},"cached":{"type":"boolean"}}}]}}}},"400":{"description":"Bad request - missing or invalid parameters","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingFields":{"value":{"error":"postedId and platformId are required"}},"invalidQueryType":{"value":{"error":"Invalid queryType. Must be one of: IMPRESSION, MEMBERS_REACHED, RESHARE, REACTION, COMMENT"}}}}}},"404":{"description":"LinkedIn connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"LinkedIn connection not found"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to fetch LinkedIn post statistics"}}}}}}},"\/linkedin-account-statistics":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Get aggregated LinkedIn account analytics","description":"Get total metrics across all published LinkedIn posts for an account.","operationId":"getLinkedInAccountStatistics","tags":["LinkedIn Analytics"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["platformId"],"properties":{"platformId":{"type":"string","example":"linkedin-Tz9W5i6ZYG"},"queryType":{"type":"string","enum":["IMPRESSION","MEMBERS_REACHED","RESHARE","REACTION","COMMENT"],"description":"Single metric to fetch"},"queryTypes":{"oneOf":[{"type":"array","items":{"type":"string","enum":["IMPRESSION","MEMBERS_REACHED","RESHARE","REACTION","COMMENT"]}},{"type":"string","enum":["ALL"]}],"description":"Multiple metrics or ALL","example":"ALL"},"aggregation":{"type":"string","enum":["TOTAL","DAILY"],"default":"TOTAL","description":"Aggregation type: TOTAL (default) or DAILY"},"dateRange":{"type":"object","description":"Optional date range filter","properties":{"start":{"type":"object","properties":{"year":{"type":"integer"},"month":{"type":"integer"},"day":{"type":"integer"}}},"end":{"type":"object","properties":{"year":{"type":"integer"},"month":{"type":"integer"},"day":{"type":"integer"}}}}}}}}}},"responses":{"200":{"description":"Account statistics","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"metrics":{"type":"object","description":"Flexible object with dynamic metric keys (e.g., IMPRESSION, REACTION, etc.)","additionalProperties":{"type":"integer"}},"aggregation":{"type":"string","enum":["TOTAL","DAILY"]},"cached":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingPlatformId":{"value":{"error":"platformId is required"}},"invalidQueryType":{"value":{"error":"Invalid queryType"}},"invalidAggregation":{"value":{"error":"Invalid aggregation"}}}}}},"404":{"description":"LinkedIn connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Internal server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/linkedin-profile-summary":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Get LinkedIn profile summary","description":"Retrieve a summary of your LinkedIn profile analytics including follower counts\nand aggregated post engagement metrics. Optionally filter by date range to track\nfollower growth over a specific period.\n","operationId":"getLinkedInProfileSummary","tags":["LinkedIn Analytics"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["platformId"],"properties":{"platformId":{"type":"string","description":"LinkedIn connection ID (format: linkedin-{id})","example":"linkedin-Tz9W5i6ZYG"},"dateRange":{"type":"object","description":"Optional date range for filtering metrics and calculating follower growth","properties":{"start":{"type":"object","properties":{"year":{"type":"integer","example":2026},"month":{"type":"integer","example":1},"day":{"type":"integer","example":1}}},"end":{"type":"object","properties":{"year":{"type":"integer","example":2026},"month":{"type":"integer","example":1},"day":{"type":"integer","example":31}}}}}}}}}},"responses":{"200":{"description":"Profile summary retrieved","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"partialData":{"type":"boolean","description":"True if some data failed to fetch but partial results are available"},"profile":{"type":"object","properties":{"followers":{"type":"object","properties":{"total":{"type":"integer","description":"Total follower count","example":5000},"periodGrowth":{"type":"integer","description":"Follower growth during date range (only present when dateRange is provided)","example":150}}},"posts":{"type":"object","properties":{"totalImpressions":{"type":"integer","example":25000},"totalReactions":{"type":"integer","example":500},"totalComments":{"type":"integer","example":75},"totalReshares":{"type":"integer","example":30},"totalMembersReached":{"type":"integer","example":12000}}}}},"errors":{"type":"array","items":{"type":"object","required":["metric","error"],"properties":{"metric":{"type":"string"},"error":{"type":"string"}}},"description":"List of errors when partialData is true","example":[{"metric":"followers","error":"Failed to fetch followers"}]}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingPlatformId":{"value":{"error":"platformId is required"}},"invalidDateRange":{"value":{"error":"dateRange must be an object"}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"LinkedIn connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"LinkedIn connection not found"}}}},"500":{"description":"Unexpected error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"502":{"description":"All requests to LinkedIn failed","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Failed to fetch LinkedIn profile data"}}}}}}},"\/linkedin-followers":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Get LinkedIn follower statistics","description":"Retrieve follower statistics for your LinkedIn account.\nUse period=\"lifetime\" (default) for total follower count, or period=\"daily\" with a dateRange for daily growth data.\nResults are cached for improved performance.\n","operationId":"getLinkedInFollowers","tags":["LinkedIn Analytics"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["platformId"],"properties":{"platformId":{"type":"string","description":"LinkedIn connection ID","example":"linkedin-Tz9W5i6ZYG"},"period":{"type":"string","enum":["lifetime","daily"],"default":"lifetime","description":"Type of statistics to retrieve","example":"lifetime"},"dateRange":{"type":"object","description":"Required when period is 'daily'","properties":{"start":{"type":"object","properties":{"year":{"type":"integer","example":2024},"month":{"type":"integer","example":1},"day":{"type":"integer","example":1}}},"end":{"type":"object","properties":{"year":{"type":"integer","example":2024},"month":{"type":"integer","example":1},"day":{"type":"integer","example":31}}}}}}}}}},"responses":{"200":{"description":"Follower statistics retrieved","content":{"application\/json":{"schema":{"oneOf":[{"type":"object","description":"Lifetime response","properties":{"success":{"type":"boolean","example":true},"followersCount":{"type":"integer","example":1234},"cached":{"type":"boolean"}}},{"type":"object","description":"Daily response","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","example":"2024-01-15"},"count":{"type":"integer","example":10}}}},"totalGrowth":{"type":"integer","example":25},"cached":{"type":"boolean"}}}]}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingPlatformId":{"value":{"error":"platformId is required"}},"invalidPeriod":{"value":{"error":"Invalid period"}},"missingDateRange":{"value":{"error":"dateRange is required for daily period"}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"LinkedIn connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Failed to fetch statistics","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"fetchFailed":{"value":{"error":"Failed to fetch LinkedIn followers statistics"}}}}}}}}},"\/linkedin-reactions":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Add a reaction to a LinkedIn post","description":"React to a LinkedIn post with LIKE, PRAISE, EMPATHY, INTEREST, APPRECIATION, or ENTERTAINMENT.","operationId":"addLinkedInReaction","tags":["LinkedIn Analytics"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["postedId","reactionType","platformId"],"properties":{"postedId":{"type":"string","description":"LinkedIn URN (urn:li:share:*, urn:li:ugcPost:*, urn:li:activity:*)","example":"urn:li:share:7123456789012345678"},"reactionType":{"type":"string","enum":["LIKE","PRAISE","EMPATHY","INTEREST","APPRECIATION","ENTERTAINMENT"],"example":"LIKE"},"platformId":{"type":"string","example":"linkedin-Tz9W5i6ZYG"}}}}}},"responses":{"201":{"description":"Reaction added","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"reaction":{"type":"object","description":"Reaction details","properties":{"reactionType":{"type":"string","enum":["LIKE","PRAISE","EMPATHY","INTEREST","APPRECIATION","ENTERTAINMENT"]},"actor":{"type":"string","description":"LinkedIn member URN"},"object":{"type":"string","description":"LinkedIn post URN"}}},"urnTranslated":{"$ref":"#\/components\/schemas\/LinkedInUrnTranslation"}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingFields":{"value":{"error":"postedId, reactionType, and platformId are required"}},"invalidReactionType":{"value":{"error":"reactionType must be one of: LIKE, PRAISE, EMPATHY, INTEREST, APPRECIATION, ENTERTAINMENT"}}}}}},"404":{"description":"LinkedIn connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"409":{"description":"The requested reaction already exists","content":{"application\/json":{"schema":{"type":"object","required":["error","message","requestedReactionType"],"properties":{"error":{"type":"string","enum":["REACTION_ALREADY_EXISTS"]},"message":{"type":"string"},"requestedReactionType":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}},"delete":{"summary":"Remove a reaction from a LinkedIn post","description":"Remove your reaction from a LinkedIn post.\nParameters can be provided either as query parameters OR in the request body.\n","operationId":"removeLinkedInReaction","tags":["LinkedIn Analytics"],"parameters":[{"name":"postedId","in":"query","description":"LinkedIn URN (can also be provided in request body)","schema":{"type":"string"},"example":"urn:li:share:7123456789012345678"},{"name":"platformId","in":"query","description":"LinkedIn connection ID (can also be provided in request body)","schema":{"type":"string"},"example":"linkedin-Tz9W5i6ZYG"}],"requestBody":{"required":false,"description":"Alternative to query parameters - provide postedId and platformId in body","content":{"application\/json":{"schema":{"type":"object","properties":{"postedId":{"type":"string","description":"LinkedIn URN (urn:li:share:*, urn:li:ugcPost:*, urn:li:activity:*)","example":"urn:li:share:7123456789012345678"},"platformId":{"type":"string","example":"linkedin-Tz9W5i6ZYG"}}}}}},"responses":{"200":{"description":"Reaction removed","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"reaction":{"type":"object","description":"Details of the removed reaction","properties":{"reactionType":{"type":"string"},"actor":{"type":"string"},"object":{"type":"string"}}},"urnTranslated":{"$ref":"#\/components\/schemas\/LinkedInUrnTranslation"}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingFields":{"value":{"error":"postedId and platformId are required"}}}}}},"404":{"description":"LinkedIn connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Internal server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/linkedin-reshare":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Reshare an existing LinkedIn post","description":"Reshare (repost) an existing LinkedIn post to your own feed with optional commentary. Works for personal and company-page connections (authored as the member or the organization automatically).","operationId":"createLinkedInReshare","tags":["LinkedIn Analytics"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["platformId","parent"],"properties":{"platformId":{"type":"string","description":"LinkedIn connection ID","example":"linkedin-Tz9W5i6ZYG"},"parent":{"type":"string","description":"URN of the post to reshare (urn:li:share:* or urn:li:ugcPost:*)","example":"urn:li:share:7123456789012345678"},"commentary":{"type":"string","description":"Optional text added above the reshare (max 3000 characters)","example":"Great read \u2014 sharing with my network!"},"visibility":{"type":"string","enum":["PUBLIC","CONNECTIONS"],"default":"PUBLIC","description":"Optional visibility (case-insensitive). Defaults to PUBLIC. CONNECTIONS is personal-profile-only; organization\/company-page reshares must use PUBLIC.","example":"PUBLIC"}}}}}},"responses":{"201":{"description":"Reshare created","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"reshare":{"type":"object","description":"LinkedIn API response for the created reshare","properties":{"id":{"type":"string","description":"URN of the new reshare post","example":"urn:li:share:7123456789012345678"}}}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingFields":{"value":{"error":"platformId and parent are required"}},"invalidParent":{"value":{"error":"parent must be a valid LinkedIn post URN (urn:li:share:<id> or urn:li:ugcPost:<id>)"}},"commentaryTooLong":{"value":{"error":"commentary cannot exceed 3000 characters"}},"invalidVisibility":{"value":{"error":"visibility must be one of: PUBLIC, CONNECTIONS"}},"organizationConnectionsVisibility":{"value":{"error":"LinkedIn organization reposts cannot use CONNECTIONS visibility; choose PUBLIC"}},"missingOrganizationId":{"value":{"error":"LinkedIn company connection is missing organizationId. Please reconnect the LinkedIn page."}}}}}},"401":{"description":"Invalid API key or expired LinkedIn token","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"tokenExpired":{"value":{"error":"LINKEDIN_TOKEN_EXPIRED"}}}}}},"404":{"description":"LinkedIn connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Internal server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/linkedin-mentionables":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"get":{"summary":"List mentionable LinkedIn people","description":"List the LinkedIn members you can @mention \u2014 a per-user directory of native member ids captured automatically from engagement (comments and reactions) on connected company pages. Each entry includes a ready-to-paste mention token. Available on paid plans only.","operationId":"listLinkedInMentionables","tags":["LinkedIn Analytics"],"parameters":[{"name":"q","in":"query","required":false,"description":"Case-insensitive substring filter on the person's name (regex characters treated literally)","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of entries to return","schema":{"type":"integer","default":25,"minimum":1,"maximum":100}}],"responses":{"200":{"description":"Mentionable people, sorted by lastSeenAt descending","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"people":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string","description":"Native LinkedIn member id (the only id form usable in mentions)","example":"Dk968RHxiO"},"name":{"type":"string","example":"Daria Bulaeva"},"profileUrl":{"type":"string","description":"Currently always empty (reserved)","example":""},"profilePicture":{"type":"string","description":"Currently always empty (reserved)","example":""},"source":{"type":"string","enum":["comment","reaction"],"description":"How the person was last captured (most recent engagement wins)","example":"comment"},"lastSeenAt":{"type":"string","format":"date-time","example":"2026-07-16T10:00:00.000Z"},"mention":{"type":"string","nullable":true,"description":"Ready-to-paste mention token for post content or comment messages; null when no usable name is stored","example":"@{urn:li:person:Dk968RHxiO|Daria Bulaeva}"}}}}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"403":{"description":"API access not enabled, or plan does not include the mentionable-people directory","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"upgradeRequired":{"value":{"error":"The mentionable-people directory is available on paid plans \u2014 upgrade to access it","code":"UPGRADE_REQUIRED"}}}}}}}}},"\/list-posts":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"get":{"summary":"List posts with pagination and filters","description":"Retrieve a paginated list of all your scheduled, draft, published, and failed posts.\n\n**Pagination behavior:** The `page` and `limit` parameters are silently clamped to valid ranges\nrather than returning errors. `page` is clamped to a minimum of 1, and `limit` is clamped to 1-100.\n\n**Platform filtering:** The `platform` filter uses case-insensitive prefix matching.\n","operationId":"listPosts","tags":["Posts"],"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (1-indexed). Values < 1 are silently clamped to 1.","schema":{"type":"integer","default":1,"minimum":1}},{"name":"limit","in":"query","required":false,"description":"Items per page. Values are silently clamped to range 1-100.","schema":{"type":"integer","default":20,"minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"description":"Filter by post status","schema":{"type":"string","enum":["draft","scheduled","published","failed","partially_published"]}},{"name":"platform","in":"query","required":false,"description":"Filter by platform (case-insensitive prefix matching)","schema":{"type":"string","enum":["twitter","linkedin","instagram","threads","tiktok","youtube","facebook","bluesky","mastodon","telegram","pinterest"]}},{"name":"sortBy","in":"query","required":false,"description":"Field to sort by","schema":{"type":"string","enum":["createdAt","updatedAt","scheduledTime"],"default":"createdAt"}},{"name":"sortOrder","in":"query","required":false,"description":"Sort order","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"fromDate","in":"query","required":false,"description":"Filter posts scheduled after this ISO 8601 date","schema":{"type":"string","format":"date-time"}},{"name":"toDate","in":"query","required":false,"description":"Filter posts scheduled before this ISO 8601 date","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Paginated list of posts","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"posts":{"type":"array","items":{"type":"object","properties":{"postGroupId":{"type":"string","example":"507f1f77bcf86cd799439011"},"content":{"type":"string","example":"Excited to share our new product launch!"},"status":{"type":"string","enum":["draft","scheduled","published","failed","partially_published"]},"scheduledTime":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platforms":{"type":"array","items":{"type":"object","properties":{"platformId":{"type":"string"},"platform":{"type":"string"},"status":{"type":"string"}}}},"mediaUrls":{"type":"array","items":{"type":"string","format":"uri"}}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":1},"limit":{"type":"integer","example":20},"totalItems":{"type":"integer","example":47},"totalPages":{"type":"integer","example":3},"hasNextPage":{"type":"boolean","example":true},"hasPrevPage":{"type":"boolean","example":false}}}}}}}},"400":{"description":"Validation error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"invalidStatus":{"value":{"error":"Invalid status. Must be one of: draft, scheduled, published, failed, partially_published"}},"invalidSortBy":{"value":{"error":"Invalid sortBy. Must be one of: createdAt, updatedAt, scheduledTime"}},"invalidFromDate":{"value":{"error":"Invalid fromDate format"}},"invalidToDate":{"value":{"error":"Invalid toDate format"}}}}}},"401":{"description":"Invalid API key","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/test-connection\/{platformId}":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Test platform connection health","description":"Validate that a platform connection is working correctly.\nReturns token status, permissions, and last error if any.\n","operationId":"testConnection","tags":["Connections"],"parameters":[{"name":"platformId","in":"path","required":true,"description":"Platform connection ID (format: platform-id)","schema":{"type":"string"},"example":"linkedin-Tz9W5i6ZYG"}],"responses":{"200":{"description":"Connection test result","content":{"application\/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","example":"linkedin"},"platformId":{"type":"string","example":"linkedin-Tz9W5i6ZYG"},"username":{"type":"string","nullable":true,"description":"Connected account username. Null for a Telegram channel without a public username.","example":"John Doe"},"status":{"type":"string","enum":["ok","error"],"example":"ok"},"message":{"type":"string","example":"Connection is valid"},"permissions":{"type":"array","description":"YouTube update #490: Google's recorded full scope URIs, without expanding broad scopes. Empty when permissionsKnown is false.","items":{"type":"string"},"example":["w_member_social","r_basicprofile"]},"permissionsKnown":{"type":"boolean","description":"YouTube only, added in #490. True when the granted scopes are recorded; false means unknown, not permission denied."},"tokenExpiresIn":{"type":"string","nullable":true,"example":"29 days"},"lastSuccessfulPost":{"type":"string","format":"date-time","nullable":true},"lastError":{"$ref":"#\/components\/schemas\/ConnectionLastError"}}}}}},"400":{"description":"Invalid platformId format","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/post-logs\/{postGroupId}":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"get":{"summary":"Get post publishing logs","description":"Retrieve detailed logs for a post group showing the publishing process,\nincluding scheduling, processing, success, and failure events.\nReturns only events from the last 90 days by event createdAt, oldest first,\nlimited to 100 entries. An owned group without recent events returns HTTP\n200 with success: true and logs: []. Diagnostic log expiry does not delete\nthe post group or published post history.\n","operationId":"getPostLogs","tags":["Logs"],"parameters":[{"name":"postGroupId","in":"path","required":true,"schema":{"type":"string"},"example":"507f1f77bcf86cd799439011"}],"responses":{"200":{"description":"Post logs","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"logs":{"type":"array","description":"Events from the last 90 days by createdAt; may be empty.","minItems":0,"items":{"$ref":"#\/components\/schemas\/PostLog"}}}}}}},"400":{"description":"postGroupId is not a valid ObjectId","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"example":{"error":"Invalid post group ID"}}}},"404":{"description":"Post group not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/webhooks":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"get":{"summary":"List all webhooks","description":"Retrieve all webhooks configured for your account.","operationId":"listWebhooks","tags":["Webhooks"],"responses":{"200":{"description":"List of webhooks","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"webhooks":{"type":"array","items":{"$ref":"#\/components\/schemas\/Webhook"}}}}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}},"post":{"summary":"Create a webhook","description":"Create a new webhook endpoint. Maximum 10 webhooks per user.\nThe webhook secret is only returned on creation - save it securely.\n","operationId":"createWebhook","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["name","url","events"],"properties":{"name":{"type":"string","description":"Friendly name for the webhook","example":"Production webhook"},"url":{"type":"string","format":"uri","description":"HTTPS URL to receive webhook events","example":"https:\/\/example.com\/webhooks\/publora"},"events":{"type":"array","items":{"type":"string","enum":["post.scheduled","post.published","post.failed","post.demoted","token.expiring"]},"description":"Events to subscribe to. token.expiring is defined but not currently dispatched; post.demoted fires when a scheduled group is returned to draft: reason media_changed (changeType attach, detach, prune_reference or reorder), media_backstop (changeType scheduler_media_backstop) or state_mismatch (changeType scheduler_state_repair). Tolerate unknown changeType and reason values.","example":["post.published","post.failed"]}}}}}},"responses":{"201":{"description":"Webhook created","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"webhook":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"secret":{"type":"string","description":"Webhook secret for signature verification (only returned on create)"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingFields":{"value":{"error":"Name, URL, and at least one event are required"}},"invalidUrl":{"value":{"error":"URL must use HTTPS"}},"invalidEvents":{"value":{"error":"Invalid events"}},"limitReached":{"value":{"error":"Maximum of 10 webhooks per user"}}}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/webhooks\/{id}":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"patch":{"summary":"Update a webhook","description":"Update an existing webhook's name, URL, events, or active status.","operationId":"updateWebhook","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["post.scheduled","post.published","post.failed","post.demoted","token.expiring"],"description":"token.expiring is defined and subscribable but is not currently dispatched"}},"isActive":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Webhook updated","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"webhook":{"$ref":"#\/components\/schemas\/Webhook"}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Webhook not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}},"delete":{"summary":"Delete a webhook","description":"Delete a webhook endpoint.","operationId":"deleteWebhook","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook deleted","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"404":{"description":"Webhook not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/webhooks\/{id}\/regenerate-secret":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Regenerate webhook secret","description":"Generate a new secret for a webhook. The old secret will be invalidated.\nMake sure to update your webhook handler with the new secret.\n","operationId":"regenerateWebhookSecret","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Secret regenerated","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"secret":{"type":"string","description":"New webhook secret"}}}}}},"404":{"description":"Webhook not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/linkedin-comments":{"parameters":[{"$ref":"#\/components\/parameters\/XPubloraClient"}],"post":{"summary":"Add a comment to a LinkedIn post","description":"Post a comment on a LinkedIn post. Supports replies to existing comments\nvia the parentComment parameter. Raw input may be up to 10000 characters;\nafter mention processing, the text sent to LinkedIn must be at most 1250 characters.\nThe message string is required but may be empty with a non-blank imageUrl.\nEmpty or whitespace-only text without an image returns HTTP 400.\nSupports @mentions using @{urn:li:person:ID|Name} or @{urn:li:organization:ID|Company} syntax.\n","operationId":"createLinkedInComment","tags":["LinkedIn Analytics"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["postedId","message","platformId"],"anyOf":[{"properties":{"message":{"pattern":"\\S"}}},{"required":["imageUrl"],"properties":{"imageUrl":{"pattern":"\\S"}}}],"properties":{"postedId":{"type":"string","description":"LinkedIn post URN (urn:li:share:*, urn:li:ugcPost:*, or urn:li:activity:*). Activity URNs are attempted directly, with same-ID ugcPost\/share fallbacks for retryable LinkedIn target errors.","example":"urn:li:share:7123456789012345678"},"message":{"type":"string","description":"Required string; may be empty with imageUrl. Raw comment input (max 10000 characters); after mention conversion, the sent text is limited to 1250 characters. Supports @{urn:li:person:ID|Name} and organization mentions.","example":"Great insights @{urn:li:person:ACoAABcD1234EfG|Jane Smith}! Thanks for sharing."},"platformId":{"type":"string","description":"LinkedIn connection ID","example":"linkedin-Tz9W5i6ZYG"},"parentComment":{"type":"string","description":"Optional parent comment URN for replies","example":"urn:li:comment:(urn:li:activity:123,456)"},"imageUrl":{"type":"string","description":"Public HTTPS URL of one JPEG, PNG or GIF image (max 10 MB, fewer than 36152320 pixels, at most 250 GIF frames). Required for empty or whitespace-only message text. Upload must succeed before the comment is created.","example":"https:\/\/cdn.example.com\/reaction.png"}}},"examples":{"imageOnly":{"value":{"postedId":"urn:li:share:7123456789012345678","platformId":"linkedin-Tz9W5i6ZYG","message":"","imageUrl":"https:\/\/cdn.example.com\/reaction.png"}}}}}},"responses":{"201":{"description":"Comment created","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"comment":{"type":"object","properties":{"id":{"type":"string","description":"Comment URN"},"message":{"type":"string"},"imageUrn":{"type":"string","description":"LinkedIn image URN, present when an image is attached."},"actor":{"type":"string"},"object":{"type":"string"}}}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingFields":{"value":{"error":"postedId, message, and platformId are required"}},"invalidUrn":{"value":{"error":"postedId must be a valid LinkedIn URN"}},"emptyMessage":{"value":{"error":"message cannot be empty without imageUrl"}},"rawMessageTooLong":{"value":{"error":"comment text cannot exceed 10000 characters"}},"processedMessageTooLong":{"value":{"error":"comment text cannot exceed 1250 characters after mention processing"}}}}}},"404":{"description":"LinkedIn connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}},"delete":{"summary":"Delete a comment from a LinkedIn post","description":"Remove a comment from a LinkedIn post.\nParameters can be provided as query parameters or in the request body.\n","operationId":"deleteLinkedInComment","tags":["LinkedIn Analytics"],"parameters":[{"name":"postedId","in":"query","description":"LinkedIn post URN (can also be provided in request body)","schema":{"type":"string"},"example":"urn:li:share:7123456789012345678"},{"name":"commentId","in":"query","description":"Comment ID or URN (can also be provided in request body)","schema":{"type":"string"},"example":"6636062862760562688"},{"name":"platformId","in":"query","description":"LinkedIn connection ID (can also be provided in request body)","schema":{"type":"string"},"example":"linkedin-Tz9W5i6ZYG"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","properties":{"postedId":{"type":"string"},"commentId":{"type":"string"},"platformId":{"type":"string"}}}}}},"responses":{"200":{"description":"Comment deleted","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"deleted":{"type":"string","description":"Comment ID that was deleted"}}}}}},"400":{"description":"Invalid request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"},"examples":{"missingFields":{"value":{"error":"postedId, commentId, and platformId are required"}},"invalidUrn":{"value":{"error":"postedId must be a valid LinkedIn URN"}}}}}},"404":{"description":"LinkedIn connection not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"500":{"description":"Server error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}}}}