Connect ads for a platform
Unified ads connection endpoint. Handles all platforms through a single route: **Same-token platforms** (facebook, instagram, linkedin): If a posting account already exists, returns `alreadyConnected: true` immediately (no extra OAuth needed). If not, starts the normal OAuth flow, and the resulting account supports both posting and ads. **Separate-token platforms** (tiktok, twitter, pinterest): Requires an existing posting account (`accountId` param). If ads are already connected, returns `alreadyConnected: true`. Otherwise, starts the platform-specific marketing API OAuth flow. **Ads-only platforms** (googleads): If a Google Ads account exists, returns `alreadyConnected: true`. Otherwise, starts the Google Ads OAuth flow. Use the `adsStatus` field from `GET /v1/accounts` to check which accounts need ads connection.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Platform to connect ads for. Only platforms with ads support are accepted.
"facebook" | "instagram" | "linkedin" | "tiktok" | "twitter" | "pinterest" | "googleads"Query Parameters
Your Zernio profile ID
Existing SocialAccount ID. Required for separate-token platforms (tiktok, twitter, pinterest). Ignored for same-token and ads-only platforms.
Custom redirect URL after OAuth completes (same-token platforms only)
uriEnable headless mode (same-token platforms only)
falseResponse Body
application/json
application/json
curl -X GET "https://zernio.com/api/v1/connect/facebook/ads?profileId=string"{
"alreadyConnected": true,
"accountId": "664a1b2c3d4e5f6789012345",
"platform": "instagram",
"username": "@mybrand",
"displayName": "My Brand"
}{
"error": "Unauthorized"
}Select Snapchat profile POST
Complete the Snapchat connection flow by saving the selected Public Profile. Snapchat requires a Public Profile to publish content. Use X-Connect-Token if connecting via API key.
Connect WhatsApp via credentials POST
Connect a WhatsApp Business Account by providing Meta credentials directly. This is the headless alternative to the Embedded Signup browser flow. To get the required credentials: 1. Go to Meta Business Suite (business.facebook.com) 2. Create or select a WhatsApp Business Account 3. In Business Settings > System Users, create a System User 4. Assign it the `whatsapp_business_management` and `whatsapp_business_messaging` permissions 5. Generate a permanent access token 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers 7. Get the Phone Number ID from the same page (click on the number)