{"openapi":"3.1.0","info":{"title":"APIWings API","version":"1.0.0","description":"One request shape to publish on Instagram, Facebook, Threads, LinkedIn, TikTok, YouTube, Bluesky and X. Every error is JSON {code, error, platform_message?}; every response carries X-Request-Id."},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key: aw_live_… or aw_test_…"}},"schemas":{"Profile":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":["string","null"]},"name":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","external_id","name","created_at"]},"Error":{"type":"object","properties":{"code":{"type":"string","example":"validation_failed"},"error":{"type":"string"},"platform_message":{"type":"string"}},"required":["code","error"]},"ProfileList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Profile"}},"next_before":{"type":["string","null"],"format":"date-time"}},"required":["data","next_before"]},"ConnectResponse":{"type":"object","properties":{"connect_url":{"type":["string","null"],"format":"uri","description":"Hosted page to send the end user to; null when the account was connected directly"},"account_id":{"type":["string","null"],"format":"uuid"},"expires_at":{"type":["string","null"],"format":"date-time"}},"required":["connect_url","account_id","expires_at"]},"ConnectRequest":{"type":"object","properties":{"redirect_url":{"type":"string","format":"uri","description":"Where the end user returns after connecting. Receives ?status=connected&account_id=…&account_ids=…&platform=… (account_ids lists every account the consent granted, e.g. several Facebook Pages; account_id is the first) or ?status=error&code=…"},"bluesky":{"type":"object","properties":{"identifier":{"type":"string","minLength":1,"example":"yourname.bsky.social"},"app_password":{"type":"string","minLength":1}},"required":["identifier","app_password"],"description":"Connect Bluesky directly with an app password instead of the hosted page"}}},"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"profile_id":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["bluesky","linkedin","instagram","facebook","threads","tiktok","youtube","x"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"],"description":"Public profile picture from the platform, when it provides one"},"owner_name":{"type":["string","null"],"description":"Organization that owns the account, when the platform reports it (e.g. the Meta business portfolio of a Facebook Page)"},"status":{"type":"string","description":"active | expired | disconnected (open enum)"},"created_at":{"type":"string","format":"date-time"}},"required":["id","profile_id","platform","display_name","status","created_at"]},"PublishOptions":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["bluesky","linkedin","instagram","facebook","threads","tiktok","youtube","x"]},"required":{"type":"boolean","description":"true when the platform requires your posting screen to show this data before publishing (TikTok)"},"data":{"type":["object","null"],"additionalProperties":{},"description":"Live data from the platform for the posting screen, or null. TikTok: creator_nickname, creator_username, creator_avatar_url, privacy_level_options (offer exactly these, with no default), comment_disabled / duet_disabled / stitch_disabled (grey out those toggles), max_video_post_duration_sec, audited (false: posts stay private until TikTok audits APIWings)"}},"required":["account_id","platform","required","data"]},"AccountLimits":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["bluesky","linkedin","instagram","facebook","threads","tiktok","youtube","x"]},"limit":{"type":["integer","null"],"description":"Posts allowed in the platform's window, when the platform exposes it (Instagram 100/24 h, Threads 250/24 h)"},"remaining":{"type":["integer","null"],"description":"Posts left in that window, live from the platform; null when it doesn't say"},"resets_at":{"type":["string","null"],"format":"date-time"},"notes":{"type":["string","null"],"description":"How the platform limits this account when it has no live counter (rate limits, daily caps, per-post cost)"}},"required":["account_id","platform","limit","remaining","resets_at","notes"]},"PostTarget":{"type":"object","properties":{"platform":{"type":"string","enum":["bluesky","linkedin","instagram","facebook","threads","tiktok","youtube","x"]},"account_id":{"type":"string","format":"uuid"},"status":{"type":"string","description":"pending | publishing | published | failed | canceled (open enum)"},"remote_id":{"type":["string","null"]},"url":{"type":["string","null"]},"visibility":{"type":["string","null"],"description":"Real visibility returned by the platform: public | private | unlisted | self_only | draft (open enum). Never assumed."},"error":{"type":["object","null"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"platform_message":{"type":["string","null"]}},"required":["code","error","platform_message"]},"published_at":{"type":["string","null"],"format":"date-time"},"platform_cost_usd":{"type":["number","null"],"description":"What the platform charged for this post, in USD, passed on at cost (X pay-per-use). null for networks without a per-post fee."}},"required":["platform","account_id","status","remote_id","url","visibility","error","published_at"]},"Post":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"profile_id":{"type":"string","format":"uuid"},"status":{"type":"string","description":"scheduled | queued | done | canceled (open enum)"},"scheduled_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"platforms":{"type":"array","items":{"$ref":"#/components/schemas/PostTarget"}}},"required":["id","profile_id","status","scheduled_at","created_at","platforms"]},"PostTargetRequest":{"type":"object","properties":{"platform":{"type":"string","enum":["bluesky","linkedin","instagram","facebook","threads","tiktok","youtube","x"]},"account_id":{"type":"string","format":"uuid","description":"Optional when the profile has a single active account of this network"},"options":{"type":"object","additionalProperties":{},"description":"Network-specific options, validated by that network's connector (e.g. bluesky: {alt})"}},"required":["platform"]},"CreatePost":{"type":"object","properties":{"profile_id":{"type":"string","format":"uuid"},"content":{"type":"string","maxLength":10000},"media":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":10,"default":[],"description":"Media ids from POST /v1/media, in display order"},"media_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Public https URLs of images or videos (JPEG, PNG, WebP, GIF, MP4, MOV; up to 1 GB). APIWings downloads them before publishing; they go after `media`, in this order. Up to 10 media in total."},"platforms":{"type":"array","items":{"$ref":"#/components/schemas/PostTargetRequest"},"minItems":1,"maxItems":8},"scheduled_at":{"type":"string","format":"date-time","description":"ISO 8601; omitted or past = publish now"},"idempotency_key":{"type":"string","minLength":8,"maxLength":128,"description":"Required. Same key → same post, never published twice"}},"required":["profile_id","content","platforms","idempotency_key"]},"PostList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"next_before":{"type":["string","null"],"format":"date-time"}},"required":["data","next_before"]},"MediaUpload":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"upload_url":{"type":"string","format":"uri"},"upload_method":{"type":"string","enum":["PUT"]},"expires_in":{"type":"integer"},"expires_at":{"type":"string","format":"date-time"}},"required":["id","upload_url","upload_method","expires_in","expires_at"]},"CreateMediaRequest":{"type":"object","properties":{"mime":{"type":"string","enum":["image/jpeg","image/png","image/webp","image/gif","video/mp4","video/quicktime"]},"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":1073741824}},"required":["mime","bytes"]},"Media":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["image","video"]},"mime":{"type":"string"},"status":{"type":"string","description":"pending (not uploaded yet) | ready (open enum)"},"expires_at":{"type":"string","format":"date-time"}},"required":["id","kind","mime","status","expires_at"]},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"}},"required":["id","url","events","created_at"]},"WebhookWithSecret":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}]},"CreateWebhook":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public https URL"},"events":{"type":"array","items":{"type":"string","enum":["post.published","post.failed","account.disconnected","account.expiring"]},"minItems":1}},"required":["url","events"]},"Branding":{"type":"object","properties":{"name":{"type":["string","null"],"minLength":1,"maxLength":60,"description":"Shown instead of APIWings on the hosted connect pages"},"logo_url":{"type":["string","null"],"maxLength":500,"format":"uri","description":"Public https image shown above the title"},"color":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$","description":"Accent color, #RRGGBB (buttons, focus ring)"}},"required":["name","logo_url","color"]},"SetBranding":{"type":"object","properties":{"name":{"type":["string","null"],"minLength":1,"maxLength":60,"description":"Shown instead of APIWings on the hosted connect pages"},"logo_url":{"type":["string","null"],"maxLength":500,"format":"uri","description":"Public https image shown above the title"},"color":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$","description":"Accent color, #RRGGBB (buttons, focus ring)"}}},"PlatformUsage":{"type":"object","properties":{"platform":{"type":"string","enum":["bluesky","linkedin","instagram","facebook","threads","tiktok","youtube","x"]},"published":{"type":"integer","description":"Publications that went out on this network in the month"},"failed":{"type":"integer","description":"Publications that failed for good in the month (after retries)"},"video_posts":{"type":"integer","description":"Of the published ones, how many carried at least one video"},"platform_cost_usd":{"type":"number","description":"What this network charged for the published ones, in USD, passed on at cost (X pay-per-use); 0 for free networks"}},"required":["platform","published","failed","video_posts","platform_cost_usd"]},"PlatformAccounts":{"type":"object","properties":{"platform":{"type":"string","enum":["bluesky","linkedin","instagram","facebook","threads","tiktok","youtube","x"]},"total":{"type":"integer"}},"required":["platform","total"]},"Usage":{"type":"object","properties":{"month":{"type":"string","description":"Calendar month (UTC), YYYY-MM","example":"2026-11"},"period_start":{"type":"string","format":"date-time","description":"Start of the month, UTC (inclusive)"},"period_end":{"type":"string","format":"date-time","description":"Start of the next month, UTC (exclusive)"},"posts":{"type":"object","properties":{"total":{"type":"integer","description":"published + failed"},"published":{"type":"integer"},"failed":{"type":"integer"}},"required":["total","published","failed"],"description":"Publications: one post on one network counts as one (a post sent to 3 networks = 3). Published ones count in the month they went out; failed ones in the month they failed. Pending, scheduled and canceled ones don't count."},"by_platform":{"type":"array","items":{"$ref":"#/components/schemas/PlatformUsage"},"description":"Networks with at least one publication in the month, alphabetically"},"connected_accounts":{"type":"object","properties":{"total":{"type":"integer"},"by_platform":{"type":"array","items":{"$ref":"#/components/schemas/PlatformAccounts"}}},"required":["total","by_platform"],"description":"Active connected accounts right now (not at the end of that month): expired and disconnected ones don't count"},"platform_cost_usd_total":{"type":"number","description":"Sum of platform_cost_usd over all networks in the month"},"spend_cap_usd":{"type":"number","description":"Your monthly cap on what paid networks (X) may cost; 0 = paid networks not included in your plan"}},"required":["month","period_start","period_end","posts","by_platform","connected_accounts","platform_cost_usd_total","spend_cap_usd"]}},"parameters":{}},"paths":{"/v1/profiles":{"post":{"tags":["Profiles"],"operationId":"createProfile","summary":"Create a profile (one end customer of your SaaS)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"external_id":{"type":"string","maxLength":200},"name":{"type":"string","maxLength":200}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key not allowed to perform this action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Profiles"],"operationId":"listProfiles","summary":"List profiles, newest first","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"Page size (default 50, max 200)"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Cursor: next_before from the previous page"},"required":false,"name":"before","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileList"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/profiles/{id}":{"get":{"tags":["Profiles"],"operationId":"getProfile","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Profiles"],"operationId":"deleteProfile","summary":"Delete a profile; its accounts and data are erased within 24 h","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/profiles/{id}/connect/{platform}":{"post":{"tags":["Connect"],"operationId":"connectAccount","summary":"Start connecting a social account to a profile","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["bluesky","linkedin","instagram","facebook","threads","tiktok","youtube","x"]},"required":true,"name":"platform","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectRequest"}}}},"responses":{"200":{"description":"Hosted connect URL, or the connected account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectResponse"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/profiles/{id}/accounts":{"get":{"tags":["Connect"],"operationId":"listAccounts","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}},"required":["data"]}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}":{"delete":{"tags":["Connect"],"operationId":"disconnectAccount","summary":"Disconnect an account: its tokens are destroyed and account.disconnected is sent","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Disconnected"},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/publish-options":{"get":{"tags":["Connect"],"operationId":"getPublishOptions","summary":"Live data your posting screen must show before publishing to this account (TikTok)","description":"Call it each time the posting screen opens. TikTok requires showing the creator's nickname, letting the user choose a privacy level from privacy_level_options (no default), leaving comments/duet/stitch off until the user turns them on, and a commercial content disclosure. Other platforms return required=false.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Publish options","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOptions"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform did not answer in time, or failed; retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/limits":{"get":{"tags":["Connect"],"operationId":"getAccountLimits","summary":"How many posts this account can still publish, live from the platform when it says","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLimits"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform did not answer in time, or failed; retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts":{"post":{"tags":["Posts"],"operationId":"createPost","summary":"Publish now or schedule one post on several networks","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePost"}}}},"responses":{"200":{"description":"Idempotent replay: the post created earlier with this idempotency_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"202":{"description":"Accepted; one job per network","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Posts"],"operationId":"listPosts","summary":"List posts, newest first, with each network's result","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"Page size (default 50, max 200)"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Cursor: next_before from the previous page"},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only this profile's posts"},"required":false,"name":"profile_id","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostList"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}":{"get":{"tags":["Posts"],"operationId":"getPost","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Posts"],"operationId":"cancelPost","summary":"Cancel a scheduled post that has not started publishing","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Canceled"},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/media":{"post":{"tags":["Media"],"operationId":"createMedia","summary":"Get a presigned URL, then PUT the file to it (Content-Type must match)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMediaRequest"}}}},"responses":{"201":{"description":"Upload URL (valid 15 min); media expires after 7 days","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUpload"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/media/{id}":{"get":{"tags":["Media"],"operationId":"getMedia","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"post":{"tags":["Webhooks"],"operationId":"createWebhook","summary":"Subscribe to events. Deliveries are signed: X-APIWings-Signature: t=<ms>,v1=HMAC_SHA256(secret, `${t}.${body}`)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhook"}}}},"responses":{"201":{"description":"Created; the secret is shown only once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecret"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key not allowed to perform this action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Webhooks"],"operationId":"listWebhooks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}},"required":["data"]}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key not allowed to perform this action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"delete":{"tags":["Webhooks"],"operationId":"deleteWebhook","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key not allowed to perform this action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/branding":{"get":{"tags":["Branding"],"operationId":"getBranding","summary":"White label of the hosted connect pages (all null = APIWings branding)","responses":{"200":{"description":"Current branding","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Branding"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key not allowed to perform this action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Branding"],"operationId":"setBranding","summary":"Set the white label of the hosted connect pages; fields you omit are kept, null clears one","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetBranding"}}}},"responses":{"200":{"description":"Branding after the change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Branding"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key not allowed to perform this action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"tags":["Usage"],"operationId":"getUsage","summary":"Usage in a calendar month: publications per network, video posts, paid-network cost and connected accounts","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$","description":"Calendar month (UTC), YYYY-MM; default the current one. History is kept for 13 months.","example":"2026-11"},"required":false,"name":"month","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only this profile's usage (e.g. to bill one of your own customers). Keys restricted to a profile always get that profile's usage."},"required":false,"name":"profile_id","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}