Create a conversion destination (LinkedIn, Google Ads)
Create a new conversion destination on the platform. Supported for LinkedIn (conversion rule) and Google Ads (conversion action). Meta manages destinations in its own UI and returns 405.
LinkedIn: creation is NOT idempotent. A retry creates a second destination. Deduplicate before retrying.
Google Ads: calling with a name that already exists reuses the
existing conversion action transparently (the response is identical to
a fresh create). Calling with the same name but a different category
returns a typed IDEMPOTENCY_CONFLICT (409) rather than silently
returning the mismatched action.
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.
Google Ads: the conversion action is created with
type=UPLOAD_CLICKS (required for API-uploaded offline conversions,
immutable after creation). The type field carries the Google
ConversionActionCategory enum value, e.g. PURCHASE,
SUBSCRIBE_PAID, SIGNUP, IMPORTED_LEAD, BOOK_APPOINTMENT.
Unified standard event names (e.g. Purchase, Subscribe,
CompleteRegistration, Lead, Schedule) are resolved to their
Google category equivalents automatically. The action defaults to
secondary (non-primary) to avoid immediately steering Smart Bidding;
pass primaryForGoal: true to opt in.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
SocialAccount ID (linkedinads or googleads).
Ad account ID. For LinkedIn: numeric (e.g. "5123456") or
full urn:li:sponsoredAccount:{id} URN. For Google: numeric
customer ID (e.g. "1234567890") or customers/{id} form.
length <= 255Conversion type. For LinkedIn: a unified standard event name (e.g. "Purchase", "Lead", "AddToCart") or a LinkedIn rule type enum (e.g. "PURCHASE", "QUALIFIED_LEAD"). For Google: a unified standard event name (Purchase, Subscribe, CompleteRegistration, Lead, Schedule) or a Google ConversionActionCategory enum value directly (e.g. "PURCHASE", "SUBSCRIBE_PAID", "SIGNUP", "IMPORTED_LEAD", "BOOK_APPOINTMENT"). Unknown values pass through to the platform.
LinkedIn only.
"LAST_TOUCH_BY_CAMPAIGN" | "LAST_TOUCH_BY_CONVERSION"LinkedIn only. 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 | 365LinkedIn only. Default 7. Same 365-day-window type
restriction applies as postClickAttributionWindowSize.
1 | 7 | 30 | 90 | 365LinkedIn only. DYNAMIC (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"LinkedIn only. Static conversion value. Used when
valueType=FIXED. The currency should match the ad
account's currency.
LinkedIn only. 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"Google Ads only. Whether to count multiple conversions from the same click (MANY_PER_CLICK) or at most one (ONE_PER_CLICK). Defaults to MANY_PER_CLICK if omitted.
"MANY_PER_CLICK" | "ONE_PER_CLICK"Google Ads only. When true, the conversion action is marked as primary and immediately influences Smart Bidding. Defaults to false (secondary, record-only) to avoid unintentionally steering the customer's campaigns on creation.
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 targeting options GET
Resolve a human-readable query into the platform's opaque targeting ids used in the `TargetingSpec` (`countries`/`regions`/`cities`/`zips`/`metros` geo keys, and `interests`/`behaviors` entity ids) on `POST /v1/ads/create`, `POST /v1/ads/targeting/reach-estimate`, and `saved_targeting` audiences. The `dimension` param selects what is searched, `geo` (locations, further scoped by `geoType`), `interest`, `behavior`, or `income`. Availability of each dimension varies by platform (e.g. behaviours are Meta/TikTok only). Results are normalized across platforms into a single shape, so the same client code consumes Meta, TikTok, LinkedIn, X, Pinterest, and Google results. For geo queries, `q` should contain only the locality name (e.g. `"Amsterdam"`, not `"Amsterdam, NL"`). Use `countryCode` to disambiguate.
Create Click-to-WhatsApp ad(s) POST
Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) 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. Supports two mutually-exclusive shapes: - **Single-creative**: supply top-level `headline`, `body`, and one of `imageUrl` / `video`. Creates 1 campaign + 1 ad set + 1 ad. - **Multi-creative**: supply a `creatives[]` array with N entries (each carrying its own headline, body, and image/video). Creates 1 campaign + 1 ad set + N ads sharing budget and targeting so Meta A/Bs the creatives inside a single auction instead of fragmenting budget across N parallel campaigns. Recommended when launching multiple creative variants for the same campaign. 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.