{"openapi":"3.1.0","info":{"title":"Onepostly API","version":"1.0.0","description":"One API for all social media. Authenticate with a workspace API key (`op_…`).","contact":{"name":"Onepostly","url":"https://onepostly.com"}},"servers":[{"url":"https://api.onepostly.com","description":"Production"}],"tags":[{"name":"Connections","description":"List accounts and start OAuth connect."},{"name":"Media","description":"Upload and manage media assets."},{"name":"Posts","description":"Create, list, schedule, and remote-delete posts."},{"name":"Insights","description":"Normalized engagement metrics per destination."},{"name":"Comments","description":"List and reply to comments on published destinations."},{"name":"Engagement","description":"Retweet, like, bookmark, and quote actions (X)."},{"name":"Webhooks","description":"Receive delivery lifecycle events."}],"security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Workspace API key (`op_…`). Create keys in the dashboard."},"ApiKeyBearer":{"type":"http","scheme":"bearer","bearerFormat":"op_","description":"Same key as `Authorization: Bearer op_…`."}},"schemas":{"Connection":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"platform":{"type":"string"},"displayName":{"type":"string"},"handle":{"type":"string"},"avatarUrl":{"type":["string","null"],"format":"uri"},"status":{"type":"string"},"authHealth":{"type":"string","enum":["healthy","action_required"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","platform","status","authHealth"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","examples":["VALIDATION_ERROR","INSUFFICIENT_WALLET","NOT_FOUND"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"MediaAsset":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"contentType":{"type":"string"},"sizeBytes":{"type":"number"}},"required":["id","url","contentType"]},"PostResponse":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/Post"}},"required":["post"]},"Post":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"text":{"type":"string"},"mediaUrls":{"type":"array","items":{"type":"string","format":"uri"}},"mediaKind":{"$ref":"#/components/schemas/MediaKind"},"status":{"$ref":"#/components/schemas/PostStatus"},"scheduledFor":{"type":["string","null"],"description":"Timezone-naive local datetime in `timezone` (e.g. 2026-07-16T12:00:00).","examples":["2026-07-16T12:00:00"]},"timezone":{"type":["string","null"],"description":"IANA timezone for `scheduledFor`.","examples":["America/New_York"]},"destinations":{"type":"array","items":{"$ref":"#/components/schemas/PostDestination"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","text","mediaUrls","mediaKind","status","scheduledFor","timezone","destinations","createdAt","updatedAt"]},"MediaKind":{"type":"string","enum":["text","image","multi-image","video","stories"]},"PostStatus":{"type":"string","enum":["queued","processing","published","failed","scheduled","cancelled","deleted"]},"PostDestination":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"connectionId":{"type":"string","format":"uuid"},"platform":{"type":"string","examples":["x","instagram","facebook","threads","linkedin","youtube","tiktok","pinterest","reddit"]},"status":{"$ref":"#/components/schemas/DestinationStatus"},"externalPostId":{"type":["string","null"]},"externalUrl":{"type":["string","null"],"format":"uri"},"errorCode":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","connectionId","platform","status","externalPostId","externalUrl","errorCode","errorMessage","publishedAt"]},"DestinationStatus":{"type":"string","enum":["queued","processing","published","failed","scheduled","cancelled","deleted"]},"CreatePostBody":{"type":"object","properties":{"text":{"type":"string","maxLength":5000,"default":""},"thread":{"type":"array","items":{"type":"string","maxLength":5000},"minItems":2,"maxItems":25},"mediaUrls":{"type":"array","items":{"type":"string","maxLength":2048,"format":"uri"},"maxItems":10,"default":[]},"mediaKind":{"$ref":"#/components/schemas/MediaKind"},"scheduledFor":{"type":"string","minLength":1,"maxLength":32},"timezone":{"type":"string","minLength":1,"maxLength":64},"destinations":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","minLength":1,"maxLength":128},"text":{"type":"string","maxLength":5000},"quoteTweetId":{"type":"string","minLength":1,"maxLength":64},"privacyStatus":{"type":"string","enum":["public","private","unlisted"]},"privacyLevel":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganicToggle":{"type":"boolean"},"brandContentToggle":{"type":"boolean"},"description":{"type":"string","maxLength":5000},"boardId":{"type":"string","minLength":1,"maxLength":64},"link":{"type":"string","maxLength":2048,"format":"uri"},"title":{"type":"string","minLength":1,"maxLength":300},"subreddit":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_]+$"},"flairId":{"type":"string","minLength":1,"maxLength":64},"flairText":{"type":"string","minLength":1,"maxLength":64},"nsfw":{"type":"boolean"},"spoiler":{"type":"boolean"},"thumbnailUrl":{"type":"string","maxLength":2048,"format":"uri"}},"required":["connectionId"]},"minItems":1,"maxItems":50}},"required":["destinations"]},"NormalizedMetrics":{"type":"object","properties":{"impressions":{"type":["number","null"]},"reach":{"type":["number","null"]},"likes":{"type":["number","null"]},"comments":{"type":["number","null"]},"shares":{"type":["number","null"]},"saves":{"type":["number","null"]},"plays":{"type":["number","null"]},"engagement":{"type":["number","null"]}}},"Comment":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"username":{"type":["string","null"]},"likeCount":{"type":["number","null"]},"timestamp":{"type":["string","null"]},"parentId":{"type":["string","null"]},"replies":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}},"required":["id","text"]},"CreateCommentBody":{"type":"object","properties":{"destinationId":{"type":"string","minLength":1},"text":{"type":"string","minLength":1,"maxLength":2000},"parentCommentId":{"type":"string","minLength":1}},"required":["destinationId","text"]},"Actor":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"],"format":"uri"}},"required":["id"]},"DestinationIdBody":{"type":"object","properties":{"destinationId":{"type":"string","minLength":1}},"required":["destinationId"]},"QuoteBody":{"type":"object","properties":{"destinationId":{"type":"string","minLength":1},"text":{"type":"string","minLength":1,"maxLength":5000}},"required":["destinationId","text"]},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"enabled":{"type":"boolean"},"events":{"type":"array","items":{"type":"string"}}},"required":["id","name","url"]},"CreateWebhookBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","maxLength":2048,"format":"uri"},"secret":{"type":"string","minLength":16,"maxLength":128},"events":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":22},"enabled":{"type":"boolean","default":true}},"required":["name","url","events"]},"UpdateWebhookBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","maxLength":2048,"format":"uri"},"events":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":22},"enabled":{"type":"boolean"}}}},"parameters":{}},"paths":{"/v1/connections":{"get":{"tags":["Connections"],"summary":"List connections","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"responses":{"200":{"description":"Connected accounts","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"type":"array","items":{"$ref":"#/components/schemas/Connection"}}},"required":["connections"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connections/{id}/stats":{"get":{"tags":["Connections"],"summary":"Get connection account stats","description":"Live follower / following / likes / video counts when the platform supports it (e.g. TikTok).","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Account stats","content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string"},"platform":{"type":"string"},"status":{"type":"string"},"stats":{"type":["object","null"],"additionalProperties":{}},"fetchedAt":{"type":"string","format":"date-time"}},"required":["connectionId","platform","status","fetchedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connections/{id}/media":{"get":{"tags":["Connections"],"summary":"List creator media","description":"Paginated public creator media for platforms that support it (e.g. TikTok).","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":20,"description":"Page size (1–20, default 10)."},"required":false,"description":"Page size (1–20, default 10).","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor from the previous response."},"required":false,"description":"Pagination cursor from the previous response.","name":"cursor","in":"query"}],"responses":{"200":{"description":"Creator media page","content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string"},"platform":{"type":"string"},"items":{"type":"array","items":{"type":"object","additionalProperties":{}}},"nextCursor":{"type":["string","null"]}},"required":["connectionId","platform","items","nextCursor"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connections/{id}/tiktok/creator-info":{"get":{"tags":["Connections"],"summary":"Get TikTok creator info","description":"TikTok-only. Returns privacy options and publish constraints for the connected creator.","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Creator info","content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string"},"platform":{"type":"string","enum":["tiktok"]},"creatorInfo":{"type":"object","properties":{"creatorAvatarUrl":{"type":["string","null"]},"creatorUsername":{"type":["string","null"]},"creatorNickname":{"type":["string","null"]},"privacyLevelOptions":{"type":"array","items":{"type":"string"}},"commentDisabled":{"type":"boolean"},"duetDisabled":{"type":"boolean"},"stitchDisabled":{"type":"boolean"},"maxVideoPostDurationSec":{"type":["number","null"]}},"required":["creatorAvatarUrl","creatorUsername","creatorNickname","privacyLevelOptions","commentDisabled","duetDisabled","stitchDisabled","maxVideoPostDurationSec"]},"fetchedAt":{"type":"string","format":"date-time"}},"required":["connectionId","platform","creatorInfo","fetchedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connections/{id}/pinterest/boards":{"get":{"tags":["Connections"],"summary":"List Pinterest boards","description":"Pinterest-only. Boards available for pin destinations.","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Boards","content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string"},"platform":{"type":"string","enum":["pinterest"]},"boards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"defaultBoardId":{"type":["string","null"]},"sandbox":{"type":"boolean"},"fetchedAt":{"type":"string","format":"date-time"}},"required":["connectionId","platform","boards","defaultBoardId","sandbox","fetchedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Connections"],"summary":"Create Pinterest board","description":"Pinterest-only. Creates a board on the connected account.","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":180},"description":{"type":"string","maxLength":500}},"required":["name"]}}}},"responses":{"201":{"description":"Created board","content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string"},"platform":{"type":"string","enum":["pinterest"]},"board":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"sandbox":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["connectionId","platform","board","sandbox","createdAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connections/{id}/reddit/subreddits":{"get":{"tags":["Connections"],"summary":"List Reddit subreddits","description":"Reddit-only. Communities the connected account is subscribed to.","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Subreddits","content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string"},"platform":{"type":"string","enum":["reddit"]},"subreddits":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"title":{"type":"string"},"subscribers":{"type":["number","null"]},"nsfw":{"type":"boolean"},"iconUrl":{"type":["string","null"]}},"required":["name","title","subscribers","nsfw","iconUrl"]}},"fetchedAt":{"type":"string","format":"date-time"}},"required":["connectionId","platform","subreddits","fetchedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connections/{id}/reddit/subreddits/{name}/flairs":{"get":{"tags":["Connections"],"summary":"List Reddit link flairs","description":"Reddit-only. Link flair templates for a subreddit (often required to post).","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Subreddit name without the `r/` prefix.","examples":["test"]},"required":true,"description":"Subreddit name without the `r/` prefix.","name":"name","in":"path"}],"responses":{"200":{"description":"Flairs","content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string"},"platform":{"type":"string","enum":["reddit"]},"subreddit":{"type":"string"},"flairs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"textEditable":{"type":"boolean"},"backgroundColor":{"type":["string","null"]},"textColor":{"type":["string","null"]}},"required":["id","text","textEditable","backgroundColor","textColor"]}},"fetchedAt":{"type":"string","format":"date-time"}},"required":["connectionId","platform","subreddit","flairs","fetchedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connections/oauth/{platform}/start":{"get":{"tags":["Connections"],"summary":"Start OAuth connect","description":"Returns a platform authorization URL. API keys require `redirect_url`. Dashboard session may omit it.","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["x","instagram","facebook","threads","linkedin","youtube"]},"required":true,"name":"platform","in":"path"},{"schema":{"type":"string","description":"Required for API-key starts. Browser returns here after OAuth."},"required":false,"description":"Required for API-key starts. Browser returns here after OAuth.","name":"redirect_url","in":"query"},{"schema":{"type":"string","description":"Existing connection id to re-authorize without consuming a plan slot."},"required":false,"description":"Existing connection id to re-authorize without consuming a plan slot.","name":"reconnect","in":"query"},{"schema":{"type":"string","description":"Facebook only. When true/1, skip hosted page picker and return tempToken to redirect_url."},"required":false,"description":"Facebook only. When true/1, skip hosted page picker and return tempToken to redirect_url.","name":"headless","in":"query"}],"responses":{"200":{"description":"Authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connections/oauth/facebook/pages":{"get":{"tags":["Connections"],"summary":"List Facebook Pages for pending connect","description":"After Facebook OAuth, list Pages the user can select. Requires tempToken from the callback.","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"tempToken","in":"query"}],"responses":{"200":{"description":"Selectable Pages","content":{"application/json":{"schema":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"username":{"type":["string","null"]},"category":{"type":["string","null"]},"pictureUrl":{"type":["string","null"]}},"required":["id","name","username","category","pictureUrl"]}}},"required":["pages"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connections/oauth/facebook/select":{"post":{"tags":["Connections"],"summary":"Select Facebook Page and finish connect","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tempToken":{"type":"string","minLength":1},"pageId":{"type":"string","minLength":1},"redirect_url":{"type":"string"}},"required":["tempToken","pageId"]}}}},"responses":{"200":{"description":"Connected Page","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/Connection"},"redirect_url":{"type":"string","format":"uri"}},"required":["connection","redirect_url"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/media":{"post":{"tags":["Media"],"summary":"Upload media","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"Uploaded media","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"$ref":"#/components/schemas/MediaAsset"}},"required":["media"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Media"],"summary":"List media","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Page size (default varies by endpoint)."},"required":false,"description":"Page size (default varies by endpoint).","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"description":"Offset for list endpoints."},"required":false,"description":"Offset for list endpoints.","name":"offset","in":"query"}],"responses":{"200":{"description":"Media list","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"type":"array","items":{"$ref":"#/components/schemas/MediaAsset"}}},"required":["media"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/media/{id}":{"delete":{"tags":["Media"],"summary":"Delete media","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts":{"post":{"tags":["Posts"],"summary":"Create post","description":"Creates a post for one or more destinations. Returns `202` for immediate publish, or `201` when scheduled. X billable actions debit the workspace wallet.","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostBody"}}}},"responses":{"201":{"description":"Scheduled (not yet publishing)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"202":{"description":"Accepted for immediate publish","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Posts"],"summary":"List posts","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Page size (default varies by endpoint)."},"required":false,"description":"Page size (default varies by endpoint).","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"description":"Offset for list endpoints."},"required":false,"description":"Offset for list endpoints.","name":"offset","in":"query"}],"responses":{"200":{"description":"Posts","content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"type":"array","items":{"$ref":"#/components/schemas/Post"}}},"required":["posts"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}":{"get":{"tags":["Posts"],"summary":"Get post","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Posts"],"summary":"Cancel post","description":"Cancels a queued/processing/scheduled post. Does not remote-delete published content.","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/destinations/{destinationId}":{"delete":{"tags":["Posts"],"summary":"Remote-delete destination","description":"Deletes the published post on the platform (e.g. X). For X threads, all thread tweet ids are deleted.","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"destinationId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/insights":{"get":{"tags":["Insights"],"summary":"Get insights","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Pass `1` or `true` to bypass cache."},"required":false,"description":"Pass `1` or `true` to bypass cache.","name":"refresh","in":"query"}],"responses":{"200":{"description":"Normalized insights","content":{"application/json":{"schema":{"type":"object","properties":{"insights":{"type":"object","properties":{"postId":{"type":"string"},"status":{"type":"string"},"destinations":{"type":"array","items":{"type":"object","properties":{"destinationId":{"type":"string"},"platform":{"type":"string"},"status":{"type":"string"},"metrics":{"$ref":"#/components/schemas/NormalizedMetrics"}},"required":["destinationId","platform"]}}},"required":["postId"]}},"required":["insights"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/comments":{"get":{"tags":["Comments"],"summary":"List comments","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"destinationId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Requires destinationId"},"required":false,"description":"Requires destinationId","name":"cursor","in":"query"}],"responses":{"200":{"description":"Comments","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Comments"],"summary":"Create reply","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCommentBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/Comment"}},"required":["comment"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/comments/{commentId}":{"delete":{"tags":["Comments"],"summary":"Delete own comment","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"commentId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"destinationId","in":"query"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/retweets":{"get":{"tags":["Engagement"],"summary":"List retweeters","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"destinationId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Retweeters","content":{"application/json":{"schema":{"type":"object","properties":{"retweets":{"type":"object","properties":{"postId":{"type":"string"},"destinations":{"type":"array","items":{"type":"object","properties":{"destinationId":{"type":"string"},"status":{"type":"string"},"actors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"nextCursor":{"type":["string","null"]}},"required":["destinationId"]}}}}},"required":["retweets"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Engagement"],"summary":"Retweet","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationIdBody"}}}},"responses":{"201":{"description":"Retweeted","content":{"application/json":{"schema":{"type":"object","properties":{"retweet":{}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Engagement"],"summary":"Undo retweet","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"destinationId","in":"query"}],"responses":{"200":{"description":"Unretweeted","content":{"application/json":{"schema":{"type":"object","properties":{"retweet":{}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/likes":{"post":{"tags":["Engagement"],"summary":"Like","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationIdBody"}}}},"responses":{"201":{"description":"Liked","content":{"application/json":{"schema":{"type":"object","properties":{"like":{}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Engagement"],"summary":"Unlike","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"destinationId","in":"query"}],"responses":{"200":{"description":"Unliked","content":{"application/json":{"schema":{"type":"object","properties":{"like":{}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/bookmarks":{"post":{"tags":["Engagement"],"summary":"Bookmark","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationIdBody"}}}},"responses":{"201":{"description":"Bookmarked","content":{"application/json":{"schema":{"type":"object","properties":{"bookmark":{}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Engagement"],"summary":"Remove bookmark","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"destinationId","in":"query"}],"responses":{"200":{"description":"Unbookmarked","content":{"application/json":{"schema":{"type":"object","properties":{"bookmark":{}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/quotes":{"post":{"tags":["Engagement"],"summary":"Quote tweet","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteBody"}}}},"responses":{"201":{"description":"Quoted","content":{"application/json":{"schema":{"type":"object","properties":{"quote":{}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream platform error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/events":{"get":{"tags":["Webhooks"],"summary":"List webhook event types","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"responses":{"200":{"description":"Event catalog","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"string"}},"groups":{"type":"array","items":{}}},"required":["events","groups"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"responses":{"200":{"description":"Webhooks","content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}},"required":["webhooks"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create webhook","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookBody"}}}},"responses":{"201":{"description":"Created (secret shown once)","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"$ref":"#/components/schemas/Webhook"}},"required":["webhook"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"get":{"tags":["Webhooks"],"summary":"Get webhook","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Webhook","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"$ref":"#/components/schemas/Webhook"}},"required":["webhook"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Webhooks"],"summary":"Update webhook","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookBody"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"$ref":"#/components/schemas/Webhook"}},"required":["webhook"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Webhooks"],"summary":"Delete webhook","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/rotate-secret":{"post":{"tags":["Webhooks"],"summary":"Rotate webhook secret","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Rotated (new secret shown once)","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"$ref":"#/components/schemas/Webhook"}},"required":["webhook"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"List webhook deliveries","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Page size (default varies by endpoint)."},"required":false,"description":"Page size (default varies by endpoint).","name":"limit","in":"query"}],"responses":{"200":{"description":"Deliveries","content":{"application/json":{"schema":{"type":"object","properties":{"deliveries":{"type":"array","items":{}}},"required":["deliveries"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send test event","security":[{"ApiKeyHeader":[]},{"ApiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"examples":["1699f415-7fb6-43f4-9d2a-c447491f32a8"]},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Test event accepted","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}