{"openapi":"3.1.0","info":{"title":"HeyOrbit API","version":"0.1.0","summary":"Schedule posts, read analytics, manage the social inbox and media library.","description":"Authenticate with an API key from Settings → API Keys (`Authorization: Bearer orb_…`). Every response is wrapped as `{ ok: true, data }` or `{ ok: false, error, code }`. Rate limit: 120 requests per minute per key (see `X-RateLimit-*` headers). All timestamps are ISO 8601.","contact":{"name":"HeyOrbit support","url":"https://heyorbitapp.vercel.app/support"},"license":{"name":"Proprietary"}},"servers":[{"url":"https://heyorbitapp.vercel.app/api/v1","description":"This deployment"}],"security":[{"apiKey":[]}],"tags":[{"name":"Account","description":"Who am I, workspaces"},{"name":"Social accounts"},{"name":"Posts","description":"Create, schedule and publish posts"},{"name":"Analytics"},{"name":"Inbox"},{"name":"Media"},{"name":"Organization","description":"Labels, hashtag sets"},{"name":"Reports"}],"paths":{"/me":{"get":{"tags":["Account"],"summary":"Current user","operationId":"getMe","responses":{"200":{"description":"The key owner, their account slots and the AI add-on.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Me"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/workspaces":{"get":{"tags":["Account"],"summary":"List workspaces","operationId":"listWorkspaces","responses":{"200":{"description":"Workspaces with role and accounts.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/accounts":{"get":{"tags":["Social accounts"],"summary":"List social accounts","operationId":"listAccounts","parameters":[{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string","enum":["INSTAGRAM","FACEBOOK","X","LINKEDIN","TIKTOK","YOUTUBE","THREADS","PINTEREST","BLUESKY","GOOGLE_BUSINESS","MASTODON","DEMO"]}},{"name":"status","in":"query","schema":{"type":"string","enum":["ACTIVE","EXPIRED","DISCONNECTED","ERROR"]}}],"responses":{"200":{"description":"Accounts.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SocialAccount"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/posts":{"get":{"tags":["Posts"],"summary":"List posts","operationId":"listPosts","parameters":[{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}},{"name":"status","in":"query","description":"Comma separated statuses","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"platform","in":"query","schema":{"type":"string"}},{"name":"accountId","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Posts, newest first.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"nextCursor":{"type":["string","null"]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Posts"],"summary":"Create a post","description":"Create a draft, schedule it (action=schedule with scheduledAt) or publish immediately (action=publish).","operationId":"createPost","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostInput"}}}},"responses":{"201":{"description":"Created post.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Post"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/posts/{id}":{"get":{"tags":["Posts"],"summary":"Get a post","operationId":"getPost","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}}],"responses":{"200":{"description":"Post.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Post"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Posts"],"summary":"Update a post","operationId":"updatePost","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostPatch"}}}},"responses":{"200":{"description":"Updated post.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Post"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Posts"],"summary":"Delete a post","operationId":"deletePost","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/posts/{id}/versions":{"get":{"tags":["Posts"],"summary":"List a post's versions","description":"Every time a post is sent for approval (again after feedback or edits, or after a restore) or goes out with edits made after approval, HeyOrbit keeps a numbered version: what was sent, each approver's decision with their reason, and what changed from the version before. Newest first. Read-only, with the same access as reading the post (account restrictions apply; other accounts' captions are left out).","operationId":"listPostVersions","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}}],"responses":{"200":{"description":"Versions, newest first.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"postId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PostVersion"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/posts/{id}/publish":{"post":{"tags":["Posts"],"summary":"Publish a post now","operationId":"publishPost","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspaceId":{"type":"string"}}}}}},"responses":{"200":{"description":"Post with per-platform results.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Post"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/analytics/overview":{"get":{"tags":["Analytics"],"summary":"Workspace analytics overview","operationId":"analyticsOverview","parameters":[{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}},{"name":"range","in":"query","schema":{"type":"string","enum":["7d","14d","30d","90d"],"default":"30d"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"accountIds","in":"query","description":"Comma separated account ids","schema":{"type":"string"}}],"description":"Any range: 7d, 14d, 30d, 90d or a custom from/to.","responses":{"200":{"description":"Totals, deltas, per-account and per-platform rows, daily series, top posts.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Overview"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/analytics/accounts/{id}":{"get":{"tags":["Analytics"],"summary":"Account analytics","operationId":"accountAnalytics","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}},{"name":"range","in":"query","schema":{"type":"string","enum":["7d","14d","30d","90d"],"default":"30d"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}}],"description":"Any range: 7d, 14d, 30d, 90d or a custom from/to.","responses":{"200":{"description":"Account totals, series and post performance.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/AccountAnalytics"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/inbox":{"get":{"tags":["Inbox"],"summary":"List inbox items","operationId":"listInbox","parameters":[{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string","enum":["comments","messages","COMMENT","MESSAGE","REVIEW","MENTION"]}},{"name":"unread","in":"query","schema":{"type":"boolean"}},{"name":"status","in":"query","schema":{"type":"string","enum":["OPEN","RESOLVED","ARCHIVED"]}},{"name":"accountId","in":"query","schema":{"type":"string"}},{"name":"sentiment","in":"query","schema":{"type":"string","enum":["POSITIVE","NEUTRAL","NEGATIVE"]}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}}],"responses":{"200":{"description":"Inbox items, newest first.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InboxItem"}},"nextCursor":{"type":["string","null"]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/inbox/{id}/reply":{"post":{"tags":["Inbox"],"summary":"Reply to an inbox item","operationId":"replyInbox","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","maxLength":5000},"workspaceId":{"type":"string"}}}}}},"responses":{"200":{"description":"The sent reply.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/InboxReply"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/PlatformError"}}}},"/media":{"get":{"tags":["Media"],"summary":"List media","operationId":"listMedia","parameters":[{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string","enum":["IMAGE","VIDEO","GIF"]}},{"name":"folderId","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}}],"responses":{"200":{"description":"Media assets.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MediaAsset"}},"nextCursor":{"type":["string","null"]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Media"],"summary":"Upload or import media","description":"Send JSON `{ url }` to import from a public URL, or multipart/form-data with a `file` field to upload.","operationId":"createMedia","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"alt":{"type":"string"},"filename":{"type":"string"},"folderId":{"type":"string"},"workspaceId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"alt":{"type":"string"},"folderId":{"type":"string"},"workspaceId":{"type":"string"}}}}}},"responses":{"201":{"description":"Created asset.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/MediaAsset"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"$ref":"#/components/responses/TooLarge"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/labels":{"get":{"tags":["Organization"],"summary":"List labels","operationId":"listLabels","parameters":[{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}}],"responses":{"200":{"description":"Labels.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Label"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/hashtag-sets":{"get":{"tags":["Organization"],"summary":"List hashtag sets","operationId":"listHashtagSets","parameters":[{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}}],"responses":{"200":{"description":"Hashtag sets.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HashtagSet"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/reports":{"get":{"tags":["Reports"],"summary":"List reports","operationId":"listReports","parameters":[{"name":"workspaceId","in":"query","required":false,"description":"Workspace id. Falls back to the X-Workspace header, then the first workspace of the key owner.","schema":{"type":"string"}}],"description":"Reports with their public share URLs.","responses":{"200":{"description":"Reports with share URLs.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Report"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Reports"],"summary":"Generate a report","operationId":"createReport","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","to"],"properties":{"workspaceId":{"type":"string"},"title":{"type":"string"},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"compare":{"type":"string","enum":["NONE","PREVIOUS_PERIOD","PREVIOUS_YEAR"],"default":"PREVIOUS_PERIOD"},"accountIds":{"type":"array","items":{"type":"string"},"description":"Defaults to all accounts"}}}}}},"description":"Generates a report for the range and returns it with its share URL.","responses":{"201":{"description":"Generated report.","content":{"application/json":{"schema":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Report"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Validation"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/openapi.json":{"get":{"tags":["Account"],"summary":"This document","operationId":"getOpenApi","security":[],"responses":{"200":{"description":"OpenAPI 3.1 JSON"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"orb_…","description":"API key from Settings → API Keys."}},"responses":{"Unauthorized":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"}}}}}},"Forbidden":{"description":"No access to the workspace, missing scope or insufficient role.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"}}}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"}}}}}},"Validation":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"}}}}}},"Conflict":{"description":"State conflict (e.g. awaiting approval).","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"}}}}}},"PlanLimit":{"description":"Needs something the workspace owner hasn't paid for: the AI Studio add-on (code AI_ADDON_REQUIRED), a free account slot, or publishing is paused because the account subscription lapsed (code PUBLISHING_PAUSED).","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"}}}}}},"RateLimited":{"description":"Rate limit exceeded (120/min).","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"}}}}}},"TooLarge":{"description":"File too large.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"}}}}}},"PlatformError":{"description":"The social platform rejected the request.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"}}}}}}},"schemas":{"Me":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatarUrl":{"type":"string","nullable":true},"timezone":{"type":"string"},"plan":{"type":"string","description":"Always GROWTH: one plan, billed monthly per connected social account."},"accountSlots":{"type":"object","description":"Social account slots paid for this month (plus any bonus slots), pooled across the workspaces this user owns.","properties":{"total":{"type":"integer"},"used":{"type":"integer"},"free":{"type":"integer"}}},"aiAddon":{"type":"object","description":"The optional AI Studio add-on.","properties":{"active":{"type":"boolean"},"status":{"type":"string","nullable":true},"periodEnd":{"type":"string","format":"date-time","nullable":true}}},"aiUsage":{"type":"object","properties":{"month":{"type":"string"},"captions":{"type":"integer"},"images":{"type":"integer"}}},"workspaces":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}}},"Workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"domain":{"type":["string","null"]},"timezone":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","EDITOR","CLIENT","VIEWER"]},"requireApproval":{"type":"boolean"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":"string"},"status":{"type":"string"}}}},"createdAt":{"type":"string","format":"date-time"}}},"SocialAccount":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"platform":{"type":"string","enum":["INSTAGRAM","FACEBOOK","X","LINKEDIN","TIKTOK","YOUTUBE","THREADS","PINTEREST","BLUESKY","GOOGLE_BUSINESS","MASTODON","DEMO"]},"username":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":["string","null"]},"profileUrl":{"type":["string","null"]},"accountType":{"type":["string","null"]},"status":{"type":"string","enum":["ACTIVE","EXPIRED","DISCONNECTED","ERROR"]},"followersCount":{"type":"integer"},"tokenExpiresAt":{"type":["string","null"],"format":"date-time"},"lastSyncedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"PostTargetInput":{"type":"object","required":["socialAccountId"],"properties":{"socialAccountId":{"type":"string"},"caption":{"type":"string","description":"Per-account caption when sameCaption=false"},"settings":{"type":"object","additionalProperties":true,"description":"Platform options: firstComment, title, privacy, boardId, postType (reel|story|thread|short|carousel|article|event|offer), link, thread (bool)…"}}},"PostInput":{"type":"object","required":["targets"],"properties":{"workspaceId":{"type":"string"},"caption":{"type":"string"},"sameCaption":{"type":"boolean","default":true},"scheduledAt":{"type":["string","null"],"format":"date-time"},"timezone":{"type":"string","default":"UTC"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/PostTargetInput"}},"mediaIds":{"type":"array","items":{"type":"string"}},"labelIds":{"type":"array","items":{"type":"string"}},"approverIds":{"type":"array","items":{"type":"string"}},"recurrence":{"type":["object","null"],"additionalProperties":true},"action":{"type":"string","enum":["draft","schedule","publish"],"default":"draft"}}},"PostPatch":{"type":"object","properties":{"workspaceId":{"type":"string"},"caption":{"type":"string"},"sameCaption":{"type":"boolean"},"scheduledAt":{"type":["string","null"],"format":"date-time"},"timezone":{"type":"string"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/PostTargetInput"}},"mediaIds":{"type":"array","items":{"type":"string"}},"labelIds":{"type":"array","items":{"type":"string"}},"action":{"type":"string","enum":["draft","schedule","publish"]}}},"PostTarget":{"type":"object","properties":{"id":{"type":"string"},"socialAccountId":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":["string","null"]},"status":{"type":"string"}}},"caption":{"type":"string"},"settings":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["PENDING","PUBLISHING","PUBLISHED","FAILED"]},"externalId":{"type":["string","null"]},"externalUrl":{"type":["string","null"]},"error":{"type":["string","null"]},"attempts":{"type":"integer"},"publishedAt":{"type":["string","null"],"format":"date-time"}}},"Post":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PENDING_APPROVAL","REJECTED","SCHEDULED","PUBLISHING","PUBLISHED","PARTIAL","FAILED"]},"caption":{"type":"string"},"sameCaption":{"type":"boolean"},"scheduledAt":{"type":["string","null"],"format":"date-time"},"publishedAt":{"type":["string","null"],"format":"date-time"},"timezone":{"type":"string"},"approvalRequired":{"type":"boolean"},"source":{"type":"string"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"avatarUrl":{"type":["string","null"]}}},"targets":{"type":"array","items":{"$ref":"#/components/schemas/PostTarget"}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"},"thumbnailUrl":{"type":["string","null"]},"filename":{"type":"string"},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"alt":{"type":["string","null"]}}}},"labels":{"type":"array","items":{"$ref":"#/components/schemas/Label"}},"approvals":{"type":"array","description":"One row per approver. `step` is 1-based; later steps are asked (`askedAt`) once the earlier ones pass. SKIPPED: an \"any one\" step passed without them.","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","APPROVED","REJECTED","SKIPPED"]},"reason":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"step":{"type":"integer","minimum":1},"askedAt":{"type":["string","null"],"format":"date-time"},"approver":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}}}}},"approvalFlow":{"oneOf":[{"$ref":"#/components/schemas/ApprovalFlow"},{"type":"null"}],"description":"Read-only: the approval steps this post was sent with and where they stand. Null for a post that never needed approval."},"commentCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ApprovalFlow":{"type":"object","description":"Multi-level approval, read-only. Steps run in order; a step passes when any one of its approvers approves (rule \"any\") or when all of them do (rule \"all\"). A request for changes from anyone sends the post back to its author; the next submission is a new version that starts again from step 1. Set the flow in the dashboard (Workspace settings, or per post when sending it).","properties":{"status":{"type":"string","enum":["needs_approval","changes_requested","approved","scheduled","published","none"]},"complete":{"type":"boolean","description":"Every step passed."},"currentStep":{"type":["integer","null"],"description":"1-based step being asked now; null when complete or sent back."},"locked":{"type":"boolean","description":"Approved and the workspace locks approved posts: content edits return 409 LOCKED until it is unlocked in the dashboard. Rescheduling, publishing now and deleting still work."},"steps":{"type":"array","items":{"type":"object","properties":{"number":{"type":"integer"},"name":{"type":["string","null"]},"rule":{"type":"string","enum":["any","all"]},"state":{"type":"string","enum":["done","current","upcoming","changes"]},"approvers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"title":{"type":["string","null"],"description":"Designation, e.g. Account manager or Client (falls back to the role)."},"state":{"type":"string","enum":["approved","changes","waiting","not_asked","not_needed","idle"]},"decidedAt":{"type":["string","null"],"format":"date-time"}}}}}}}}},"Totals":{"type":"object","properties":{"followers":{"type":"integer"},"followersDelta":{"type":"integer"},"views":{"type":"integer"},"impressions":{"type":"integer"},"reach":{"type":"integer"},"likes":{"type":"integer"},"comments":{"type":"integer"},"shares":{"type":"integer"},"saves":{"type":"integer"},"clicks":{"type":"integer"},"engagement":{"type":"integer"},"engagementRate":{"type":["number","null"]},"posts":{"type":"integer"}}},"Delta":{"type":"object","properties":{"value":{"type":"number"},"previous":{"type":"number"},"changePct":{"type":["number","null"]}}},"SeriesPoint":{"type":"object","properties":{"date":{"type":"string","format":"date"},"followers":{"type":"integer"},"views":{"type":"integer"},"likes":{"type":"integer"},"comments":{"type":"integer"},"shares":{"type":"integer"},"saves":{"type":"integer"},"engagement":{"type":"integer"}}},"TopPost":{"type":"object","properties":{"postId":{"type":"string"},"targetId":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":"string"}}},"caption":{"type":"string"},"thumbnail":{"type":["string","null"]},"externalUrl":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"views":{"type":"integer"},"likes":{"type":"integer"},"comments":{"type":"integer"},"shares":{"type":"integer"},"saves":{"type":"integer"},"clicks":{"type":"integer"},"engagement":{"type":"integer"},"engagementRate":{"type":["number","null"]}}},"Overview":{"type":"object","properties":{"range":{"type":"object","properties":{"key":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"days":{"type":"integer"}}},"totals":{"$ref":"#/components/schemas/Totals"},"previous":{"$ref":"#/components/schemas/Totals"},"deltas":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Delta"}},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":"string"},"displayName":{"type":"string"},"followers":{"type":"integer"},"views":{"type":"integer"},"engagement":{"type":"integer"},"engagementRate":{"type":["number","null"]},"unavailable":{"type":"array","items":{"type":"string"},"description":"Numbers above that are not real zeros: not reported by the platform (X, TikTok, Bluesky report activity per post) or not readable on the last sync."}}}},"platforms":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"views":{"type":"integer"},"followers":{"type":"integer"},"engagement":{"type":"integer"},"accounts":{"type":"integer"}}}},"series":{"type":"array","items":{"$ref":"#/components/schemas/SeriesPoint"}},"topPosts":{"type":"array","items":{"$ref":"#/components/schemas/TopPost"}}}},"AccountAnalytics":{"type":"object","properties":{"account":{"allOf":[{"$ref":"#/components/schemas/SocialAccount"},{"type":"object","properties":{"unavailable":{"type":"array","items":{"type":"string"},"description":"Daily numbers in totals and series that are not real zeros for this account (not reported by the platform, or not readable on the last sync)."}}}]},"range":{"type":"object"},"totals":{"$ref":"#/components/schemas/Totals"},"previous":{"$ref":"#/components/schemas/Totals"},"deltas":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Delta"}},"series":{"type":"array","items":{"$ref":"#/components/schemas/SeriesPoint"}},"posts":{"type":"array","items":{"$ref":"#/components/schemas/TopPost"}}}},"InboxItem":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["COMMENT","MESSAGE","REVIEW","MENTION"]},"account":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":"string"}}},"externalId":{"type":["string","null"]},"conversationId":{"type":["string","null"]},"postTargetId":{"type":["string","null"]},"author":{"type":"object","properties":{"name":{"type":"string"},"handle":{"type":["string","null"]},"avatar":{"type":["string","null"]}}},"text":{"type":"string"},"rating":{"type":["integer","null"]},"sentiment":{"type":"string"},"isSpam":{"type":"boolean"},"isRead":{"type":"boolean"},"status":{"type":"string"},"likeCount":{"type":"integer"},"labels":{"type":"array","items":{"$ref":"#/components/schemas/Label"}},"replies":{"type":"array","items":{"$ref":"#/components/schemas/InboxReply"}},"occurredAt":{"type":"string","format":"date-time"}}},"InboxReply":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["SENT","FAILED","QUEUED"]},"externalId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}}},"MediaAsset":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"type":{"type":"string","enum":["IMAGE","VIDEO","GIF"]},"url":{"type":"string"},"thumbnailUrl":{"type":["string","null"]},"filename":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"integer"},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"duration":{"type":["integer","null"]},"alt":{"type":["string","null"]},"source":{"type":"string"},"folderId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}}},"PostVersion":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","minimum":1,"description":"1, 2, 3… per post"},"kind":{"type":"string","enum":["submitted","resubmitted","published","restored"],"description":"submitted: first sent for approval or scheduled; resubmitted: sent again; restored: sent again after restoring an earlier version (see restoredFrom); published: what went out differed from the approved version."},"outcome":{"type":"string","enum":["PENDING","APPROVED","REJECTED","CHANGES_REQUESTED","PUBLISHED","SUPERSEDED"]},"restoredFrom":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"},"publishedAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"avatarUrl":{"type":["string","null"]}}},"snapshot":{"$ref":"#/components/schemas/VersionSnapshot"},"decisions":{"type":"array","items":{"$ref":"#/components/schemas/VersionDecision"}},"changes":{"type":"array","items":{"type":"string"},"description":"What changed from the previous version, e.g. \"Caption edited\", \"1 image replaced\"."},"hiddenTargets":{"type":"integer","description":"Accounts left out because your access is restricted to other accounts."}}},"VersionSnapshot":{"type":"object","properties":{"caption":{"type":"string"},"sameCaption":{"type":"boolean"},"timezone":{"type":"string"},"scheduledAt":{"type":["string","null"],"format":"date-time"},"firstComment":{"type":["string","null"]},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string"},"username":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":["string","null"]},"caption":{"type":"string"},"settings":{"type":"object","additionalProperties":true}}}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"type":{"type":"string"},"thumbnailUrl":{"type":["string","null"]}}}},"labels":{"type":"array","items":{"$ref":"#/components/schemas/Label"}}}},"VersionDecision":{"type":"object","properties":{"approverId":{"type":"string"},"name":{"type":"string"},"role":{"type":["string","null"]},"decision":{"type":"string","enum":["PENDING","APPROVED","REJECTED","CHANGES_REQUESTED"]},"reason":{"type":["string","null"]},"decidedAt":{"type":["string","null"],"format":"date-time"}}},"Label":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}}},"HashtagSet":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"Report":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"compare":{"type":"string"},"accountIds":{"type":"array","items":{"type":"string"}},"shareToken":{"type":"string"},"url":{"type":"string","format":"uri"},"createdAt":{"type":"string","format":"date-time"}}}}}}