Skip to main content

Meta ads: whitelist promotedObject.customEventStr on POST /v1/ads/create (custom_event_str passthrough)

We need to optimize Meta conversion campaigns on pixel custom events (e.g. lead_ok) via the API. Meta supports this natively as:

promoted_object: { pixel_id: "...", custom_event_type: "OTHER", custom_event_str: "lead_ok" }

Your campaign READ endpoints already return custom_event_str on ad sets — our ad account (act_640784214657998) has many live campaigns using OTHER + custom_event_str=lead_ok, created in Ads Manager.

But POST /v1/ads/create rejects promotedObject.customEventStr with: 400 invalid_field_value — Unrecognized key: "customEventStr" (additionalProperties: false on the promotedObject schema)

Request — either one unblocks us:

  1. Whitelist promotedObject.customEventStr on POST /v1/ads/create (and PUT /v1/ads/ad-sets/{id}) and forward it to Meta when customEventType=OTHER. You already return this field on reads, so the Meta-side mapping exists.

  2. Even better: proxy GET/POST act_{id}/customconversions, or add ensureCustomConversion({ adAccountId, pixelId, eventName }) using your Marketing Partner token. This fits your current customConversionId model and removes the need for our users to hold an ads_management Graph token just to wrap their own pixel events.

Context: we send these events server-side via CAPI (sendConversions works great), they're confirmed in Events Manager, and the only missing piece is selecting them as the optimization event at campaign creation — exactly like Ads Manager's "custom conversion / custom event" dropdown.

Status: Completed1 comment

Log in to comment and vote

Comments1

  • Miquel Palet López

    Team•

    Aug 6

    Shipped!

    promotedObject.customEventStr is now accepted on POST /v1/ads/create and PUT /v1/ads/ad-sets/{adSetId} and forwarded to Meta as custom_event_str. Pair it with customEventType: "OTHER" (we enforce the pairing both ways with a clear 400, and the string is passed through case-sensitive, so send the event name exactly as it appears in Events Manager). Your lead_ok flow should now work end to end: CAPI sends the event, then create optimizes on it, exactly like the Ads Manager dropdown.

    Docs: https://docs.zernio.com/ad-campaigns/create-standalone-ad

    On your option 2 (proxying custom conversions / an ensureCustomConversion helper): we kept it out of this change on purpose. The passthrough is the primitive that unblocks you without extra objects to manage, and rule-based Custom Conversions already plug in via promotedObject.customConversionId. If API-side custom-conversion creation would still help, leave that as its own request and we'll track demand for it.