{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/creative/get-creative-delivery-response.json",
  "title": "Get Creative Delivery Response",
  "description": "Response payload for get_creative_delivery task. Returns creative delivery data with variant-level breakdowns including manifests and metrics.",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/version-envelope.json"
    },
    {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/protocol-envelope.json"
    }
  ],
  "properties": {
    "account_id": {
      "type": "string",
      "description": "Account identifier. Present when the response spans or is scoped to a specific account.",
      "x-entity": "account"
    },
    "media_buy_id": {
      "type": "string",
      "description": "Publisher's media buy identifier. Present when the request was scoped to a single media buy.",
      "x-entity": "media_buy"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217 currency code for monetary values in this response (e.g., 'USD', 'EUR')",
      "pattern": "^[A-Z]{3}$"
    },
    "reporting_period": {
      "type": "object",
      "description": "Date range for the report.",
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 start timestamp"
        },
        "end": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 end timestamp"
        },
        "timezone": {
          "type": "string",
          "description": "IANA timezone identifier for the reporting period (e.g., 'America/New_York', 'UTC'). Platforms report in their native timezone."
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": true
    },
    "creatives": {
      "type": "array",
      "description": "Creative delivery data with variant breakdowns",
      "items": {
        "type": "object",
        "properties": {
          "creative_id": {
            "type": "string",
            "description": "Creative identifier",
            "x-entity": "creative"
          },
          "media_buy_id": {
            "type": "string",
            "description": "Publisher's media buy identifier for this creative. Present when the request spanned multiple media buys, so the buyer can correlate each creative to its media buy.",
            "x-entity": "media_buy"
          },
          "format_id": {
            "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/format-id.json",
            "description": "**DEPRECATED in 3.2.** Legacy named format of this creative. New responses use `format_kind` and optional `format_option_ref`.",
            "deprecated": true
          },
          "format_kind": {
            "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/canonical-format-kind.json",
            "description": "Canonical format kind delivered for this creative."
          },
          "format_option_ref": {
            "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/format-option-ref.json",
            "description": "Portable reference to the product or publisher format option used for delivery, when disambiguation is required."
          },
          "totals": {
            "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/delivery-metrics.json",
            "description": "Aggregate delivery metrics across all variants of this creative"
          },
          "variant_count": {
            "type": "integer",
            "description": "Total number of agent-unique variant_id rows for this creative. When max_variants was specified in the request, this may exceed the number of items in the variants array.",
            "minimum": 0
          },
          "variants": {
            "type": "array",
            "description": "Variant-level delivery breakdown. Each agent-unique variant_id identifies one immutable served execution and each row includes metrics from exactly one source revision and, for localized delivery, exactly one locale variant. A distinct revision, locale, or rendered manifest receives a distinct variant_id; metrics MUST NOT cross those boundaries. For standard creatives, contains one row per source revision and locale represented in the reporting period. For asset group optimization, one per combination, source revision, and locale. For generative creative, one per generated execution, source revision, and locale. Empty when a creative has no variants yet.",
            "items": {
              "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/creative-variant.json"
            },
            "x-adcp-validation": {
              "verifier_constraints": {
                "revision_homogeneous_rows": {
                  "row_key": [
                    "variant_id"
                  ],
                  "row_key_unique": true,
                  "variant_id_scope": {
                    "default": "unique_within_agent_and_creative",
                    "when_creative_supports_revisions": "agent_unique_immutable_and_unambiguous_for_variant_preview_when_supported"
                  },
                  "native_identifier_reuse": "map_each_distinct_revision_locale_or_rendered_execution_to_a_distinct_adcp_variant_id",
                  "metrics_must_not_cross_revision_boundary": true,
                  "metrics_must_not_cross_locale_boundary": true,
                  "locale_variant_membership": "source_revision_localization_topology",
                  "variant_count": "count_distinct_row_keys_before_max_variants_limit"
                }
              },
              "spec": "docs/creative/task-reference/get_creative_delivery.mdx#revision-attribution"
            }
          }
        },
        "required": [
          "creative_id",
          "variants"
        ],
        "additionalProperties": true
      }
    },
    "pagination": {
      "type": "object",
      "description": "Pagination information. Present when the request included pagination parameters. **Note:** `get_creative_delivery` uses page-based pagination (`limit`/`offset`) for historical reasons, distinct from the cursor-based [`PaginationResponse`](/schemas/v3/core/pagination-response.json) used by `list_*` tools. Field naming aligned with `PaginationResponse.total_count` in 3.1; the legacy `total` field is retained as a deprecated alias until 4.0. Sellers MUST populate both fields identically; buyers SHOULD prefer `total_count` (the canonical name) and ignore `total` if both are present.",
      "properties": {
        "limit": {
          "type": "integer",
          "description": "Maximum number of creatives requested",
          "minimum": 1
        },
        "offset": {
          "type": "integer",
          "description": "Number of creatives skipped",
          "minimum": 0
        },
        "has_more": {
          "type": "boolean",
          "description": "Whether more creatives are available beyond this page"
        },
        "total_count": {
          "type": "integer",
          "description": "Total number of creatives matching the request filters. Canonical field name (matches `PaginationResponse.total_count`). Sellers SHOULD populate this and the deprecated `total` field identically until 4.0; buyers SHOULD prefer this field.",
          "minimum": 0
        },
        "total": {
          "type": "integer",
          "description": "**Deprecated** — use `total_count` instead. Retained as a legacy alias for 3.x backward compatibility; removed in AdCP 4.0. Sellers populating this field MUST also populate `total_count` with the same value.",
          "minimum": 0,
          "deprecated": true
        }
      },
      "required": [
        "limit",
        "offset",
        "has_more"
      ],
      "additionalProperties": true
    },
    "errors": {
      "type": "array",
      "description": "Task-specific errors and warnings",
      "items": {
        "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/error.json"
      }
    },
    "context": {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/context.json"
    },
    "ext": {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.7/core/ext.json"
    }
  },
  "required": [
    "reporting_period",
    "currency",
    "creatives"
  ],
  "additionalProperties": true
}
