---
title: "Connect ads for a platform"
method: GET
path: "/v1/connect/{platform}/ads"
tags: ["Connect"]
---

# Connect ads for a platform

`GET /v1/connect/{platform}/ads`

Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform.

Same-token platforms (facebook, instagram, linkedin, pinterest): Creates an ads SocialAccount (metaads, linkedinads, pinterestads) with a copied OAuth token from the parent posting account. If the ads account already exists, returns alreadyConnected: true. No extra OAuth needed.

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) — 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 — 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.

## Path parameters

- `platform` 'facebook' | 'instagram' | 'linkedin' | 'tiktok' | 'twitter' | 'pinterest' | 'googleads', required

## Query parameters

- `profileId` string, required
- `accountId` string
- `redirect_url` string, uri
- `headless` boolean
- `force` boolean
- `adAccountId` string
- `adAccountIds` string[]

## Response `200`

Either an OAuth URL to redirect to, or confirmation that ads are already connected

- union
  - object — Ads already connected (no OAuth needed)
    - `alreadyConnected` boolean
    - `accountId` string
    - `platform` string
    - `username` string
    - `displayName` string
    - `scopedAdAccountIds` string[] — Echo of the persisted ad-account scope when the caller passed `adAccountId` / `adAccountIds`. Omitted when no scope is set.
  - object — OAuth URL to redirect user to
    - `authUrl` string, uri
    - `state` string

## Other responses

- `400` — Platform doesn't support ads, or missing accountId for X Ads
- `401` — Unauthorized
- `403` — Ads access required (Ads add-on on legacy plans, included on usage-based plans), or no access to profile
- `404` — Profile or posting account not found

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/versions/51932b099b2f/schema)
