Zernio
Zernio
API Reference

Connect

General

Get OAuth connect URLGETComplete OAuth callbackPOSTGet pending OAuth dataGETConnect ads for a platformGET

Facebook

List Facebook pagesGETSelect Facebook pagePOSTList Facebook pagesGETUpdate Facebook pagePUTComplete Meta business loginGET

Google Business

List Google Business Profile locationsGETSelect Google Business Profile locationPOSTAssign Google Business Profile location to another profilePOSTList Google Business Profile locationsGETUpdate Google Business Profile locationPUT

Instagram

List Pages with a linked Instagram accountGETSelect the Page whose Instagram account to connectPOST

LinkedIn

List LinkedIn orgsGETSelect LinkedIn orgPOSTList LinkedIn orgsGETSwitch LinkedIn account typePUT

Pinterest

List Pinterest boardsGETSelect Pinterest boardPOSTList Pinterest boardsGETCreate Pinterest boardPOSTSet default Pinterest boardPUT

Reddit

List Reddit subredditsGETList subreddit flairsGETGet subreddit rulesGETSet Reddit post flairPOSTVote on a Reddit post or commentPOSTSet default subredditPUT

Bluesky

Connect Bluesky accountPOST

Discord

Connect a Discord channelPOST

Slack

List Slack channels for the channel pickerGETConnect a Slack channelPOST

Telegram

Generate Telegram codeGETConnect Telegram directlyPOSTCheck Telegram statusPATCH

Snapchat

List Snapchat profilesGETSelect Snapchat profilePOST

TikTok

Set TikTok brand identityPATCH

OpenAI Ads

Connect an OpenAI Ads accountPOST

WhatsApp

Connect WhatsApp via credentialsPOSTConnect WhatsApp from Embedded SignupPOSTGet Embedded Signup SDK configGETList numbers for selectionGETComplete number selectionPOST

YouTube

List YouTube playlistsGETCreate YouTube playlistPOSTSet default YouTube playlistPUTGet a YouTube video transcriptGET

Shopify

Get Shopify OAuth connect URLGETConnect a Shopify store with a custom-app Admin tokenPOST

Other

Read a Facebook Page's webhook subscriptionGETRe-subscribe a Facebook Page to Zernio's webhooksPOST
Dashboard
llms.txtOpenAPI
OverviewPlatformsAPI ReferenceResources
Connect

Get pending OAuth data

Fetch pending OAuth data for headless mode using the pendingDataToken from the redirect URL.

Scope: This endpoint is used for LinkedIn organizations, Google Business Profile locations, Slack channels, Snapchat profiles, and Pinterest boards, where the selection list is too large to fit in URL params. The redirect carries a pendingDataToken instead of the full payload; the response includes the corresponding selection array (e.g. boards for Pinterest). WhatsApp, Facebook 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).

Reading the token does not consume it, so this fetch is repeatable until the token expires 1 hour after issuance. Completing the platform selection deletes the pending record, so the token stops working from then on. No authentication required.


GET
/v1/connect/pending-data

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

In: header

Query Parameters

token*string

The pending data token from the OAuth redirect URL (pendingDataToken parameter)

Response Body

application/json

application/json

application/json

{  "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"    }  ]}
Was this page helpful?

Complete OAuth callback

Exchange the OAuth authorization code for tokens and connect the account to the specified profile. Facebook, Google Business Profile, Snapchat and WhatsApp are not accepted here: their account identity is a destination chosen after OAuth, which this single-shot exchange cannot do. Connect them through the redirect flow from `GET /v1/connect/{platform}`, or, for WhatsApp Embedded Signup, through `POST /v1/connect/whatsapp/embedded-signup`.

Connect ads for a platform

Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform. **Meta business login (opt-in).** Set `loginMode=business` for `facebook` or `instagram` to use Facebook Login for Business and a Business Integration System User token. No posting account is created or required. This mode always returns an authUrl; it returns 503 when the server has no META_ADS_CONFIG_ID. Complete the dialog in a browser. The callback creates or reconnects only the metaads account, preserving its ID, history and scopedAdAccountIds. Non-empty successful subscription results replace subscribedAdAccountIds to remove stale grants; an empty result leaves routing unchanged. A reconnect must grant every previously scoped ad account (or every previous grant for an unscoped connection). Missing or unverifiable grants return 409 before changing the account. Pass `pageId` to select a granted Page for creatives and lead forms. API integrations otherwise reuse the previous Page or sole granted Page. Multiple Pages without a selection return 400 with available Page IDs for API integrations; restart with pageId. Dashboard session logins use the sole current grant automatically or open the existing Facebook Page picker for several grants, including reconnects. Selection completes the Meta Ads connection. With no Pages granted the callback returns 400 with instructions to connect again and grant a Page. Success redirects with connected=metaads, profileId and accountId. Business login reports metadata.tokenType=system-user in GET /v1/accounts. An absent Meta expires_in leaves tokenExpiresAt absent; no personal-token re-exchange occurs. Subsequent classic requests can change the ad-account scope using the business token; force=true requires loginMode=business to reconnect that connection. **Same-token platforms (facebook, instagram, linkedin, pinterest).** The ads SocialAccount (metaads, linkedinads, pinterestads) reuses the OAuth token of the parent posting account, but only when an active parent exists and, for facebook and instagram, its stored token carries ads_management and ads_read (linkedin and pinterest need no extra scope). In that case no extra OAuth happens and the response is alreadyConnected: true. When no such parent exists, or the scopes are missing, the endpoint returns an authUrl and a full OAuth round trip is required. When a parent exists but carries no token usable for ad accounts, the call fails with 400 RECONNECT_REQUIRED. Independently of the branch, the call can return 403 ADS_ADDON_REQUIRED without the ads add-on and 402 PAYMENT_REQUIRED when the billing gate is closed. Meta Ads prerequisite: connecting Meta Ads (via facebook or instagram) requires a Facebook Page. Not because the ad account is read through a Page, but because both parent posting accounts are: the facebook flow only offers Pages you manage, and the instagram flow with loginMethod=facebook_login only offers Instagram accounts linked to one of those Pages. Without a Page there is no parent account to inherit a token from. A user who manages no Facebook Page cannot complete this connection, and the facebook flow ends with error=no_facebook_pages. **Separate-token platforms (tiktok, twitter).** Starts the platform-specific marketing API OAuth flow and creates an ads SocialAccount (tiktokads, xads) with its own token. If the ads account already exists, returns alreadyConnected: true. - tiktok: accountId is OPTIONAL. With accountId, the new tiktokads account links to that posting account (parentAccountId set), so Spark Ads + standalone ads using the posting TT_USER identity become available. Without accountId, ads-only mode kicks in: the new tiktokads account has parentAccountId=null and standalone ads use a synthetic CUSTOMIZED_USER ("Brand Identity"); Spark Ads are unavailable because TikTok requires a posting account for them. The Brand Identity is configured separately via PATCH /v1/connect/tiktok-ads (or inline on POST /v1/ads/create via the brandIdentity field). - twitter (X Ads): accountId is REQUIRED. There's no ads-only mode, because tweets need to be authored by a real X user. **Standalone platforms (googleads).** Starts the Google Ads OAuth flow and creates a standalone ads SocialAccount (googleads) with no parent. If the account already exists, returns alreadyConnected: true. Ads accounts appear as regular SocialAccount documents with ads platform values (e.g., metaads, tiktokads) in GET /v1/accounts.