{"openapi":"3.1.0","info":{"title":"PostMantis API","version":"1.0.0","description":"Public API for publishing posts to already-connected social profiles. The dashboard handles profile connection, billing, and account administration. The API handles runtime publishing and media uploads for connected social platforms."},"servers":[{"url":"https://postmantis.com","description":"Current origin"}],"tags":[{"name":"Posts","description":"Create drafts, schedule posts, publish immediately, cancel scheduled work, and inspect per-delivery outcomes."},{"name":"Profiles","description":"List already-connected publishing profiles. Profile connection happens in the PostMantis dashboard; the API can explicitly disconnect a profile without deleting history."},{"name":"Uploads","description":"Create and complete direct upload sessions for private files before attaching them to posts."},{"name":"System","description":"Read runtime health for diagnostics and connectivity checks."}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key from the PostMantis dashboard."}},"schemas":{"UploadedMediaReference":{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"},"alt":{"type":"string","minLength":1,"maxLength":1000}},"required":["asset_id"],"additionalProperties":false},"RemoteMediaReference":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"alt":{"type":"string","minLength":1,"maxLength":1000}},"required":["url"],"additionalProperties":false},"AssetInput":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"PostMediaInput":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"},"alt":{"type":"string","minLength":1,"maxLength":1000}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"alt":{"type":"string","minLength":1,"maxLength":1000}},"required":["url"],"additionalProperties":false}]},"FacebookPlatformParams":{"type":"object","properties":{"format":{"type":"string","enum":["post","story"]},"page_id":{"type":"string","minLength":1},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"link":{"type":"string","minLength":1}},"additionalProperties":false},"InstagramPlatformParams":{"type":"object","properties":{"format":{"type":"string","enum":["post","reel","story"]},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"collaborators":{"type":"array","items":{"type":"string","minLength":1},"maxItems":3},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"audio_name":{"type":"string","minLength":1,"maxLength":255},"thumb_offset":{"type":"string","minLength":1},"trial_strategy":{"type":"string","enum":["MANUAL","SS_PERFORMANCE"]}},"additionalProperties":false},"TikTokPlatformParams":{"type":"object","properties":{"format":{"type":"string","enum":["video","image"]},"privacy_status":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"photo_cover_index":{"type":"integer","minimum":0},"auto_add_music":{"type":"boolean"},"made_with_ai":{"type":"boolean"},"disable_comment":{"type":"boolean"},"disable_duet":{"type":"boolean"},"disable_stitch":{"type":"boolean"},"brand_content_toggle":{"type":"boolean"},"brand_organic_toggle":{"type":"boolean"},"video_cover_timestamp_ms":{"type":"integer","minimum":0},"title":{"type":"string","minLength":1,"maxLength":90}},"additionalProperties":false},"LinkedInPlatformParams":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1}},"additionalProperties":false},"YouTubePlatformParams":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"privacy_status":{"type":"string","enum":["public","private","unlisted"]},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"made_for_kids":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50}},"additionalProperties":false},"XPlatformParams":{"type":"object","properties":{"who_can_reply":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"thread":{"type":"array","items":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":280}},"required":["body"],"additionalProperties":false},"minItems":1,"maxItems":24}},"additionalProperties":false},"ThreadsPlatformParams":{"type":"object","properties":{"reply_control":{"type":"string","enum":["everyone","accounts_you_follow","mentioned_only"]}},"additionalProperties":false},"PinterestPlatformParams":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"board_id":{"type":"string","minLength":1},"destination_link":{"type":"string","maxLength":2048,"format":"uri"},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"thumb_offset":{"type":"integer","minimum":0}},"required":["board_id"],"additionalProperties":false},"ProviderOptions":{"type":"object","properties":{"facebook":{"type":"object","properties":{"format":{"type":"string","enum":["post","story"]},"page_id":{"type":"string","minLength":1},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"link":{"type":"string","minLength":1}},"additionalProperties":false},"instagram":{"type":"object","properties":{"format":{"type":"string","enum":["post","reel","story"]},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"collaborators":{"type":"array","items":{"type":"string","minLength":1},"maxItems":3},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"audio_name":{"type":"string","minLength":1,"maxLength":255},"thumb_offset":{"type":"string","minLength":1},"trial_strategy":{"type":"string","enum":["MANUAL","SS_PERFORMANCE"]}},"additionalProperties":false},"tiktok":{"type":"object","properties":{"format":{"type":"string","enum":["video","image"]},"privacy_status":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"photo_cover_index":{"type":"integer","minimum":0},"auto_add_music":{"type":"boolean"},"made_with_ai":{"type":"boolean"},"disable_comment":{"type":"boolean"},"disable_duet":{"type":"boolean"},"disable_stitch":{"type":"boolean"},"brand_content_toggle":{"type":"boolean"},"brand_organic_toggle":{"type":"boolean"},"video_cover_timestamp_ms":{"type":"integer","minimum":0},"title":{"type":"string","minLength":1,"maxLength":90}},"additionalProperties":false},"linkedin":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1}},"additionalProperties":false},"youtube":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"privacy_status":{"type":"string","enum":["public","private","unlisted"]},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"made_for_kids":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50}},"additionalProperties":false},"x":{"type":"object","properties":{"who_can_reply":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"thread":{"type":"array","items":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":280}},"required":["body"],"additionalProperties":false},"minItems":1,"maxItems":24}},"additionalProperties":false},"threads":{"type":"object","properties":{"reply_control":{"type":"string","enum":["everyone","accounts_you_follow","mentioned_only"]}},"additionalProperties":false},"pinterest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"board_id":{"type":"string","minLength":1},"destination_link":{"type":"string","maxLength":2048,"format":"uri"},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"thumb_offset":{"type":"integer","minimum":0}},"required":["board_id"],"additionalProperties":false}},"additionalProperties":false},"PostStatus":{"type":"string","enum":["draft","pending","scheduled","completed","canceled"]},"DeliveryStatus":{"type":"string","enum":["pending","published","failed"]},"PostMedia":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processed","failed"]},"content_type":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"asset_id":{"type":["string","null"],"format":"uuid"},"alt":{"type":["string","null"]},"error_message":{"type":["string","null"]}},"required":["id","status","content_type","url","asset_id","alt","error_message"]},"PostDelivery":{"type":"object","properties":{"profile_id":{"type":["string","null"],"format":"uuid"},"provider":{"type":"string","enum":["facebook","instagram","tiktok","linkedin","youtube","x","threads","pinterest"]},"profile_name":{"type":"string"},"status":{"type":"string","enum":["pending","published","failed"]},"scheduled_at":{"type":["string","null"],"format":"date-time"},"published_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"},"provider_post_id":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"error_message":{"type":["string","null"]},"provider_options":{"type":["object","null"],"properties":{"facebook":{"type":"object","properties":{"format":{"type":"string","enum":["post","story"]},"page_id":{"type":"string","minLength":1},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"link":{"type":"string","minLength":1}},"additionalProperties":false},"instagram":{"type":"object","properties":{"format":{"type":"string","enum":["post","reel","story"]},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"collaborators":{"type":"array","items":{"type":"string","minLength":1},"maxItems":3},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"audio_name":{"type":"string","minLength":1,"maxLength":255},"thumb_offset":{"type":"string","minLength":1},"trial_strategy":{"type":"string","enum":["MANUAL","SS_PERFORMANCE"]}},"additionalProperties":false},"tiktok":{"type":"object","properties":{"format":{"type":"string","enum":["video","image"]},"privacy_status":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"photo_cover_index":{"type":"integer","minimum":0},"auto_add_music":{"type":"boolean"},"made_with_ai":{"type":"boolean"},"disable_comment":{"type":"boolean"},"disable_duet":{"type":"boolean"},"disable_stitch":{"type":"boolean"},"brand_content_toggle":{"type":"boolean"},"brand_organic_toggle":{"type":"boolean"},"video_cover_timestamp_ms":{"type":"integer","minimum":0},"title":{"type":"string","minLength":1,"maxLength":90}},"additionalProperties":false},"linkedin":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1}},"additionalProperties":false},"youtube":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"privacy_status":{"type":"string","enum":["public","private","unlisted"]},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"made_for_kids":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50}},"additionalProperties":false},"x":{"type":"object","properties":{"who_can_reply":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"thread":{"type":"array","items":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":280}},"required":["body"],"additionalProperties":false},"minItems":1,"maxItems":24}},"additionalProperties":false},"threads":{"type":"object","properties":{"reply_control":{"type":"string","enum":["everyone","accounts_you_follow","mentioned_only"]}},"additionalProperties":false},"pinterest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"board_id":{"type":"string","minLength":1},"destination_link":{"type":"string","maxLength":2048,"format":"uri"},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"thumb_offset":{"type":"integer","minimum":0}},"required":["board_id"],"additionalProperties":false}},"additionalProperties":false}},"required":["profile_id","provider","profile_name","status","scheduled_at","published_at","failed_at","provider_post_id","url","error_message"]},"Post":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"body":{"type":["string","null"]},"status":{"type":"string","enum":["draft","pending","scheduled","completed","canceled"]},"draft":{"type":"boolean"},"scheduled_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"canceled_at":{"type":["string","null"],"format":"date-time"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processed","failed"]},"content_type":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"asset_id":{"type":["string","null"],"format":"uuid"},"alt":{"type":["string","null"]},"error_message":{"type":["string","null"]}},"required":["id","status","content_type","url","asset_id","alt","error_message"]}},"deliveries":{"type":"array","items":{"type":"object","properties":{"profile_id":{"type":["string","null"],"format":"uuid"},"provider":{"type":"string","enum":["facebook","instagram","tiktok","linkedin","youtube","x","threads","pinterest"]},"profile_name":{"type":"string"},"status":{"type":"string","enum":["pending","published","failed"]},"scheduled_at":{"type":["string","null"],"format":"date-time"},"published_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"},"provider_post_id":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"error_message":{"type":["string","null"]},"provider_options":{"type":["object","null"],"properties":{"facebook":{"type":"object","properties":{"format":{"type":"string","enum":["post","story"]},"page_id":{"type":"string","minLength":1},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"link":{"type":"string","minLength":1}},"additionalProperties":false},"instagram":{"type":"object","properties":{"format":{"type":"string","enum":["post","reel","story"]},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"collaborators":{"type":"array","items":{"type":"string","minLength":1},"maxItems":3},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"audio_name":{"type":"string","minLength":1,"maxLength":255},"thumb_offset":{"type":"string","minLength":1},"trial_strategy":{"type":"string","enum":["MANUAL","SS_PERFORMANCE"]}},"additionalProperties":false},"tiktok":{"type":"object","properties":{"format":{"type":"string","enum":["video","image"]},"privacy_status":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"photo_cover_index":{"type":"integer","minimum":0},"auto_add_music":{"type":"boolean"},"made_with_ai":{"type":"boolean"},"disable_comment":{"type":"boolean"},"disable_duet":{"type":"boolean"},"disable_stitch":{"type":"boolean"},"brand_content_toggle":{"type":"boolean"},"brand_organic_toggle":{"type":"boolean"},"video_cover_timestamp_ms":{"type":"integer","minimum":0},"title":{"type":"string","minLength":1,"maxLength":90}},"additionalProperties":false},"linkedin":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1}},"additionalProperties":false},"youtube":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"privacy_status":{"type":"string","enum":["public","private","unlisted"]},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"made_for_kids":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50}},"additionalProperties":false},"x":{"type":"object","properties":{"who_can_reply":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"thread":{"type":"array","items":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":280}},"required":["body"],"additionalProperties":false},"minItems":1,"maxItems":24}},"additionalProperties":false},"threads":{"type":"object","properties":{"reply_control":{"type":"string","enum":["everyone","accounts_you_follow","mentioned_only"]}},"additionalProperties":false},"pinterest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"board_id":{"type":"string","minLength":1},"destination_link":{"type":"string","maxLength":2048,"format":"uri"},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"thumb_offset":{"type":"integer","minimum":0}},"required":["board_id"],"additionalProperties":false}},"additionalProperties":false}},"required":["profile_id","provider","profile_name","status","scheduled_at","published_at","failed_at","provider_post_id","url","error_message"]}}},"required":["id","body","status","draft","scheduled_at","created_at","updated_at","canceled_at","media","deliveries"]},"Profile":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"provider":{"type":"string","enum":["facebook","instagram","tiktok","linkedin","youtube","x","threads","pinterest"]},"status":{"type":"string","enum":["active","reauth_required","disconnected"]},"username":{"type":["string","null"]},"picture_url":{"type":["string","null"],"format":"uri"},"expires_at":{"type":["string","null"],"format":"date-time"},"posts_count":{"type":"integer","minimum":0},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","provider","status","username","picture_url","expires_at","posts_count","created_at","updated_at"]},"MediaAsset":{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","completed","failed"]},"filename":{"type":"string"},"content_type":{"type":"string"},"size_bytes":{"type":"integer","exclusiveMinimum":0},"upload_url":{"type":["string","null"],"format":"uri"},"upload_method":{"type":["string","null"],"enum":["PUT"]},"upload_headers":{"type":"object","additionalProperties":{"type":"string"}},"expires_at":{"type":["string","null"],"format":"date-time"},"url":{"type":["string","null"],"format":"uri"},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}},"required":["asset_id","status","filename","content_type","size_bytes","upload_url","upload_method","upload_headers","expires_at","url","created_at","completed_at"]},"Pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":0},"per_page":{"type":"integer","exclusiveMinimum":0},"total":{"type":"integer","minimum":0}},"required":["page","per_page","total"]},"CreatePostRequest":{"type":"object","properties":{"post":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000},"scheduled_at":{"type":"string","format":"date-time"},"draft":{"type":"boolean"}},"additionalProperties":false},"profiles":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1},"media":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"},"alt":{"type":"string","minLength":1,"maxLength":1000}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"alt":{"type":"string","minLength":1,"maxLength":1000}},"required":["url"],"additionalProperties":false}]},"minItems":1,"maxItems":20},"provider_options":{"type":"object","properties":{"facebook":{"type":"object","properties":{"format":{"type":"string","enum":["post","story"]},"page_id":{"type":"string","minLength":1},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"link":{"type":"string","minLength":1}},"additionalProperties":false},"instagram":{"type":"object","properties":{"format":{"type":"string","enum":["post","reel","story"]},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"collaborators":{"type":"array","items":{"type":"string","minLength":1},"maxItems":3},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"audio_name":{"type":"string","minLength":1,"maxLength":255},"thumb_offset":{"type":"string","minLength":1},"trial_strategy":{"type":"string","enum":["MANUAL","SS_PERFORMANCE"]}},"additionalProperties":false},"tiktok":{"type":"object","properties":{"format":{"type":"string","enum":["video","image"]},"privacy_status":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"photo_cover_index":{"type":"integer","minimum":0},"auto_add_music":{"type":"boolean"},"made_with_ai":{"type":"boolean"},"disable_comment":{"type":"boolean"},"disable_duet":{"type":"boolean"},"disable_stitch":{"type":"boolean"},"brand_content_toggle":{"type":"boolean"},"brand_organic_toggle":{"type":"boolean"},"video_cover_timestamp_ms":{"type":"integer","minimum":0},"title":{"type":"string","minLength":1,"maxLength":90}},"additionalProperties":false},"linkedin":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1}},"additionalProperties":false},"youtube":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"privacy_status":{"type":"string","enum":["public","private","unlisted"]},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"made_for_kids":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50}},"additionalProperties":false},"x":{"type":"object","properties":{"who_can_reply":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"thread":{"type":"array","items":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":280}},"required":["body"],"additionalProperties":false},"minItems":1,"maxItems":24}},"additionalProperties":false},"threads":{"type":"object","properties":{"reply_control":{"type":"string","enum":["everyone","accounts_you_follow","mentioned_only"]}},"additionalProperties":false},"pinterest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"board_id":{"type":"string","minLength":1},"destination_link":{"type":"string","maxLength":2048,"format":"uri"},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"thumb_offset":{"type":"integer","minimum":0}},"required":["board_id"],"additionalProperties":false}},"additionalProperties":false}},"required":["post","profiles"],"additionalProperties":false},"UpdatePostRequest":{"type":"object","properties":{"post":{"type":"object","properties":{"body":{"type":["string","null"],"minLength":1,"maxLength":5000},"scheduled_at":{"type":["string","null"],"format":"date-time"},"draft":{"type":"boolean"}},"additionalProperties":false},"profiles":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1},"media":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"},"alt":{"type":"string","minLength":1,"maxLength":1000}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"alt":{"type":"string","minLength":1,"maxLength":1000}},"required":["url"],"additionalProperties":false}]},"minItems":1,"maxItems":20},"provider_options":{"type":"object","properties":{"facebook":{"type":"object","properties":{"format":{"type":"string","enum":["post","story"]},"page_id":{"type":"string","minLength":1},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"link":{"type":"string","minLength":1}},"additionalProperties":false},"instagram":{"type":"object","properties":{"format":{"type":"string","enum":["post","reel","story"]},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"collaborators":{"type":"array","items":{"type":"string","minLength":1},"maxItems":3},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"audio_name":{"type":"string","minLength":1,"maxLength":255},"thumb_offset":{"type":"string","minLength":1},"trial_strategy":{"type":"string","enum":["MANUAL","SS_PERFORMANCE"]}},"additionalProperties":false},"tiktok":{"type":"object","properties":{"format":{"type":"string","enum":["video","image"]},"privacy_status":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"photo_cover_index":{"type":"integer","minimum":0},"auto_add_music":{"type":"boolean"},"made_with_ai":{"type":"boolean"},"disable_comment":{"type":"boolean"},"disable_duet":{"type":"boolean"},"disable_stitch":{"type":"boolean"},"brand_content_toggle":{"type":"boolean"},"brand_organic_toggle":{"type":"boolean"},"video_cover_timestamp_ms":{"type":"integer","minimum":0},"title":{"type":"string","minLength":1,"maxLength":90}},"additionalProperties":false},"linkedin":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1}},"additionalProperties":false},"youtube":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"privacy_status":{"type":"string","enum":["public","private","unlisted"]},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"made_for_kids":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50}},"additionalProperties":false},"x":{"type":"object","properties":{"who_can_reply":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"thread":{"type":"array","items":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":280}},"required":["body"],"additionalProperties":false},"minItems":1,"maxItems":24}},"additionalProperties":false},"threads":{"type":"object","properties":{"reply_control":{"type":"string","enum":["everyone","accounts_you_follow","mentioned_only"]}},"additionalProperties":false},"pinterest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"board_id":{"type":"string","minLength":1},"destination_link":{"type":"string","maxLength":2048,"format":"uri"},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"thumb_offset":{"type":"integer","minimum":0}},"required":["board_id"],"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false},"CreatePostMultipartRequest":{"type":"object","properties":{"post[body]":{"type":"string","minLength":1,"maxLength":5000},"post[scheduled_at]":{"type":"string","format":"date-time"},"post[draft]":{"type":"boolean"},"profiles[]":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1},"media[0][file]":{"type":"string","format":"binary","description":"Binary file contents uploaded directly in a multipart request."},"media[0][alt]":{"type":"string","minLength":1,"maxLength":1000},"media[0][url]":{"type":"string","format":"uri"},"media[0][asset_id]":{"type":"string","format":"uuid"},"provider_options[facebook][format]":{"type":"string","enum":["post","reel","story"]},"provider_options[facebook][page_id]":{"type":"string","minLength":1},"provider_options[facebook][title]":{"type":"string","minLength":1,"maxLength":100},"provider_options[instagram][format]":{"type":"string","enum":["post","reel","story"]},"provider_options[instagram][collaborators][]":{"type":"array","items":{"type":"string","minLength":1},"maxItems":10},"provider_options[instagram][cover][file]":{"type":"string","format":"binary","description":"Binary file contents uploaded directly in a multipart request."},"provider_options[instagram][cover][url]":{"type":"string","format":"uri"},"provider_options[instagram][cover][asset_id]":{"type":"string","format":"uuid"},"provider_options[instagram][audio_name]":{"type":"string","minLength":1,"maxLength":255},"provider_options[instagram][thumb_offset]":{"type":"string","minLength":1},"provider_options[tiktok][format]":{"type":"string","enum":["video","image"]},"provider_options[tiktok][privacy_status]":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"provider_options[tiktok][photo_cover_index]":{"type":"integer","minimum":0},"provider_options[tiktok][auto_add_music]":{"type":"boolean"},"provider_options[tiktok][made_with_ai]":{"type":"boolean"},"provider_options[tiktok][disable_duet]":{"type":"boolean"},"provider_options[tiktok][disable_stitch]":{"type":"boolean"},"provider_options[tiktok][brand_content_toggle]":{"type":"boolean"},"provider_options[tiktok][brand_organic_toggle]":{"type":"boolean"},"provider_options[linkedin][organization_id]":{"type":"string","minLength":1},"provider_options[youtube][title]":{"type":"string","minLength":1,"maxLength":100},"provider_options[youtube][privacy_status]":{"type":"string","enum":["public","private","unlisted"]},"provider_options[youtube][cover][file]":{"type":"string","format":"binary","description":"Binary file contents uploaded directly in a multipart request."},"provider_options[youtube][cover][url]":{"type":"string","format":"uri"},"provider_options[youtube][cover][asset_id]":{"type":"string","format":"uuid"},"provider_options[youtube][made_for_kids]":{"type":"boolean"},"provider_options[youtube][tags][]":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50},"provider_options[x][who_can_reply]":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"provider_options[pinterest][title]":{"type":"string","minLength":1,"maxLength":100},"provider_options[pinterest][board_id]":{"type":"string","minLength":1},"provider_options[pinterest][destination_link]":{"type":"string","format":"uri"},"provider_options[pinterest][cover][file]":{"type":"string","format":"binary","description":"Binary file contents uploaded directly in a multipart request."},"provider_options[pinterest][cover][url]":{"type":"string","format":"uri"},"provider_options[pinterest][cover][asset_id]":{"type":"string","format":"uuid"},"provider_options[pinterest][thumb_offset]":{"type":"integer","minimum":0}},"required":["profiles[]"],"description":"Multipart create-post request using bracket notation."},"UpdatePostMultipartRequest":{"type":"object","properties":{"post[body]":{"type":"string","minLength":1,"maxLength":5000},"post[scheduled_at]":{"type":"string","format":"date-time"},"post[draft]":{"type":"boolean"},"profiles[]":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1},"media[0][file]":{"type":"string","format":"binary","description":"Binary file contents uploaded directly in a multipart request."},"media[0][alt]":{"type":"string","minLength":1,"maxLength":1000},"media[0][url]":{"type":"string","format":"uri"},"media[0][asset_id]":{"type":"string","format":"uuid"},"provider_options[facebook][format]":{"type":"string","enum":["post","reel","story"]},"provider_options[facebook][page_id]":{"type":"string","minLength":1},"provider_options[facebook][title]":{"type":"string","minLength":1,"maxLength":100},"provider_options[instagram][format]":{"type":"string","enum":["post","reel","story"]},"provider_options[instagram][collaborators][]":{"type":"array","items":{"type":"string","minLength":1},"maxItems":10},"provider_options[instagram][cover][file]":{"type":"string","format":"binary","description":"Binary file contents uploaded directly in a multipart request."},"provider_options[instagram][cover][url]":{"type":"string","format":"uri"},"provider_options[instagram][cover][asset_id]":{"type":"string","format":"uuid"},"provider_options[instagram][audio_name]":{"type":"string","minLength":1,"maxLength":255},"provider_options[instagram][thumb_offset]":{"type":"string","minLength":1},"provider_options[tiktok][format]":{"type":"string","enum":["video","image"]},"provider_options[tiktok][privacy_status]":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"provider_options[tiktok][photo_cover_index]":{"type":"integer","minimum":0},"provider_options[tiktok][auto_add_music]":{"type":"boolean"},"provider_options[tiktok][made_with_ai]":{"type":"boolean"},"provider_options[tiktok][disable_duet]":{"type":"boolean"},"provider_options[tiktok][disable_stitch]":{"type":"boolean"},"provider_options[tiktok][brand_content_toggle]":{"type":"boolean"},"provider_options[tiktok][brand_organic_toggle]":{"type":"boolean"},"provider_options[linkedin][organization_id]":{"type":"string","minLength":1},"provider_options[youtube][title]":{"type":"string","minLength":1,"maxLength":100},"provider_options[youtube][privacy_status]":{"type":"string","enum":["public","private","unlisted"]},"provider_options[youtube][cover][file]":{"type":"string","format":"binary","description":"Binary file contents uploaded directly in a multipart request."},"provider_options[youtube][cover][url]":{"type":"string","format":"uri"},"provider_options[youtube][cover][asset_id]":{"type":"string","format":"uuid"},"provider_options[youtube][made_for_kids]":{"type":"boolean"},"provider_options[youtube][tags][]":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50},"provider_options[x][who_can_reply]":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"provider_options[pinterest][title]":{"type":"string","minLength":1,"maxLength":100},"provider_options[pinterest][board_id]":{"type":"string","minLength":1},"provider_options[pinterest][destination_link]":{"type":"string","format":"uri"},"provider_options[pinterest][cover][file]":{"type":"string","format":"binary","description":"Binary file contents uploaded directly in a multipart request."},"provider_options[pinterest][cover][url]":{"type":"string","format":"uri"},"provider_options[pinterest][cover][asset_id]":{"type":"string","format":"uuid"},"provider_options[pinterest][thumb_offset]":{"type":"integer","minimum":0}},"description":"Multipart update-post request using bracket notation."},"PublishDraftRequest":{"type":"object","properties":{"scheduled_at":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"ListPostsQuery":{"type":"object","properties":{"status":{"type":"string","enum":["draft","pending","scheduled","completed","canceled"]},"profile_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"providers":{"type":"array","items":{"type":"string","enum":["facebook","instagram","tiktok","linkedin","youtube","x","threads","pinterest"]}},"scheduled_after":{"type":"string","format":"date-time"},"scheduled_before":{"type":"string","format":"date-time"},"page":{"type":["integer","null"],"minimum":0,"default":0},"per_page":{"type":"integer","minimum":1,"maximum":100,"default":20}}},"PostEnvelope":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"body":{"type":["string","null"]},"status":{"type":"string","enum":["draft","pending","scheduled","completed","canceled"]},"draft":{"type":"boolean"},"scheduled_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"canceled_at":{"type":["string","null"],"format":"date-time"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processed","failed"]},"content_type":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"asset_id":{"type":["string","null"],"format":"uuid"},"alt":{"type":["string","null"]},"error_message":{"type":["string","null"]}},"required":["id","status","content_type","url","asset_id","alt","error_message"]}},"deliveries":{"type":"array","items":{"type":"object","properties":{"profile_id":{"type":["string","null"],"format":"uuid"},"provider":{"type":"string","enum":["facebook","instagram","tiktok","linkedin","youtube","x","threads","pinterest"]},"profile_name":{"type":"string"},"status":{"type":"string","enum":["pending","published","failed"]},"scheduled_at":{"type":["string","null"],"format":"date-time"},"published_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"},"provider_post_id":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"error_message":{"type":["string","null"]},"provider_options":{"type":["object","null"],"properties":{"facebook":{"type":"object","properties":{"format":{"type":"string","enum":["post","story"]},"page_id":{"type":"string","minLength":1},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"link":{"type":"string","minLength":1}},"additionalProperties":false},"instagram":{"type":"object","properties":{"format":{"type":"string","enum":["post","reel","story"]},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"collaborators":{"type":"array","items":{"type":"string","minLength":1},"maxItems":3},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"audio_name":{"type":"string","minLength":1,"maxLength":255},"thumb_offset":{"type":"string","minLength":1},"trial_strategy":{"type":"string","enum":["MANUAL","SS_PERFORMANCE"]}},"additionalProperties":false},"tiktok":{"type":"object","properties":{"format":{"type":"string","enum":["video","image"]},"privacy_status":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"photo_cover_index":{"type":"integer","minimum":0},"auto_add_music":{"type":"boolean"},"made_with_ai":{"type":"boolean"},"disable_comment":{"type":"boolean"},"disable_duet":{"type":"boolean"},"disable_stitch":{"type":"boolean"},"brand_content_toggle":{"type":"boolean"},"brand_organic_toggle":{"type":"boolean"},"video_cover_timestamp_ms":{"type":"integer","minimum":0},"title":{"type":"string","minLength":1,"maxLength":90}},"additionalProperties":false},"linkedin":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1}},"additionalProperties":false},"youtube":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"privacy_status":{"type":"string","enum":["public","private","unlisted"]},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"made_for_kids":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50}},"additionalProperties":false},"x":{"type":"object","properties":{"who_can_reply":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"thread":{"type":"array","items":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":280}},"required":["body"],"additionalProperties":false},"minItems":1,"maxItems":24}},"additionalProperties":false},"threads":{"type":"object","properties":{"reply_control":{"type":"string","enum":["everyone","accounts_you_follow","mentioned_only"]}},"additionalProperties":false},"pinterest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"board_id":{"type":"string","minLength":1},"destination_link":{"type":"string","maxLength":2048,"format":"uri"},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"thumb_offset":{"type":"integer","minimum":0}},"required":["board_id"],"additionalProperties":false}},"additionalProperties":false}},"required":["profile_id","provider","profile_name","status","scheduled_at","published_at","failed_at","provider_post_id","url","error_message"]}}},"required":["id","body","status","draft","scheduled_at","created_at","updated_at","canceled_at","media","deliveries"]}},"required":["data"]},"PaginatedPostsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"body":{"type":["string","null"]},"status":{"type":"string","enum":["draft","pending","scheduled","completed","canceled"]},"draft":{"type":"boolean"},"scheduled_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"canceled_at":{"type":["string","null"],"format":"date-time"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processed","failed"]},"content_type":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"asset_id":{"type":["string","null"],"format":"uuid"},"alt":{"type":["string","null"]},"error_message":{"type":["string","null"]}},"required":["id","status","content_type","url","asset_id","alt","error_message"]}},"deliveries":{"type":"array","items":{"type":"object","properties":{"profile_id":{"type":["string","null"],"format":"uuid"},"provider":{"type":"string","enum":["facebook","instagram","tiktok","linkedin","youtube","x","threads","pinterest"]},"profile_name":{"type":"string"},"status":{"type":"string","enum":["pending","published","failed"]},"scheduled_at":{"type":["string","null"],"format":"date-time"},"published_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"},"provider_post_id":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"error_message":{"type":["string","null"]},"provider_options":{"type":["object","null"],"properties":{"facebook":{"type":"object","properties":{"format":{"type":"string","enum":["post","story"]},"page_id":{"type":"string","minLength":1},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"link":{"type":"string","minLength":1}},"additionalProperties":false},"instagram":{"type":"object","properties":{"format":{"type":"string","enum":["post","reel","story"]},"first_comment":{"type":"string","minLength":1,"maxLength":2200},"collaborators":{"type":"array","items":{"type":"string","minLength":1},"maxItems":3},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"audio_name":{"type":"string","minLength":1,"maxLength":255},"thumb_offset":{"type":"string","minLength":1},"trial_strategy":{"type":"string","enum":["MANUAL","SS_PERFORMANCE"]}},"additionalProperties":false},"tiktok":{"type":"object","properties":{"format":{"type":"string","enum":["video","image"]},"privacy_status":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"photo_cover_index":{"type":"integer","minimum":0},"auto_add_music":{"type":"boolean"},"made_with_ai":{"type":"boolean"},"disable_comment":{"type":"boolean"},"disable_duet":{"type":"boolean"},"disable_stitch":{"type":"boolean"},"brand_content_toggle":{"type":"boolean"},"brand_organic_toggle":{"type":"boolean"},"video_cover_timestamp_ms":{"type":"integer","minimum":0},"title":{"type":"string","minLength":1,"maxLength":90}},"additionalProperties":false},"linkedin":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1}},"additionalProperties":false},"youtube":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"privacy_status":{"type":"string","enum":["public","private","unlisted"]},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"made_for_kids":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50}},"additionalProperties":false},"x":{"type":"object","properties":{"who_can_reply":{"type":"string","enum":["everyone","following","mentioned_users","subscribers"]},"thread":{"type":"array","items":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":280}},"required":["body"],"additionalProperties":false},"minItems":1,"maxItems":24}},"additionalProperties":false},"threads":{"type":"object","properties":{"reply_control":{"type":"string","enum":["everyone","accounts_you_follow","mentioned_only"]}},"additionalProperties":false},"pinterest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"board_id":{"type":"string","minLength":1},"destination_link":{"type":"string","maxLength":2048,"format":"uri"},"cover":{"anyOf":[{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"}},"required":["asset_id"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"thumb_offset":{"type":"integer","minimum":0}},"required":["board_id"],"additionalProperties":false}},"additionalProperties":false}},"required":["profile_id","provider","profile_name","status","scheduled_at","published_at","failed_at","provider_post_id","url","error_message"]}}},"required":["id","body","status","draft","scheduled_at","created_at","updated_at","canceled_at","media","deliveries"]}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":0},"per_page":{"type":"integer","exclusiveMinimum":0},"total":{"type":"integer","minimum":0}},"required":["page","per_page","total"]}},"required":["data","pagination"]},"ProfileEnvelope":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"provider":{"type":"string","enum":["facebook","instagram","tiktok","linkedin","youtube","x","threads","pinterest"]},"status":{"type":"string","enum":["active","reauth_required","disconnected"]},"username":{"type":["string","null"]},"picture_url":{"type":["string","null"],"format":"uri"},"expires_at":{"type":["string","null"],"format":"date-time"},"posts_count":{"type":"integer","minimum":0},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","provider","status","username","picture_url","expires_at","posts_count","created_at","updated_at"]}},"required":["data"]},"ProfilesListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"provider":{"type":"string","enum":["facebook","instagram","tiktok","linkedin","youtube","x","threads","pinterest"]},"status":{"type":"string","enum":["active","reauth_required","disconnected"]},"username":{"type":["string","null"]},"picture_url":{"type":["string","null"],"format":"uri"},"expires_at":{"type":["string","null"],"format":"date-time"},"posts_count":{"type":"integer","minimum":0},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","provider","status","username","picture_url","expires_at","posts_count","created_at","updated_at"]}}},"required":["data"]},"MediaAssetCreateRequest":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":1,"maxLength":255},"size_bytes":{"type":"integer","exclusiveMinimum":0,"maximum":1073741824}},"required":["filename","content_type","size_bytes"],"additionalProperties":false},"MediaAssetCompleteRequest":{"type":"object","properties":{},"additionalProperties":false},"MediaAssetEnvelope":{"type":"object","properties":{"data":{"type":"object","properties":{"asset_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","completed","failed"]},"filename":{"type":"string"},"content_type":{"type":"string"},"size_bytes":{"type":"integer","exclusiveMinimum":0},"upload_url":{"type":["string","null"],"format":"uri"},"upload_method":{"type":["string","null"],"enum":["PUT"]},"upload_headers":{"type":"object","additionalProperties":{"type":"string"}},"expires_at":{"type":["string","null"],"format":"date-time"},"url":{"type":["string","null"],"format":"uri"},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}},"required":["asset_id","status","filename","content_type","size_bytes","upload_url","upload_method","upload_headers","expires_at","url","created_at","completed_at"]}},"required":["data"]},"SystemHealthResponse":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"uptime":{"type":"number","minimum":0},"processRole":{"type":"string","enum":["web"]},"database":{"type":"object","properties":{"status":{"type":"string","enum":["ok","error","unknown"]},"responseTime":{"type":"number","minimum":0}},"required":["status","responseTime"]},"cache":{"type":"object","properties":{"status":{"type":"string","enum":["ok","error","unknown"]},"responseTime":{"type":"number","minimum":0}},"required":["status","responseTime"]},"storage":{"type":"object","properties":{"status":{"type":"string","enum":["ok","error","unknown"]},"responseTime":{"type":"number","minimum":0}},"required":["status","responseTime"]},"durableExecution":{"type":"object","properties":{"status":{"type":"string","enum":["ok","error","unknown"]},"responseTime":{"type":"number","minimum":0},"queues":{"type":"array","items":{"type":"string"}}},"required":["status","responseTime"]},"status":{"type":"string","enum":["ok","degraded"]}},"required":["timestamp","uptime","processRole","database","cache","storage","durableExecution","status"]},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","exclusiveMinimum":0},"detail":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","detail","code"],"additionalProperties":false},"RateLimitExceeded":{"type":"object","properties":{"error":{"type":"string","enum":["Too Many Requests"]}},"required":["error"]}},"parameters":{}},"paths":{"/api/health":{"get":{"tags":["System"],"operationId":"getHealth","summary":"Read runtime health","description":"Returns coarse runtime health for the current deployment, including database, cache, storage, and durable execution connectivity.","responses":{"200":{"description":"Current runtime health.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemHealthResponse"},"examples":{"ok":{"summary":"Healthy deployment","value":{"timestamp":"2026-03-29T09:31:00Z","uptime":8123.44,"processRole":"web","database":{"status":"ok","responseTime":12},"cache":{"status":"ok","responseTime":4},"storage":{"status":"ok","responseTime":18},"durableExecution":{"status":"ok","responseTime":9,"queues":["posts-workflow"]},"status":"ok"}}}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}},"500":{"description":"Health check failed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/internal-error","title":"Internal error","status":500,"detail":"Health check failed","code":"internal_error"}}}}}}},"/api/profiles":{"get":{"tags":["Profiles"],"operationId":"listProfiles","summary":"List profiles","description":"Returns the connected publishing profiles available to the authenticated API key.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Profiles for the authenticated account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfilesListResponse"},"examples":{"default":{"summary":"Connected profiles ready for publishing","value":{"data":[{"id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","name":"Julius","provider":"x","status":"active","username":"julius","picture_url":"https://cdn.postmantis.com/profiles/julius.png","expires_at":null,"posts_count":12,"created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-28T09:00:00Z"},{"id":"9aa032e9-bf7d-4355-b4c1-96f191c2f7ee","name":"Launch Channel","provider":"youtube","status":"reauth_required","username":"launch-channel","picture_url":"https://cdn.postmantis.com/profiles/launch-channel.png","expires_at":"2026-03-20T10:00:00Z","posts_count":6,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-20T10:00:00Z"}]}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}}},"/api/profiles/{id}":{"get":{"tags":["Profiles"],"operationId":"getProfile","summary":"Get a profile","description":"Returns one connected profile by ID.","security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7"},"required":true,"name":"id","in":"path","description":"Profile identifier."}],"responses":{"200":{"description":"The requested profile.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileEnvelope"},"examples":{"active":{"summary":"An active X profile","value":{"data":{"id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","name":"Julius","provider":"x","status":"active","username":"julius","picture_url":"https://cdn.postmantis.com/profiles/julius.png","expires_at":null,"posts_count":12,"created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-28T09:00:00Z"}}},"reauthRequired":{"summary":"A profile that needs to be reconnected in the dashboard","value":{"data":{"id":"9aa032e9-bf7d-4355-b4c1-96f191c2f7ee","name":"Launch Channel","provider":"youtube","status":"reauth_required","username":"launch-channel","picture_url":"https://cdn.postmantis.com/profiles/launch-channel.png","expires_at":"2026-03-20T10:00:00Z","posts_count":6,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-20T10:00:00Z"}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"404":{"description":"Profile not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/profile-not-found","title":"Profile not found","status":404,"detail":"Profile was not found for the authenticated account.","code":"profile_not_found"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}}},"/api/profiles/{id}/disconnect":{"post":{"tags":["Profiles"],"operationId":"disconnectProfile","summary":"Disconnect a profile","description":"Marks a connected profile as disconnected without deleting historical posts or deliveries.","security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7"},"required":true,"name":"id","in":"path","description":"Profile identifier."}],"responses":{"204":{"description":"Profile disconnected."},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"403":{"description":"API key does not have write access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/forbidden","title":"Forbidden","status":403,"detail":"The authenticated API key is not allowed to perform this action.","code":"forbidden"}}}},"404":{"description":"Profile not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/profile-not-found","title":"Profile not found","status":404,"detail":"Profile was not found for the authenticated account.","code":"profile_not_found"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}}},"/api/posts":{"get":{"tags":["Posts"],"operationId":"listPosts","summary":"List posts","description":"Returns a paginated list of posts visible to the authenticated API key. Post visibility is all-or-nothing: a post appears only when all deliveries on that post are inside the key scope. Use the `deliveries` array for per-destination results. For `profile_ids` and `providers`, generated clients should send repeated query keys; the server also accepts comma-separated values for compatibility.","security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["draft","pending","scheduled","completed","canceled"]},"required":false,"name":"status","in":"query","description":"Filter posts by workflow status."},{"schema":{"type":"array","items":{"type":"string","format":"uuid"}},"required":false,"name":"profile_ids","in":"query","style":"form","explode":true,"description":"Filter by profile id. Send repeated keys such as ?profile_ids=id1&profile_ids=id2. The server also accepts comma-separated values for compatibility."},{"schema":{"type":"array","items":{"type":"string","enum":["facebook","instagram","tiktok","linkedin","youtube","x","threads","pinterest"]}},"required":false,"name":"providers","in":"query","style":"form","explode":true,"description":"Filter by provider. Send repeated keys such as ?providers=x&providers=youtube. The server also accepts comma-separated values for compatibility."},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"scheduled_after","in":"query","description":"Filter to posts scheduled at or after this ISO 8601 timestamp."},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"scheduled_before","in":"query","description":"Filter to posts scheduled at or before this ISO 8601 timestamp."},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"page","in":"query","description":"Zero-based page number."},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"per_page","in":"query","description":"Number of posts to return per page. Maximum 100."}],"responses":{"200":{"description":"Paginated posts for the authenticated account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedPostsResponse"},"examples":{"default":{"summary":"Draft, scheduled, and completed posts","value":{"data":[{"id":"74d6f3d9-6b68-4a2d-9d89-c4510a08ff42","body":"Big announcement tomorrow.","status":"scheduled","draft":false,"scheduled_at":"2026-03-30T10:00:00Z","created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:30:00Z","canceled_at":null,"media":[{"id":"f4a457b3-99ad-47d7-beb8-a64d8efdc6ef","status":"processed","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch card","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null},{"profile_id":"8d3ef50f-98d9-4a44-8cf7-0b7fb53ab0a8","provider":"instagram","profile_name":"Brand","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]},{"id":"1d2aafec-bf13-4ea4-b271-6f9ac1e9d069","body":"Draft copy for approval.","status":"draft","draft":true,"scheduled_at":null,"created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:30:00Z","canceled_at":null,"media":[],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":null,"published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]},{"id":"57f383c7-36fb-4d53-a7b4-64f59c2f72bc","body":"The launch is live.","status":"completed","draft":false,"scheduled_at":"2026-03-29T09:45:00Z","created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:46:10Z","canceled_at":null,"media":[{"id":"f4a457b3-99ad-47d7-beb8-a64d8efdc6ef","status":"processed","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch card","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"published","scheduled_at":"2026-03-29T09:45:00Z","published_at":"2026-03-29T09:45:21Z","failed_at":null,"provider_post_id":"xt_193204923","url":"https://x.com/julius/status/193204923","error_message":null},{"profile_id":"9aa032e9-bf7d-4355-b4c1-96f191c2f7ee","provider":"youtube","profile_name":"Launch Channel","status":"failed","scheduled_at":"2026-03-29T09:45:00Z","published_at":null,"failed_at":"2026-03-29T09:46:10Z","provider_post_id":null,"url":null,"error_message":"Upload expired before YouTube fetched the file."}]}],"pagination":{"page":0,"per_page":20,"total":3}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}},"post":{"tags":["Posts"],"operationId":"createPost","summary":"Create a post","description":"Creates a draft, scheduled post, or immediate publish request. Non-draft writes are accepted in `pending` first and then advanced asynchronously by the publishing workflow. The request must include `post.body`, `media`, or both. Draft requests must not include `post.scheduled_at`.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostRequest"},"examples":{"draft":{"summary":"Create a draft post","value":{"post":{"body":"Draft copy for approval.","draft":true},"profiles":["4339a6bc-9cd3-455e-8f91-df8bc63f12d7"]}},"scheduled":{"summary":"Schedule a post for later","value":{"post":{"body":"Big announcement tomorrow.","scheduled_at":"2026-03-30T10:00:00Z"},"profiles":["4339a6bc-9cd3-455e-8f91-df8bc63f12d7","8d3ef50f-98d9-4a44-8cf7-0b7fb53ab0a8"],"media":[{"url":"https://assets.example.com/launch-card.png","alt":"Launch card"}],"provider_options":{"instagram":{"format":"post"}}}},"publishNow":{"summary":"Request immediate publish","value":{"post":{"body":"The launch is live."},"profiles":["4339a6bc-9cd3-455e-8f91-df8bc63f12d7","9aa032e9-bf7d-4355-b4c1-96f191c2f7ee"],"media":[{"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch video"}],"provider_options":{"youtube":{"title":"Launch video","privacy_status":"public"},"x":{"who_can_reply":"everyone"}}}}}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/CreatePostMultipartRequest"},"examples":{"directUpload":{"summary":"Create a post and upload a local image directly","value":{"post[body]":"Launch image","profiles[]":["4339a6bc-9cd3-455e-8f91-df8bc63f12d7"],"media[0][alt]":"Launch card","media[0][file]":"<binary>"}},"assetBackedMedia":{"summary":"Create a post from an already-uploaded media asset","value":{"post[body]":"Launch video","profiles[]":["9aa032e9-bf7d-4355-b4c1-96f191c2f7ee","4339a6bc-9cd3-455e-8f91-df8bc63f12d7"],"media[0][asset_id]":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","media[0][alt]":"Launch video","provider_options[youtube][title]":"Launch video","provider_options[youtube][privacy_status]":"public"}}},"encoding":{"media[0][file]":{"contentType":"image/*,video/*"}}}}},"responses":{"201":{"description":"Post accepted.","headers":{"Location":{"description":"Relative URL of the created post resource.","schema":{"type":"string","example":"/api/posts/74d6f3d9-6b68-4a2d-9d89-c4510a08ff42"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostEnvelope"},"examples":{"draft":{"summary":"Draft post accepted","value":{"data":{"id":"1d2aafec-bf13-4ea4-b271-6f9ac1e9d069","body":"Draft copy for approval.","status":"draft","draft":true,"scheduled_at":null,"created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:30:00Z","canceled_at":null,"media":[],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":null,"published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}},"pendingWithMedia":{"summary":"Immediate post accepted in pending pre-dispatch state","value":{"data":{"id":"2cbe3062-af9c-47e9-9812-96ebefefbb7e","body":"Accepted and validating before dispatch.","status":"pending","draft":false,"scheduled_at":null,"created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:30:00Z","canceled_at":null,"media":[{"id":"7b46d2d6-1f91-4cab-8fd8-0f593b6387fd","status":"pending","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch video","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"youtube","profile_name":"Launch Channel","status":"pending","scheduled_at":null,"published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}},"pendingScheduled":{"summary":"Future-scheduled post accepted in pending state","value":{"data":{"id":"74d6f3d9-6b68-4a2d-9d89-c4510a08ff42","body":"Big announcement tomorrow.","status":"pending","draft":false,"scheduled_at":"2026-03-30T10:00:00Z","created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:30:00Z","canceled_at":null,"media":[{"id":"f4a457b3-99ad-47d7-beb8-a64d8efdc6ef","status":"processed","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch card","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null},{"profile_id":"8d3ef50f-98d9-4a44-8cf7-0b7fb53ab0a8","provider":"instagram","profile_name":"Brand","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}}}}}},"400":{"description":"Invalid request payload.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/invalid-request","title":"Invalid request","status":400,"detail":"The request payload failed validation.","code":"invalid_request"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"403":{"description":"API key does not have write access or the selected profiles are outside its scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/forbidden","title":"Forbidden","status":403,"detail":"The authenticated API key is not allowed to perform this action.","code":"forbidden"}}}},"409":{"description":"Current write semantics do not support the requested media shape.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/post-media-not-supported","title":"Post media not supported","status":409,"detail":"Current publishing flow supports at most one media item per post.","code":"post_media_not_supported"}}}},"413":{"description":"Remote media exceeded the accepted size limit during ingestion.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/payload-too-large","title":"Payload too large","status":413,"detail":"Remote media exceeds the 256 MB limit.","code":"payload_too_large"}}}},"415":{"description":"Unsupported request content type.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unsupported-media-type","title":"Unsupported media type","status":415,"detail":"Unsupported content type. Use application/json or multipart/form-data.","code":"unsupported_media_type"}}}},"422":{"description":"Referenced uploads do not exist or are not yet completed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/upload-not-ready","title":"Upload not ready","status":422,"detail":"Referenced upload must be completed before it can be attached to a post.","code":"upload_not_ready"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}},"503":{"description":"Publishing infrastructure is temporarily unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/service-unavailable","title":"Service unavailable","status":503,"detail":"Publishing is temporarily unavailable. Try again later.","code":"service_unavailable"}}}}}}},"/api/posts/{id}":{"get":{"tags":["Posts"],"operationId":"getPost","summary":"Get a post","description":"Returns one post with media and per-delivery details when the full post is visible to the authenticated API key.","security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"74d6f3d9-6b68-4a2d-9d89-c4510a08ff42"},"required":true,"name":"id","in":"path","description":"Post identifier."}],"responses":{"200":{"description":"The requested post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostEnvelope"},"examples":{"draft":{"summary":"Draft post","value":{"data":{"id":"1d2aafec-bf13-4ea4-b271-6f9ac1e9d069","body":"Draft copy for approval.","status":"draft","draft":true,"scheduled_at":null,"created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:30:00Z","canceled_at":null,"media":[],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":null,"published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}},"scheduled":{"summary":"Scheduled post","value":{"data":{"id":"74d6f3d9-6b68-4a2d-9d89-c4510a08ff42","body":"Big announcement tomorrow.","status":"scheduled","draft":false,"scheduled_at":"2026-03-30T10:00:00Z","created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:30:00Z","canceled_at":null,"media":[{"id":"f4a457b3-99ad-47d7-beb8-a64d8efdc6ef","status":"processed","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch card","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null},{"profile_id":"8d3ef50f-98d9-4a44-8cf7-0b7fb53ab0a8","provider":"instagram","profile_name":"Brand","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}},"completed":{"summary":"Completed post with mixed delivery results","value":{"data":{"id":"57f383c7-36fb-4d53-a7b4-64f59c2f72bc","body":"The launch is live.","status":"completed","draft":false,"scheduled_at":"2026-03-29T09:45:00Z","created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:46:10Z","canceled_at":null,"media":[{"id":"f4a457b3-99ad-47d7-beb8-a64d8efdc6ef","status":"processed","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch card","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"published","scheduled_at":"2026-03-29T09:45:00Z","published_at":"2026-03-29T09:45:21Z","failed_at":null,"provider_post_id":"xt_193204923","url":"https://x.com/julius/status/193204923","error_message":null},{"profile_id":"9aa032e9-bf7d-4355-b4c1-96f191c2f7ee","provider":"youtube","profile_name":"Launch Channel","status":"failed","scheduled_at":"2026-03-29T09:45:00Z","published_at":null,"failed_at":"2026-03-29T09:46:10Z","provider_post_id":null,"url":null,"error_message":"Upload expired before YouTube fetched the file."}]}}},"canceled":{"summary":"Canceled post","value":{"data":{"id":"804f2fcc-b4fa-4cdd-964d-9d0cc58d72a1","body":"Big announcement tomorrow.","status":"canceled","draft":false,"scheduled_at":"2026-03-30T10:00:00Z","created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:35:00Z","canceled_at":"2026-03-29T09:35:00Z","media":[{"id":"f4a457b3-99ad-47d7-beb8-a64d8efdc6ef","status":"processed","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch card","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null},{"profile_id":"8d3ef50f-98d9-4a44-8cf7-0b7fb53ab0a8","provider":"instagram","profile_name":"Brand","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"404":{"description":"Post not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/post-not-found","title":"Post not found","status":404,"detail":"Post was not found for the authenticated account.","code":"post_not_found"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}},"patch":{"tags":["Posts"],"operationId":"updatePost","summary":"Update a post","description":"Updates a draft post, or reschedules a scheduled post when the request only changes `post.scheduled_at` and every delivery is still pending. PATCH must change at least one field, and `post.draft` cannot be changed through this endpoint.","security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"74d6f3d9-6b68-4a2d-9d89-c4510a08ff42"},"required":true,"name":"id","in":"path","description":"Post identifier."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePostRequest"},"examples":{"default":{"summary":"Update draft body and profiles","value":{"post":{"body":"Revised launch copy."},"profiles":["4339a6bc-9cd3-455e-8f91-df8bc63f12d7","8d3ef50f-98d9-4a44-8cf7-0b7fb53ab0a8"]}},"replaceMedia":{"summary":"Replace draft media with one uploaded asset","value":{"media":[{"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Updated card"}]}},"reschedule":{"summary":"Reschedule a scheduled post","value":{"post":{"scheduled_at":"2026-03-31T09:00:00Z"}}}}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UpdatePostMultipartRequest"},"examples":{"replaceMedia":{"summary":"Replace media with a direct file upload","value":{"post[body]":"Revised launch image","media[0][alt]":"Updated launch card","media[0][file]":"<binary>"}}},"encoding":{"media[0][file]":{"contentType":"image/*,video/*"}}}}},"responses":{"200":{"description":"Updated post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostEnvelope"},"examples":{"updated":{"summary":"Draft updated successfully","value":{"data":{"id":"1d2aafec-bf13-4ea4-b271-6f9ac1e9d069","body":"Revised launch copy.","status":"draft","draft":true,"scheduled_at":null,"created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:40:00Z","canceled_at":null,"media":[],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":null,"published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}}}}}},"400":{"description":"Invalid request payload.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/invalid-request","title":"Invalid request","status":400,"detail":"The request payload failed validation.","code":"invalid_request"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"403":{"description":"API key does not have write access or the requested change falls outside its scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/forbidden","title":"Forbidden","status":403,"detail":"The authenticated API key is not allowed to perform this action.","code":"forbidden"}}}},"404":{"description":"Post not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/post-not-found","title":"Post not found","status":404,"detail":"Post was not found for the authenticated account.","code":"post_not_found"}}}},"409":{"description":"Post can no longer be edited, or the requested media shape is unsupported.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"notEditable":{"summary":"Post cannot be edited in its current state","value":{"type":"https://postmantis.com/problems/post-not-editable","title":"Post cannot be updated","status":409,"detail":"Only drafts can be edited through PATCH. Scheduled posts may only be rescheduled by changing post.scheduled_at while every delivery is still pending.","code":"post_not_editable"}},"mediaNotSupported":{"summary":"Only one media item is currently supported","value":{"type":"https://postmantis.com/problems/post-media-not-supported","title":"Post media not supported","status":409,"detail":"Current publishing flow supports at most one media item per post.","code":"post_media_not_supported"}}}}}},"413":{"description":"Remote media exceeded the accepted size limit during ingestion.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/payload-too-large","title":"Payload too large","status":413,"detail":"Remote media exceeds the 256 MB limit.","code":"payload_too_large"}}}},"415":{"description":"Unsupported request content type.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unsupported-media-type","title":"Unsupported media type","status":415,"detail":"Unsupported content type. Use application/json or multipart/form-data.","code":"unsupported_media_type"}}}},"422":{"description":"Referenced uploads do not exist or are not yet completed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/upload-not-ready","title":"Upload not ready","status":422,"detail":"Referenced upload must be completed before it can be attached to a post.","code":"upload_not_ready"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}},"503":{"description":"Publishing infrastructure is temporarily unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/service-unavailable","title":"Service unavailable","status":503,"detail":"Publishing is temporarily unavailable. Try again later.","code":"service_unavailable"}}}}}},"delete":{"tags":["Posts"],"operationId":"deleteDraftPost","summary":"Delete a draft post","description":"Deletes a local draft that has not been published or scheduled. Use this only for drafts you want to discard entirely. Use cancel instead for scheduled posts so the record and history remain inspectable.","security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"74d6f3d9-6b68-4a2d-9d89-c4510a08ff42"},"required":true,"name":"id","in":"path","description":"Post identifier."}],"responses":{"204":{"description":"Draft deleted."},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"403":{"description":"API key does not have write access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/forbidden","title":"Forbidden","status":403,"detail":"The authenticated API key is not allowed to perform this action.","code":"forbidden"}}}},"404":{"description":"Post not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/post-not-found","title":"Post not found","status":404,"detail":"Post was not found for the authenticated account.","code":"post_not_found"}}}},"409":{"description":"Only drafts can be deleted.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/post-not-deletable","title":"Post cannot be deleted","status":409,"detail":"Only drafts can be deleted.","code":"post_not_deletable"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}}},"/api/posts/{id}/publish":{"post":{"tags":["Posts"],"operationId":"publishDraftPost","summary":"Publish a draft post","description":"Publishes a draft immediately or schedules it for later if `scheduled_at` is provided.","security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"74d6f3d9-6b68-4a2d-9d89-c4510a08ff42"},"required":true,"name":"id","in":"path","description":"Post identifier."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishDraftRequest"},"examples":{"immediate":{"summary":"Publish now","value":{}},"scheduled":{"summary":"Publish later","value":{"scheduled_at":"2026-03-30T12:00:00Z"}}}}}},"responses":{"200":{"description":"Draft accepted for publishing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostEnvelope"},"examples":{"pendingScheduled":{"summary":"Draft accepted for future scheduling in pending state","value":{"data":{"id":"74d6f3d9-6b68-4a2d-9d89-c4510a08ff42","body":"Big announcement tomorrow.","status":"pending","draft":false,"scheduled_at":"2026-03-30T10:00:00Z","created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:30:00Z","canceled_at":null,"media":[{"id":"f4a457b3-99ad-47d7-beb8-a64d8efdc6ef","status":"processed","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch card","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null},{"profile_id":"8d3ef50f-98d9-4a44-8cf7-0b7fb53ab0a8","provider":"instagram","profile_name":"Brand","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}},"pendingWithMedia":{"summary":"Draft accepted while media still processes","value":{"data":{"id":"2cbe3062-af9c-47e9-9812-96ebefefbb7e","body":"Accepted and validating before dispatch.","status":"pending","draft":false,"scheduled_at":null,"created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:30:00Z","canceled_at":null,"media":[{"id":"7b46d2d6-1f91-4cab-8fd8-0f593b6387fd","status":"pending","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch video","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"youtube","profile_name":"Launch Channel","status":"pending","scheduled_at":null,"published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}}}}}},"400":{"description":"Invalid request payload.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/invalid-request","title":"Invalid request","status":400,"detail":"The request payload failed validation.","code":"invalid_request"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"403":{"description":"API key does not have write access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/forbidden","title":"Forbidden","status":403,"detail":"The authenticated API key is not allowed to perform this action.","code":"forbidden"}}}},"404":{"description":"Post not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/post-not-found","title":"Post not found","status":404,"detail":"Post was not found for the authenticated account.","code":"post_not_found"}}}},"409":{"description":"Only drafts can be published with this endpoint.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/post-not-publishable","title":"Post cannot be published","status":409,"detail":"Only draft posts can be published.","code":"post_not_publishable"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}}},"/api/posts/{id}/cancel":{"post":{"tags":["Posts"],"operationId":"cancelPost","summary":"Cancel a scheduled post","description":"Cancels a scheduled post before it settles. Use cancel when you want to stop future delivery while preserving the record and its history. Use delete only for drafts that should be discarded entirely.","security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"74d6f3d9-6b68-4a2d-9d89-c4510a08ff42"},"required":true,"name":"id","in":"path","description":"Post identifier."}],"responses":{"200":{"description":"Scheduled post canceled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostEnvelope"},"examples":{"canceled":{"summary":"Canceled post","value":{"data":{"id":"804f2fcc-b4fa-4cdd-964d-9d0cc58d72a1","body":"Big announcement tomorrow.","status":"canceled","draft":false,"scheduled_at":"2026-03-30T10:00:00Z","created_at":"2026-03-29T09:30:00Z","updated_at":"2026-03-29T09:35:00Z","canceled_at":"2026-03-29T09:35:00Z","media":[{"id":"f4a457b3-99ad-47d7-beb8-a64d8efdc6ef","status":"processed","content_type":null,"url":null,"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","alt":"Launch card","error_message":null}],"deliveries":[{"profile_id":"4339a6bc-9cd3-455e-8f91-df8bc63f12d7","provider":"x","profile_name":"Julius","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null},{"profile_id":"8d3ef50f-98d9-4a44-8cf7-0b7fb53ab0a8","provider":"instagram","profile_name":"Brand","status":"pending","scheduled_at":"2026-03-30T10:00:00Z","published_at":null,"failed_at":null,"provider_post_id":null,"url":null,"error_message":null}]}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"403":{"description":"API key does not have write access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/forbidden","title":"Forbidden","status":403,"detail":"The authenticated API key is not allowed to perform this action.","code":"forbidden"}}}},"404":{"description":"Post not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/post-not-found","title":"Post not found","status":404,"detail":"Post was not found for the authenticated account.","code":"post_not_found"}}}},"409":{"description":"Post can no longer be canceled.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/post-not-cancelable","title":"Post cannot be canceled","status":409,"detail":"Only scheduled posts that have not settled can be canceled.","code":"post_not_cancelable"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}}},"/api/uploads":{"post":{"tags":["Uploads"],"operationId":"createMediaUpload","summary":"Create a media upload session","description":"Creates a presigned upload session for a media file.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetCreateRequest"},"examples":{"image":{"summary":"Create an image upload","value":{"filename":"launch-card.png","content_type":"image/png","size_bytes":481233}}}}}},"responses":{"201":{"description":"Upload session created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetEnvelope"},"examples":{"pending":{"summary":"Pending upload session","value":{"data":{"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","status":"pending","filename":"launch-card.png","content_type":"image/png","size_bytes":481233,"upload_url":"https://storage.postmantis.com/uploads/8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","upload_method":"PUT","upload_headers":{"Content-Type":"image/png"},"expires_at":"2026-03-29T10:00:00Z","url":null,"created_at":"2026-03-29T09:30:00Z","completed_at":null}}}}}}},"400":{"description":"Invalid request payload.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/invalid-request","title":"Invalid request","status":400,"detail":"The request payload failed validation.","code":"invalid_request"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"403":{"description":"API key does not have write access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/forbidden","title":"Forbidden","status":403,"detail":"The authenticated API key is not allowed to perform this action.","code":"forbidden"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}}},"/api/uploads/{id}/complete":{"post":{"tags":["Uploads"],"operationId":"completeMediaUpload","summary":"Complete a media upload session","description":"Marks a direct upload as complete and returns the finalized media asset URL.","security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1"},"required":true,"name":"id","in":"path","description":"Media asset identifier."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetCompleteRequest"},"examples":{"default":{"summary":"Complete an uploaded file","value":{}}}}}},"responses":{"200":{"description":"Upload session completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetEnvelope"},"examples":{"completed":{"summary":"Completed upload ready to attach to posts","value":{"data":{"asset_id":"8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1","status":"completed","filename":"launch-card.png","content_type":"image/png","size_bytes":481233,"upload_url":null,"upload_method":null,"upload_headers":{},"expires_at":null,"url":"https://cdn.postmantis.com/media/launch-card.png","created_at":"2026-03-29T09:30:00Z","completed_at":"2026-03-29T09:31:00Z"}}}}}}},"400":{"description":"Invalid request payload.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/invalid-request","title":"Invalid request","status":400,"detail":"The request payload failed validation.","code":"invalid_request"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid API key.","code":"unauthorized"}}}},"403":{"description":"API key does not have write access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/forbidden","title":"Forbidden","status":403,"detail":"The authenticated API key is not allowed to perform this action.","code":"forbidden"}}}},"404":{"description":"Upload not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/upload-not-found","title":"Upload not found","status":404,"detail":"Upload not found.","code":"upload_not_found"}}}},"409":{"description":"Upload cannot be completed from its current state.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://postmantis.com/problems/upload-not-ready","title":"Upload not ready","status":409,"detail":"Upload cannot be completed from its current state.","code":"upload_not_ready"}}}},"429":{"description":"Too many requests for the current rate-limit window.","headers":{"Retry-After":{"description":"Seconds until a request may be retried.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"},"example":{"error":"Too Many Requests"}}}}}}}},"webhooks":{}}