For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Overview Agent Access Ads ChatGPT + Codex user docs Use cases

API Reference

Create Conversion Event Setting

POST
/conversions/event_settings

Create a conversion definition for the authenticated ad account and connect it to one or more conversion sources.

Create Conversion Event Setting

curl https://api.ads.openai.com/v1/conversions/event_settings \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
    -d '{
          "attribution_window_days": 0,
          "event_type": "x",
          "name": "x",
          "source_ids": [
            "string"
          ]
        }'
200 — Example
{
  "id": "id",
  "ad_account_id": "ad_account_id",
  "archived": true,
  "attribution_window_days": 0,
  "campaigns": [
    {
      "id": "id",
      "name": "name"
    }
  ],
  "custom_event_name": "custom_event_name",
  "event_type": "event_type",
  "name": "name",
  "source_ids": [
    "string"
  ],
  "sources": [
    {
      "id": "id",
      "name": "name"
    }
  ],
  "version": 0
}
Body Parameters
JSON
attribution_window_days: integer

Use 30 unless this account is enabled for custom attribution windows.

event_type: string

A supported standard event or custom. See https://developers.openai.com/ads/supported-events.

minLength1
name: string

Display name for the conversion.

minLength1
source_ids: array of string

One or more conversion source IDs belonging to this account, returned as id by pixel creation. Do not substitute Pixel IDs.

minItems1
custom_event_name: optional string

Required when event_type is custom. Use the same name when sending events.

minLength1
Returns
id: string
ad_account_id: string
archived: boolean
attribution_window_days: integer
campaigns: array of object { id, name }
id: string
name: string
custom_event_name: string or null
event_type: string
name: string
source_ids: array of string
sources: array of object { id, name }
id: string
name: string or null
version: integer
Returns Examples
200 — Example
{
  "id": "id",
  "ad_account_id": "ad_account_id",
  "archived": true,
  "attribution_window_days": 0,
  "campaigns": [
    {
      "id": "id",
      "name": "name"
    }
  ],
  "custom_event_name": "custom_event_name",
  "event_type": "event_type",
  "name": "name",
  "source_ids": [
    "string"
  ],
  "sources": [
    {
      "id": "id",
      "name": "name"
    }
  ],
  "version": 0
}