OverviewProductsPlatformsAPI ReferenceResources

Use your own platform apps

Connect your customers' accounts through your own app on each platform, so the consent screen shows your brand and the rate limits are your app's.


By the end of this page, your customers connect through your own app on a platform: the consent screen shows your app's name and logo, and the platform's quotas are your app's, not Zernio's.

Before you start

You need an API key with full scope, from the account owner or a full-access team member. Profile-scoped keys cannot manage apps.

You also need an app on the platform, created in its developer console. Accounts connected without an app id keep running on Zernio's app, exactly as before.

These platforms accept your own app today:

PlatformWhere the redirect URI goesApproval before outside accounts connect
InstagramInstagram product, API setup with Instagram login, OAuth redirect URIsApp Review, advanced access
FacebookFacebook Login for Business, Valid OAuth redirect URIsApp Review, advanced access
ThreadsAccess the Threads API use case, Redirect callback URLsApp Review
WhatsAppNot used: numbers connect with credentialsSystem user token with WhatsApp messaging and management
YouTubeGoogle Cloud OAuth client (Web application), Authorized redirect URIsGoogle verification of the consent screen
Google Business ProfileGoogle Cloud OAuth client (Web application), Authorized redirect URIsGoogle approval for the Business Profile APIs
Gmail, Calendar and Drive (google)Google Cloud OAuth client (Web application), Authorized redirect URIsGoogle verification for Gmail's restricted scopes
Outlook, Calendar and OneDrive (microsoft)Azure app registration, Authentication, Web redirect URINone
XUser authentication settings, OAuth 2.0, Callback URINone
LinkedInAuth tab, Authorized redirect URLsCommunity Management API, for comments and analytics
TikTokLogin Kit, Redirect URIContent Posting API with Direct Post
PinterestApp settings, Redirect URIsStandard access
SnapchatSnap Business Manager, OAuth Apps, Redirect URIPublic Profile API
RedditYour web app, redirect uriReddit API access approval
SlackOAuth & Permissions, Redirect URLsNone for your own workspace

GET /v1/connect/oauth-apps lists the same platforms in platforms, with each one's redirect URI and scopes.

Step 1: Add the app

Send the app's client ID and secret with POST /v1/connect/oauth-apps. Zernio checks the keys with the platform before saving them.

TypeScript
import Zernio from '@zernio/node';

const zernio = new Zernio();

const { data } = await zernio.connect.createOAuthApp({
  body: {
    platform: 'youtube',
    label: 'Acme',
    clientId: '1234567890-abc.apps.googleusercontent.com',
    clientSecret: 'GOCSPX-xxxxxxxx',
  },
});

const appId = data.app.id; // pass as oauthAppId when connecting

Response (201):

JSON
{
  "app": {
    "id": "6720b1c4e8a9f0d2c3b4a5e6",
    "platform": "youtube",
    "label": "Acme",
    "clientId": "1234567890-abc.apps.googleusercontent.com",
    "scopeAreas": ["posting", "analytics", "comments"],
    "status": "ok",
    "accountCount": 0,
    "redirectUri": "https://zernio.com/api/v1/connect/youtube/callback",
    "webhook": null,
    "sharedWebhookUrl": null
  }
}

status is ok when the platform accepted the keys, and unchecked when it could not say. Slack, for example, only confirms an app on its first install.

Pass scopeAreas to ask for less than every area, such as ["posting"] when your app is only approved for publishing. LinkedIn apps default to posting only.

Step 2: Allow the redirect URI

Copy redirectUri from the response into your app's settings, in the place the table above names. The platform refuses the connect until it matches exactly.

Step 3: Connect an account through the app

Call GET /v1/connect/{platform} as usual and add oauthAppId. The customer sees your app on the consent screen, and the account stays on your app afterwards.

TypeScript
const { data: connect } = await zernio.connect.getConnectUrl({
  path: { platform: 'youtube' },
  query: { profileId, oauthAppId: appId, redirect_url: 'https://your-app.com/callback' },
});
// Send the customer's browser to connect.authUrl

Token refreshes, publishing, analytics and the inbox for that account all run on your app's keys from then on.

Step 4: Set up events

Most platforms need nothing more. Four do:

  • Facebook and WhatsApp: Zernio registers the webhook on your app when you add it. webhook.status says whether it worked.
  • Instagram: also send metaAppId and metaAppSecret, the Meta app the Instagram app lives in, so Zernio can register its webhook.
  • TikTok: set sharedWebhookUrl as the webhook callback URL in your TikTok app. Publishing works without it.
  • Slack: send slackSigningSecret with the app, then paste slackEvents.requestUrl into Event Subscriptions and subscribe the listed bot events.

How it behaves

  • You can add any number of apps, several per platform. Nothing picks one for you: a connect without oauthAppId runs on Zernio's app.
  • The client secret is never returned. Rotate it with PATCH /v1/connect/oauth-apps/{id}, and every account on the app picks up the new one.
  • POST /v1/connect/oauth-apps/{id}/test checks the keys again. An invalid status means connects and token refreshes through the app fail until you rotate the secret.
  • Removing an app with connected accounts needs confirm=true, and disconnects those accounts. accountCount says how many there are.
  • Instagram apps cover Instagram login only. Ads connects, and WhatsApp's Embedded Signup, stay on Zernio's app.
  • Adding a WhatsApp app replaces its webhook callback URL with Zernio's, so use a Meta app that serves only Zernio.
  • A Google Cloud project gets 100 YouTube uploads a day by default, on their own quota, apart from the 10,000 daily units for other calls. Custom thumbnails, first comments and playlists spend those units (50 each). Ask Google for more before you move customers to it.

If it fails

ErrorCauseFix
OAUTH_APP_KEYS_REJECTEDThe platform rejected the client ID or secret.Copy both again from the platform's console. Nothing was saved.
OAUTH_APP_ALREADY_EXISTSYou already added this client ID for this platform.Use the app in details.appId, or rotate its secret with PATCH.
INSUFFICIENT_PERMISSIONSThe key is profile-scoped, or the caller is not the owner or a full-access member.Use a full-scope key from the account owner.
The platform shows a redirect URI errorThe redirect URI in your app does not match redirectUri.Paste redirectUri exactly, with no trailing slash.
The consent screen says the app is not approvedThe platform has not reviewed your app yet.Finish the approval in the table above, or add the customer as a tester.
webhook.status is failedZernio could not register the webhook on your Meta app.Read webhook.error. For Instagram, send metaAppId and metaAppSecret with PATCH.
Was this page helpful?

On this page