Get OAuth connect URL
Initiate an OAuth connection flow. Returns an authUrl to redirect the user to. Standard flow: Zernio hosts the selection UI, then redirects to your redirect_url. Headless mode (headless=true): user is redirected to your redirect_url with OAuth data for custom UI. Use the platform-specific selection endpoints to complete.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Social media platform to connect
"facebook" | "instagram" | "linkedin" | "twitter" | "tiktok" | "youtube" | "threads" | "reddit" | "pinterest" | "bluesky" | "googlebusiness" | "telegram" | "snapchat" | "discord"Query Parameters
Your Zernio profile ID (get from /v1/profiles)
Your custom redirect URL after connection completes. Standard mode appends ?connected={platform}&profileId=X&accountId=Y&username=Z. Headless mode appends OAuth data params for platforms requiring selection (e.g. LinkedIn orgs, Facebook pages). If no selection is needed, the account is created directly and the redirect includes accountId.
uriWhen true, the user is redirected to your redirect_url with raw OAuth data (code, state) instead of Zernio's default account selection UI. Use this to build a custom connect experience.
falseResponse Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.connect.getConnectUrl({ path: { platform: 'facebook', }, query: { profileId: 'profile_abc123', },});console.log(data);{
"authUrl": "https://www.facebook.com/v21.0/dialog/oauth?client_id=...",
"state": "user123-profile456-1234567890-https://yourdomain.com/callback"
}{
"error": "Unauthorized"
}{
"error": "X (Twitter) requires a payment method due to API pass-through costs. Add a payment method to connect an X account.",
"code": "PAYMENT_REQUIRED",
"reason": "free_tier_exceeded",
"documentation_url": "https://docs.zernio.com/billing/payment-method-required",
"dashboard_url": "https://zernio.com/dashboard?tab=billing",
"details": {
"free_tier_account_limit": 2,
"current_account_count": 5,
"has_payment_method": true,
"public_account_limit": 2000,
"effective_account_limit": 2000
}
}Move account to a different profile PATCH
Moves a connected social account to a different profile owned by the same user. The target profile must belong to the same user as the account. For API keys restricted to specific profiles, BOTH the source account's current profile AND the target profile must be in the key's allowed set. Calls with a target profile outside the key's scope return 403.
Complete OAuth callback POST
Exchange the OAuth authorization code for tokens and connect the account to the specified profile.