connect
Complete OAuth callback
Exchange the OAuth authorization code for tokens and connect the account to the specified profile.
AuthorizationBearer <token>
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
platformstring
codestring
statestring
profileIdstring
Response Body
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.connect.handleOAuthCallback({ path: { platform: 'twitter', }, body: { code: 'abc123', state: 'string', profileId: 'profile_abc123', },});console.log(data);Empty
Empty
{
"error": "Unauthorized"
}Empty
Empty
Get OAuth connect URL GET
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.
Get pending OAuth data GET
Fetch pending OAuth data for headless mode using the pendingDataToken from the redirect URL. One-time use, expires after 10 minutes. No authentication required.