Social Relay API

Publish, schedule and analyze TikTok and Instagram 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 posts are published at `scheduled_at` (or right away).

Base URL: https://social.sagiware.com/api/v1 · Machine-readable spec: openapi.json

# 1. Upload a video (raw body) or pass {"url": "..."} as JSON
curl -X POST https://social.sagiware.com/api/v1/media \
  -H "Authorization: Bearer $KEY" -H "Content-Type: video/mp4" \
  --data-binary @clip.mp4

# 2. Post it to Instagram as a Reel tomorrow, and queue it for TikTok approval
curl -X POST https://social.sagiware.com/api/v1/posts \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: launch-video-1" \
  -d '{"account_ids":["<instagram id>","<tiktok id>"],"media_ids":["<media id>"],
       "caption":"New drop #launch","scheduled_at":"2026-10-16T09:00:00Z"}'

# 3. Check engagement
curl https://social.sagiware.com/api/v1/posts?status=published -H "Authorization: Bearer $KEY"
get/accounts
List connected accounts

Scope: read.

get/accounts/{id}
Get an account with its latest follower stats

Scope: read.

delete/accounts/{id}
Disconnect an account

Scope: write. Revokes access and deletes its posts and metrics.

get/accounts/{id}/creator-info
TikTok creator info

Scope: read. Current privacy options, disabled interactions, max video duration and whether the account can post now.

get/accounts/{id}/media
Posts on the profile, with engagement

Scope: read. Includes posts made outside this app. TikTok: views, likes, comments, shares. Instagram: likes, comments.

get/accounts/{id}/insights
Account insights

Scope: read. Follower history from daily snapshots plus, for Instagram, reach, views, interactions, profile views and follower demographics.

get/accounts/{id}/comments
List comments on an Instagram media

Scope: comments. Instagram only.

post/accounts/{id}/comments/{commentId}
Reply to, hide or unhide a comment

Scope: comments. Instagram only.

delete/accounts/{id}/comments/{commentId}
Delete a comment

Scope: comments. Instagram only.

post/media
Upload media

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.

get/posts
List posts (history)

Scope: read. Newest first, with latest metrics.

post/posts
Create posts

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.

get/posts/{id}
Get a post

Scope: read. Status: awaiting_approval, scheduled, publishing, processing, published, failed, cancelled.

patch/posts/{id}
Edit a post before it publishes

Scope: write. caption, title, scheduled_at, instagram.type. Editing a TikTok post sends it back for approval.

delete/posts/{id}
Cancel a post

Scope: write. Only awaiting_approval or scheduled posts.

get/posts/{id}/metrics
Post metrics over time

Scope: read. Snapshots every 6 hours for 60 days after publishing.