API Reference
SoshFlow API
One unified API to connect and manage YouTube, Instagram, and TikTok accounts. Authenticate users, fetch profiles, and receive real-time webhooks.
Base URL
api.soshflow.comAuth
OAuth 2.0 + API Keys
Format
JSON REST
Quick Start
- Redirect user to OAuth — Send users to
/api/auth/[provider] - Receive callback — User returns with
?code=...parameter - Exchange code — POST to
/connectto get tokens + profile - Store tokens — Save tokens securely for API calls
Example: Connect a YouTube account
// 1. User clicks "Connect YouTube" → redirects to Google OAuth
// 2. After auth, user returns to your callback URL with ?code=...
// 3. Exchange the code for tokens
const response = await fetch("https://api.soshflow.com/connect", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
provider: "youtube",
code: "4/0AX4XfWh...",
redirectUri: "https://your-app.com/callback"
})
});
const { tokens, profile } = await response.json();
// tokens.access_token → Use for YouTube API calls
// tokens.refresh_token → Store securely for token refresh
// profile → User's channel infoEndpoints
Supported Platforms
YouTube
Features
- • Channel data
- • Video analytics
- • Upload videos
- • Manage playlists
Scopes
youtubeyoutube.force-sslyoutube.channel-memberships.creatorFeatures
- • Profile data
- • Post content
- • Read insights
- • Manage comments
Scopes
instagram_business_basicinstagram_business_manage_messagesinstagram_business_content_publishTikTok
Features
- • User profile
- • Video stats
- • Publish videos
Scopes
user.info.basicuser.info.statsvideo.publishError Handling
All errors return a JSON object with an error field.
Error Response
{
"error": "Missing provider or access_token/code"
}
// Common errors:
// 400 - Missing or invalid parameters
// 500 - Token exchange failed or missing env config