{"openapi":"3.1.0","info":{"title":"PostWing API","version":"2.0.0","description":"Schedule and manage social posts on Instagram, TikTok, YouTube, LinkedIn, X, Facebook, Pinterest, and Threads. POST /posts schedules in one call: a caption, a time, the accounts to post to (by id, from GET /accounts), and optional media. Every post endpoint returns the same Post object, including each account’s status, published URL, and error. Errors are { \"error\": { \"code\", \"message\", \"field\"? } } with stable codes. Human docs: https://postwing.io/docs. Legacy v1: https://postwing.io/docs/v1.","contact":{"url":"https://postwing.io/docs"}},"servers":[{"url":"https://postwing.io/api/v2","description":"Production"}],"security":[{"bearerAuth":[]},{"oauth2":["accounts:read","accounts:write","posts:read","posts:write","workspaces:read","workspaces:write"]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"PostWing API key (`pw_live_…`) from Dashboard → AI & API."},"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://postwing.io/oauth/authorize","tokenUrl":"https://postwing.io/oauth/token","refreshUrl":"https://postwing.io/oauth/token","scopes":{"accounts:read":"Access scope accounts:read","accounts:write":"Access scope accounts:write","posts:read":"Access scope posts:read","posts:write":"Access scope posts:write","workspaces:read":"Access scope workspaces:read","workspaces:write":"Access scope workspaces:write"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"account_not_found"},"message":{"type":"string"},"field":{"type":"string","description":"The request field at fault, e.g. accounts[1].id"}}}}},"Cover":{"type":"object","description":"Video cover: an image URL, or a frame time in milliseconds (default 1000).","properties":{"url":{"type":"string","format":"uri"},"at_ms":{"type":"integer","minimum":0}}},"Media":{"type":"object","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","description":"Public HTTPS URL, e.g. from POST /media/uploads"},"type":{"type":"string","enum":["image","video"],"description":"Inferred from the URL when omitted"},"cover":{"$ref":"#/components/schemas/Cover"}}},"PlatformOptions":{"type":"object","additionalProperties":false,"description":"Settings for this account’s platform. Only keys for that platform are accepted. LinkedIn and Threads have none.","properties":{"quote_post":{"type":"string","description":"x: Post URL or ID to quote. Creates a native quote post."},"who_can_reply":{"type":"string","enum":["everyone","following","mentioned","subscribers","verified"],"description":"x: Who can reply. Default everyone."},"share_to_feed":{"type":"boolean","description":"instagram: Reels only. Also show the Reel on the main feed. Default true."},"trial_reel":{"type":"string","enum":["off","manual","performance"],"description":"instagram: Reels only. Post as a trial Reel. Default off."},"format":{"type":"string","enum":["post","reel"],"description":"facebook: post (feed) or reel. Videos default to reel, everything else to post."},"title":{"type":"string","description":"youtube: Video title. Required. tiktok: Photo posts only. Ignored for videos. pinterest: Pin title."},"made_for_kids":{"type":"boolean","description":"youtube: Whether the video is made for kids. Default false."},"visibility":{"type":"string","enum":["public","private"],"description":"tiktok: Default public."},"allow_comments":{"type":"boolean","description":"tiktok: Default true."},"allow_duets":{"type":"boolean","description":"tiktok: Default true."},"allow_stitches":{"type":"boolean","description":"tiktok: Default true."},"ai_generated":{"type":"boolean","description":"tiktok: Label the post as AI-generated. Default false."},"save_as_draft":{"type":"boolean","description":"tiktok: Send to TikTok drafts instead of publishing. Default false."},"board_id":{"type":"string","description":"pinterest: Board to pin to. Required. Get IDs from GET /accounts/{id}/pinterest-boards."},"link":{"type":"string","description":"pinterest: Destination URL when someone clicks the pin."}}},"PostAccountInput":{"type":"object","required":["id"],"additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid","description":"Account id from GET /accounts"},"caption":{"type":["string","null"],"description":"Caption for this account only. Omit or null to use the post caption; \"\" for none."},"options":{"$ref":"#/components/schemas/PlatformOptions"}}},"PostAccount":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"platform":{"type":"string"},"handle":{"type":["string","null"]},"display_name":{"type":["string","null"]},"caption":{"type":["string","null"]},"options":{"$ref":"#/components/schemas/PlatformOptions"},"status":{"type":"string","enum":["scheduled","publishing","published","failed","paused"]},"url":{"type":["string","null"],"description":"Link to the published post"},"error":{"type":["string","null"],"description":"Why publishing failed, when status is failed"}}},"Post":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["scheduled","publishing","published","partially_failed","failed","paused"]},"caption":{"type":"string"},"scheduled_at":{"type":"string","format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/PostAccount"}},"dashboard_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"example":{"id":"7c1d2a8e-4b0f-4f8e-9a51-2f7f6b1c9d10","workspace_id":"3f2a9c1e-8d4b-4e6a-b2c7-1a9e5d3f7b20","status":"scheduled","caption":"Launch day 🚀","scheduled_at":"2026-10-20T09:00:00.000Z","media":[{"url":"https://cdn.example.com/launch.jpg","type":"image"}],"accounts":[{"id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","platform":"instagram","handle":"brand","display_name":"Brand","caption":null,"options":{},"status":"scheduled","url":null,"error":null}],"dashboard_url":"https://postwing.io/dashboard/post/7c1d2a8e-4b0f-4f8e-9a51-2f7f6b1c9d10","created_at":"2026-10-14T12:00:00.000Z","updated_at":"2026-10-14T12:00:00.000Z"}},"CreatePost":{"type":"object","required":["caption","scheduled_at","accounts"],"additionalProperties":false,"properties":{"caption":{"type":"string","description":"\"\" for no caption"},"scheduled_at":{"type":"string","format":"date-time","description":"In the future"},"accounts":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/PostAccountInput"}},"media":{"type":"array","maxItems":35,"items":{"$ref":"#/components/schemas/Media"}},"workspace_id":{"type":"string","format":"uuid","description":"Defaults to the workspace the accounts belong to"}}},"UpdatePost":{"type":"object","additionalProperties":false,"description":"Send only what changes. accounts replaces the full list; media: [] removes all media.","properties":{"caption":{"type":"string"},"scheduled_at":{"type":"string","format":"date-time"},"accounts":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/PostAccountInput"}},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}}}},"PostList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"has_more":{"type":"boolean"}}},"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","pinterest","threads"]},"handle":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["connected","reauth_required"]},"workspace_id":{"type":"string","format":"uuid"}}},"Workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","member"]},"is_active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}}}},"paths":{"/me":{"get":{"operationId":"getMe","summary":"The authenticated user: timezone and active workspace","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":["string","null"]},"timezone":{"type":"string"},"active_workspace_id":{"type":"string","format":"uuid"}}}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts":{"get":{"operationId":"listAccounts","summary":"List connected social accounts","security":[{"bearerAuth":[]},{"oauth2":["accounts:read"]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"description":"Workspace to use. Defaults to the active workspace.","schema":{"type":"string","format":"uuid"}},{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["x","instagram","facebook","youtube","tiktok","pinterest","linkedin","threads"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}}}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"workspace_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts/connect":{"post":{"operationId":"connectAccount","summary":"Start connecting an account; open the returned url, then call /accounts/sync","security":[{"bearerAuth":[]},{"oauth2":["accounts:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["platform"],"properties":{"platform":{"type":"string","enum":["x","instagram","facebook","youtube","tiktok","pinterest","linkedin","threads"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"platform":{"type":"string"}}}}}},"400":{"description":"invalid_platform","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts/sync":{"post":{"operationId":"syncAccounts","summary":"Import newly authorized accounts into the active workspace","security":[{"bearerAuth":[]},{"oauth2":["accounts:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}}}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts/{id}":{"delete":{"operationId":"disconnectAccount","summary":"Disconnect an account","security":[{"bearerAuth":[]},{"oauth2":["accounts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Account id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"disconnected":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"account_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts/{id}/pinterest-boards":{"get":{"operationId":"listPinterestBoards","summary":"Boards for a Pinterest account (for options.board_id)","security":[{"bearerAuth":[]},{"oauth2":["accounts:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Pinterest account id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}}}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"account_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces":{"get":{"operationId":"listWorkspaces","summary":"List workspaces","security":[{"bearerAuth":[]},{"oauth2":["workspaces:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}},"active_workspace_id":{"type":"string","format":"uuid"}}}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createWorkspace","summary":"Create a workspace (Scale plan)","security":[{"bearerAuth":[]},{"oauth2":["workspaces:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/active":{"post":{"operationId":"setActiveWorkspace","summary":"Set the default workspace for calls without workspace_id","security":[{"bearerAuth":[]},{"oauth2":["workspaces:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["workspace_id"],"properties":{"workspace_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"workspace_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/uploads":{"post":{"operationId":"createMediaUpload","summary":"Get an upload URL; PUT the file there, then use { url, type } in media","security":[{"bearerAuth":[]},{"oauth2":["posts:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename","content_type","size"],"properties":{"filename":{"type":"string"},"content_type":{"type":"string","example":"video/mp4"},"size":{"type":"integer","description":"Bytes"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"upload_url":{"type":"string","format":"uri"},"url":{"type":"string","format":"uri"},"type":{"type":"string","enum":["image","video"]}}}}}},"400":{"description":"invalid_media","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/imports":{"post":{"operationId":"importMedia","summary":"Copy media from public HTTPS URLs (optional)","security":[{"bearerAuth":[]},{"oauth2":["posts:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["urls"],"properties":{"urls":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"string","format":"uri"}}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Media"}}}}}}},"400":{"description":"invalid_media","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts":{"get":{"operationId":"listPosts","summary":"List posts (upcoming first)","security":[{"bearerAuth":[]},{"oauth2":["posts:read"]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"description":"Workspace to use. Defaults to the active workspace.","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"type":"string","enum":["scheduled","publishing","published","partially_failed","failed","paused"]}},{"name":"from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"include_past","in":"query","description":"Include posts scheduled before now (ignored when from is set)","schema":{"type":"boolean"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostList"}}}},"400":{"description":"invalid_parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createPost","summary":"Schedule a post","security":[{"bearerAuth":[]},{"oauth2":["posts:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePost"},"examples":{"text":{"summary":"Text post to two accounts, shorter caption on X","value":{"caption":"We are open late this week.","scheduled_at":"2026-10-20T15:00:00Z","accounts":[{"id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"},{"id":"b2c3d4e5-f6a7-8901-bcde-f12345678901","caption":"Open late this week."}]}},"reel":{"summary":"Instagram Reel with a custom cover","value":{"caption":"Behind the scenes","scheduled_at":"2026-10-20T18:00:00Z","accounts":[{"id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","options":{"share_to_feed":true}}],"media":[{"url":"https://cdn.example.com/reel.mp4","type":"video","cover":{"url":"https://cdn.example.com/cover.jpg"}}]}},"quote":{"summary":"X quote post","value":{"caption":"Adding my take","scheduled_at":"2026-10-20T15:00:00Z","accounts":[{"id":"c3d4e5f6-a7b8-9012-cdef-123456789012","options":{"quote_post":"https://x.com/someone/status/1234567890"}}]}}}}}},"responses":{"201":{"description":"Scheduled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"Validation error, e.g. invalid_scheduled_at, account_not_found, invalid_option","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts/summary":{"get":{"operationId":"getPostsSummary","summary":"Counts by platform, account, status, and day","security":[{"bearerAuth":[]},{"oauth2":["posts:read"]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"description":"Workspace to use. Defaults to the active workspace.","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"include_past","in":"query","schema":{"type":"boolean"}},{"name":"platform","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts/{id}":{"get":{"operationId":"getPost","summary":"Get a post","security":[{"bearerAuth":[]},{"oauth2":["posts:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Post id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"post_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updatePost","summary":"Edit a scheduled post","security":[{"bearerAuth":[]},{"oauth2":["posts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Post id","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePost"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"post_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"post_not_editable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"cancelPost","summary":"Cancel a scheduled or paused post","security":[{"bearerAuth":[]},{"oauth2":["posts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Post id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"cancelled":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid credentials (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope or subscription (missing_scope, subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"post_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"post_not_cancellable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"x-postwing-oauth-resource":{"resource":"https://postwing.io/api/v2","authorization_servers":["https://postwing.io"],"scopes_supported":["accounts:read","accounts:write","posts:read","posts:write","workspaces:read","workspaces:write"],"bearer_methods_supported":["header"],"resource_name":"PostWing API","resource_documentation":"https://postwing.io/docs"}}