Get pending OAuth data
Fetch pending OAuth data for headless mode using the pendingDataToken from the redirect URL.
Scope: This endpoint is used only for LinkedIn organizations and Snapchat profiles, where the selection list is too large to fit in URL params. WhatsApp, Facebook, Pinterest, Google Business and other platforms pass selection state directly via URL query params on the redirect (profileId, tempToken, step), no pending record is created, so this endpoint will return 404 for those flows. Use the platform-specific selection endpoint instead (e.g. /v1/connect/whatsapp/select-phone-number).
Token is one-time use and expires after 10 minutes. No authentication required.
API key authentication - use your Zernio API key as a Bearer token
In: header
Query Parameters
The pending data token from the OAuth redirect URL (pendingDataToken parameter)
Response 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.getPendingOAuthData({ query: { token: 'tok_abc123', },});console.log(data);{
"platform": "linkedin",
"profileId": "abc123",
"tempToken": "AQV...",
"refreshToken": "AQW...",
"expiresIn": 5183999,
"userProfile": {
"id": "ABC123",
"username": "John Doe",
"displayName": "John Doe",
"profilePicture": "https://..."
},
"selectionType": "organizations",
"organizations": [
{
"id": "12345",
"urn": "urn:li:organization:12345",
"name": "Acme Corp",
"vanityName": "acme-corp"
},
{
"id": "67890",
"urn": "urn:li:organization:67890",
"name": "Example Inc",
"vanityName": "example-inc"
}
]
}{
"error": "string",
"details": {}
}{
"error": "string",
"details": {}
}Complete OAuth callback POST
Exchange the OAuth authorization code for tokens and connect the account to the specified profile.
List Facebook pages GET
Returns the list of Facebook Pages the user can manage after OAuth. Extract tempToken and userProfile from the OAuth redirect params and pass them here. Use the X-Connect-Token header if connecting via API key.