{"openapi":"3.1.0","info":{"title":"Social Relay API","version":"1.0.0","description":"Publish, schedule and analyze TikTok, Instagram and YouTube content. Authenticate with `Authorization: Bearer <api key>` (create keys in Settings). Errors are `{ \"error\": { \"code\", \"message\" } }`. Limit: 120 requests per minute per key. TikTok posts created with an API key get status `awaiting_approval`: the account owner reviews and confirms them in the dashboard, as TikTok requires. Instagram and YouTube posts are published at `scheduled_at` (or right away)."},"servers":[{"url":"https://social.sagiware.com/api/v1"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"security":[{"bearer":[]}],"paths":{"/accounts":{"get":{"summary":"List connected accounts","description":"Scope: read.","responses":{"200":{"description":"OK"}}}},"/accounts/{id}":{"get":{"summary":"Get an account with its latest follower stats","description":"Scope: read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"delete":{"summary":"Disconnect an account","description":"Scope: write. Revokes access and deletes its posts and metrics.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/accounts/{id}/creator-info":{"get":{"summary":"TikTok creator info","description":"Scope: read. Current privacy options, disabled interactions, max video duration and whether the account can post now.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/accounts/{id}/media":{"get":{"summary":"Posts on the profile, with engagement","description":"Scope: read. Includes posts made outside this app. TikTok: views, likes, comments, shares. Instagram: likes, comments. YouTube: views, likes, comments.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/accounts/{id}/insights":{"get":{"summary":"Account insights","description":"Scope: read. Follower history from daily snapshots plus, for Instagram, reach, views, interactions, profile views and follower demographics; for YouTube, YouTube Analytics (views, watch time, average view duration, subscribers gained/lost, likes, comments, shares, top countries).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/accounts/{id}/comments":{"get":{"summary":"List comments on an Instagram media or YouTube video","description":"Scope: comments. Instagram and YouTube. media_id is the Instagram media id or YouTube video id.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"media_id","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/accounts/{id}/comments/{commentId}":{"post":{"summary":"Reply to, hide or unhide a comment","description":"Scope: comments. Instagram and YouTube (on YouTube, hide removes the comment from public view on your video).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"enum":["reply","hide","unhide"]},"message":{"type":"string"}}}}}},"responses":{"200":{"description":"OK"}}},"delete":{"summary":"Delete a comment","description":"Scope: comments. Instagram and YouTube (others' YouTube comments are removed from your video instead).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/media":{"post":{"summary":"Upload media","description":"Scope: write. Send the file as the raw body with its Content-Type (image/jpeg, image/png, image/webp, video/mp4, video/quicktime), or JSON `{\"url\": \"https://...\"}` to have the server download it. Returns `id` for `media_ids`. Unused media is deleted after 7 days.","requestBody":{"content":{"video/mp4":{},"image/jpeg":{},"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}}}}}},"responses":{"201":{"description":"Created"}}}},"/posts":{"get":{"summary":"List posts (history)","description":"Scope: read. Newest first, with latest metrics.","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"account_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"post":{"summary":"Create posts","description":"Scope: write. Creates one post per account. Optional `Idempotency-Key` header makes retries safe. Instagram `type`: FEED (1 JPEG), REELS (1 video), STORIES (1 image or video), CAROUSEL (2-10 items); inferred when omitted.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["account_ids","media_ids"],"properties":{"account_ids":{"type":"array","items":{"type":"string"}},"media_ids":{"type":"array","items":{"type":"string"}},"caption":{"type":"string"},"title":{"type":"string","description":"TikTok photo posts only (max 90 chars)."},"scheduled_at":{"type":"string","format":"date-time","description":"Omit to publish now."},"instagram":{"type":"object","properties":{"type":{"enum":["FEED","REELS","STORIES","CAROUSEL"]}}},"tiktok":{"type":"object","description":"Dashboard only. TikTok options are ignored for API-key requests: the account owner picks them when approving.","properties":{"privacy_level":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"allow_comment":{"type":"boolean"},"allow_duet":{"type":"boolean"},"allow_stitch":{"type":"boolean"},"commercial":{"type":"boolean"},"your_brand":{"type":"boolean"},"branded_content":{"type":"boolean"}}},"youtube":{"type":"object","description":"Required for YouTube accounts. Square/vertical videos up to 3 minutes are published as Shorts automatically. privacy and made_for_kids have no default and must be set. title defaults to the top-level title or the first caption line.","properties":{"title":{"type":"string","maxLength":100},"privacy":{"enum":["public","unlisted","private"]},"made_for_kids":{"type":"boolean"},"synthetic":{"type":"boolean","description":"Altered or synthetic (AI) content disclosure"},"category_id":{"type":"string","description":"YouTube category id, default 22 (People & Blogs)"},"tags":{"type":"array","items":{"type":"string"}},"notify_subscribers":{"type":"boolean","default":true},"shorts_hashtag":{"type":"boolean","description":"Append #Shorts to the title when the video is a Short"}}}}}}}},"responses":{"201":{"description":"Created"}}}},"/posts/{id}":{"get":{"summary":"Get a post","description":"Scope: read. Status: awaiting_approval, scheduled, publishing, processing, published, failed, cancelled.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"patch":{"summary":"Edit a post before it publishes","description":"Scope: write. caption, title, scheduled_at, instagram.type, youtube.*. Editing a TikTok post sends it back for approval.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"delete":{"summary":"Cancel a post","description":"Scope: write. Only awaiting_approval or scheduled posts.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/posts/{id}/metrics":{"get":{"summary":"Post metrics over time","description":"Scope: read. Snapshots every 6 hours for 60 days after publishing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}}}