OverviewProductsPlatformsAPI ReferenceResources
Connect

Select Facebook page

POSThttps://zernio.com/api/v1/connect/facebook/select-page

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

PlatformsMeta

Authentication

One of these

AuthorizationBearer tokenRequired

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

One of these

X-Connect-TokenAPI key in headerRequired

Short-lived connect token for API users during OAuth flows. Automatically generated when initiating OAuth without a browser session. Valid for 15 minutes. Connect tokens are scoped to the intended profile and platform and are accepted only by connection-flow endpoints that explicitly list this security scheme.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Responses

Success· the request worked

Errors· the request failed

How it behaves

Two ways to call it

  • Classic Facebook Page connection: send profileId, pageId, tempToken and userProfile. Use X-Connect-Token for headless connections.
  • Dashboard business-login picker: send only selectionToken and pageId to complete a Meta Ads connection.

Business selection

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.

POST/v1/connect/facebook/select-page
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"  }}
OpenAPI specification
Was this page helpful?