Create a conversion destination (LinkedIn)
Create a new conversion rule on the platform. LinkedIn-only today; other platforms manage destinations in their own UIs and return 405. For LinkedIn, the rule is created with `conversionMethod=CONVERSIONS_API` and (by default) auto-associated with all of the ad account's campaigns via `autoAssociationType=ALL_CAMPAIGNS`. Pass `autoAssociationType: NONE` to opt out and manage associations explicitly via the associations endpoints below. 365-day attribution windows are only valid for `SUBMIT_APPLICATION`, `PURCHASE`, `ADD_TO_CART`, `QUALIFIED_LEAD`, and `LEAD` rule types; the API rejects other combinations locally.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
SocialAccount ID (linkedinads).
Sponsored ad account ID. Numeric (e.g. "5123456") or
full urn:li:sponsoredAccount:{id} URN.
length <= 255Either a unified standard event name (e.g. "Purchase", "Lead", "AddToCart") or a LinkedIn rule type enum value (e.g. "PURCHASE", "QUALIFIED_LEAD"). The API maps standard names to LinkedIn enum values automatically.
"LAST_TOUCH_BY_CAMPAIGN" | "LAST_TOUCH_BY_CONVERSION"Default 30. 365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types — the API rejects other combinations locally.
1 | 7 | 30 | 90 | 365Default 7. Same 365-day-window type restriction applies
as postClickAttributionWindowSize.
1 | 7 | 30 | 90 | 365DYNAMIC (default) uses the per-event value from
sendConversions. FIXED uses the rule's value field.
NO_VALUE drops monetary value entirely.
"DYNAMIC" | "FIXED" | "NO_VALUE"Static conversion value. Used when valueType=FIXED.
The currency should match the ad account's currency.
Controls campaign association at rule-creation time:
- ALL_CAMPAIGNS: associate the rule with every active, paused, and draft campaign in the ad account
- OBJECTIVE_BASED: associate only campaigns whose objective matches the rule's type
- NONE: don't auto-associate. Manage associations via
the
/associationsendpoints below. Note: auto-association runs once at create time; new campaigns added after the rule still need explicit association.
"ALL_CAMPAIGNS""ALL_CAMPAIGNS" | "OBJECTIVE_BASED" | "NONE"Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.ads.createConversionDestination({ path: { accountId: 'account_abc123', }, body: { adAccountId: 'adaccount_abc123', name: 'Example', type: 'string', },});console.log(data);{
"platform": "linkedinads",
"destination": {
"id": "string",
"name": "string",
"type": "string",
"status": "active",
"adAccountId": "string"
}
}{
"error": "Unauthorized"
}Search geo targeting locations (Meta) GET
Resolve a human-readable location name into Meta's opaque `key` used in `targeting.cities[]` / `targeting.regions[]` on `POST /v1/ads/create` (and the same fields under `targeting.geo_locations` on `POST /v1/ads/boost`). Wraps Meta's `/search?type=adgeolocation` endpoint. Meta-only for now. Other platforms have their own location id systems and are not exposed here. Per Meta's docs, `q` must contain only the locality name (e.g. `"Amsterdam"`, not `"Amsterdam, NL"`). Use `countryCode` to disambiguate when the same name exists in multiple countries.
Create Click-to-WhatsApp ad POST
Creates a Click-to-WhatsApp (CTWA) ad on Meta. When tapped, the ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page, and the full hierarchy (campaign, ad set, creative, ad) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager. Prerequisites enforced by Meta (surfaced as platform_error on failure), the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management.