Zernio
APIFor you
Zernio
APIFor you
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 loginGETRead a Facebook Page's webhook subscriptionGETRe-subscribe a Facebook Page to Zernio's webhooksPOST

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

WordPress

Get WordPress.com OAuth connect URLGETConnect self-hosted WordPress with an application passwordPOST

Other

Connect Webflow with a site API tokenPOSTConnect a Whop accountPOSTAdd an OAuth appPOSTRemove an OAuth appDELETEGet a phone handoffGETGet the saved welcome screenGETGet Google Analytics OAuth connect URLGETGet HubSpot OAuth connect URLGETGet an OAuth appGETGet Webflow OAuth URLGETGet Wix site install URLGETList Google Analytics properties for a pending connectGETList your OAuth appsGETConnect the chosen Google Analytics propertyPOSTAdmin-consent link for a Microsoft tenantGETCheck an OAuth app's keysPOSTSave the welcome screenPUTUpdate an OAuth appPATCH
Dashboard
OverviewPlatformsAPI ReferenceResources
Connect

Select Facebook page

Connects the Facebook Page the user picked after signing in, completing the Facebook or Meta Ads connection.

Complete a classic Facebook Page connection with profileId, pageId, tempToken and userProfile. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken and pageId to complete a Meta Ads connection. The server verifies the initiating user, profile access, current grants and connection eligibility. The profile, platform token, ad-account scope and return URL come only from the encrypted grant. Business selection requires a session or bearer authentication for the initiating user; X-Connect-Token is not accepted. It returns redirect_url with connected=metaads on success or an eligibility error redirect.


PlatformsMeta
POST
/v1/connect/facebook/select-page

Authorization

AuthorizationBearer <token>

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

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

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.facebook.selectFacebookPage({  body: {    profileId: 'profile_abc123',    userProfile: {      id: 'abc123',      name: 'Example',      profilePicture: 'string',    },  },});console.log(data);
{  "message": "Facebook page connected successfully",  "redirect_url": "https://yourdomain.com/integrations/callback?connected=facebook&profileId=507f1f77bcf86cd799439011&accountId=64e1f0a9e2b5af0012ab34cd&username=My+Brand+Page",  "account": {    "accountId": "64e1f0a9e2b5af0012ab34cd",    "platform": "facebook",    "username": "mybrand",    "displayName": "My Brand Page",    "profilePicture": "https://...",    "isActive": true,    "selectedPageName": "My Brand Page"  }}
Was this page helpful?

List Facebook pages

Lists the Facebook Pages a user can pick from after signing in, so they can choose which Page to connect. Classic connections require profileId and tempToken from the OAuth redirect. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken, an encrypted grant valid for ten minutes. This requires the initiating user and current profile access and returns only Page IDs and names. X-Connect-Token cannot authorize business selection.

List Facebook pages

Returns all Facebook Pages the connected account has access to, including the currently selected Page and the Instagram professional account linked to each Page. Works on `facebook` accounts and on `metaads` accounts (classic and Facebook Login for Business connections). On a business-login `metaads` connection `selectedPageId` is the default Page ads run as, and every listed Page can be passed as `pageId` on POST /v1/ads/create. A classic `metaads` connection has no default Page, so `selectedPageId` is null there.

profileId*string

Profile ID from your classic connection flow.

pageId?string

The Facebook Page ID selected by the user. Send this or pageIds, not both.

pageIds?array<string>

Several Page IDs to connect from one sign-in, each as its own account. With two or more distinct IDs the response lists accounts and failed instead of account, and the request is refused with 400 on a reconnect or an ads connect, which pick exactly one Page. A single distinct ID behaves exactly like pageId.

Items1 <= items <= 25
tempToken?string

Temporary Facebook access token from OAuth. Required unless sent in the X-Temp-Token header.

connectFlow?string

Set by the Zernio-hosted picker, whose user token stays in an httpOnly cookie. Integrators send tempToken instead.

Match^[a-f0-9]{32}$
userProfile*

Decoded user profile object from the OAuth callback.

redirect_url?string

Optional custom redirect URL to return to after selection.

Formaturi