Allow marketing tracking?

We use Meta Pixel, Statsig analytics, session replay, and related conversion tools to understand visits, sign-ups, purchases, and on-site behavior so we can improve our ads and product experience. You can decline and continue using SwapFlow. Privacy Policy

SwapFlowSwapFlow
Sign Up

SwapFlow API

Publish content programmatically via REST API

REST API

Publish to any connected social platform using curl, scripts, or your own tools.

GET /api/cli/connections

List your social accounts

POST /api/cli/publish

Publish content to a platform

POST /api/cli/posts

Schedule a post for future publishing

GET /api/cli/posts

View published post history

GET /api/cli/posts/:id

Get post details

PATCH /api/cli/posts/:id

Update a scheduled post

Get Your API Key

Sign up for SwapFlow to generate API keys and start publishing content programmatically.

Get Started

Just two steps: get your connection IDs, then publish. Files are uploaded directly β€” no need to pre-upload to SwapFlow first.

# 1. List your connected accounts to find your connection ID
curl -s "https://www.swapflow.top/api/cli/connections" \
  -H "X-API-Key: sf_your_api_key_here" | jq .

# 2. Publish a file directly β€” no pre-upload needed!
curl -X POST "https://www.swapflow.top/api/cli/publish" \
  -H "X-API-Key: sf_your_api_key_here" \
  -F "file=@photo.jpg" \
  -F "connectionId=YOUR_CONNECTION_ID" \
  -F "platform=twitter" \
  -F "caption=Posted from the API!"

Schedule posts for future publishing on any platform. Posts are published automatically with up to 5-minute precision.

# Schedule a post for future publishing
curl -X POST "https://www.swapflow.top/api/cli/posts" \
  -H "X-API-Key: sf_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "connectionId": "CONNECTION_ID",
    "caption": "Launching tomorrow!",
    "scheduledAt": "2026-04-01T15:30:00Z"
  }'

You can also upload a file and set platform-specific options:

# Schedule a post for future publishing
curl -X POST "https://www.swapflow.top/api/cli/posts" \
  -H "X-API-Key: sf_your_api_key_here" \
  -F "file=@video.mp4" \
  -F "connectionId=CONNECTION_ID" \
  -F "caption=Check this out!" \
  -F "scheduledAt=2026-04-01T15:30:00Z" \
  -F 'platformSettings={"youtube":{"privacyStatus":"public","videoType":"shorts"}}'

Publish Parameters Reference

ParameterRequiredDescription
connectionIdYesUUID of the target social connection
platformYesPlatform name (twitter, tiktok, youtube, etc.)
fileNoMedia file to upload (multipart/form-data)
file1, file2, ...NoMultiple image files for carousel/multi-image posts (multipart)
mediaIdNoUUID of existing media from /api/media
mediaIdsNoJSON array of media UUIDs for multi-image posts
mediaUrlNoDirect URL to media file
captionNoPost text or caption
mediaTypeNovideo, image, or text (auto-detected from file)
tiktokUserConsentTikTokMust be true to publish to TikTok
tiktokPrivacyLevelNoSELF_ONLY, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR, or PUBLIC_TO_EVERYONE
youtubePrivacyNopublic, private, or unlisted (default: private)
youtubeIsShortsNotrue for Shorts, false for long-form (default: true)
pinterestBoardIdPinterestPinterest board ID (required for Pinterest)
snapchatTypeNospotlight or stories (default: spotlight)
scheduledAtNoISO 8601 date for future publish time (min 5 min ahead). Omit for immediate async publish
webhookUrlNoHTTPS URL for publish/fail status callbacks
platformSettingsNoPlatform-specific options as JSON (e.g. TikTok privacy, YouTube type)

Supported Platforms

twitter
tiktok
instagram standalone
facebook
youtube
threads
linkedin
pinterest
bluesky
telegram
snapchat