{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.0-rc.4/media-buy/log-event-request.json",
  "title": "Log Event Request",
  "description": "Request parameters for logging marketing events",
  "type": "object",
  "allOf": [
    {
      "$ref": "/schemas/3.1.0-rc.4/core/version-envelope.json"
    }
  ],
  "x-mutates-state": true,
  "properties": {
    "event_source_id": {
      "type": "string",
      "description": "Event source configured on the account via sync_event_sources",
      "x-entity": "event_source"
    },
    "test_event_code": {
      "type": "string",
      "description": "Test event code for validation without affecting production data. Events with this code appear in the platform's test events UI."
    },
    "events": {
      "type": "array",
      "description": "Events to log",
      "items": {
        "$ref": "/schemas/3.1.0-rc.4/core/event.json"
      },
      "minItems": 1,
      "maxItems": 10000
    },
    "idempotency_key": {
      "type": "string",
      "description": "Client-generated unique key for this request. Prevents duplicate event logging on retries. MUST be unique per (seller, request) pair to prevent cross-seller correlation. Use a fresh UUID v4 for each request.",
      "minLength": 16,
      "maxLength": 255,
      "pattern": "^[A-Za-z0-9_.:-]{16,255}$"
    },
    "context": {
      "$ref": "/schemas/3.1.0-rc.4/core/context.json"
    },
    "ext": {
      "$ref": "/schemas/3.1.0-rc.4/core/ext.json"
    }
  },
  "required": [
    "idempotency_key",
    "event_source_id",
    "events"
  ],
  "additionalProperties": true
}
