Skip to main content

validate_content_delivery

Validate delivery records against content safety policies. Designed for batch auditing of where ads were actually delivered. コンテンツセーフティポリシーに照らして配信記録を検証します。広告が実際に配信された場所をバッチ監査する用途です。 非同期: 即時受け付け、バックグラウンド処理。ステータスポーリング用に validation_id を返します。

Data Flow

コンテンツアーティファクトは配信メトリクスとは別です。検証用コンテンツ取得には get_media_buy_artifacts を使います: なぜバイヤー経由か?
  • バイヤー がメディアバイの主体で、どの standards_id を適用するか把握
  • バイヤー がセラーへアーティファクトを要求(パフォーマンス指標とは別)
  • バイヤー がブランドセーフティ順守の責任主体
  • 検証エージェント はバイヤーの代理として動く
責任分界を明確にするため、セラーは get_media_buy_artifacts でコンテンツサンプルを提供し、バイヤーが検証エージェントで確認します。

Request

Schema: validate-content-delivery-request.json
ParameterTypeRequiredDescription
standards_idstringYes検証に用いるスタンダード設定 ID
recordsarrayYes検証する配信記録(最大 10,000)
feature_idsarrayNo評価する特定フィーチャー(省略時は全て)
include_passedbooleanNo合格レコードを結果に含めるか(デフォルト: true)

配信レコード

{
  "record_id": "imp_12345",
  "timestamp": "2025-01-15T10:30:00Z",
  "media_buy_id": "mb_nike_reddit_q1",
  "artifact": {
    "property_id": {"type": "domain", "value": "example.com"},
    "artifact_id": "article_12345",
    "assets": [
      {"type": "text", "role": "title", "content": "Article Title"}
    ]
  },
  "country": "US",
  "channel": "display",
  "brand_context": {
    "brand_id": "nike_global",
    "sku_id": "air_max_2025"
  }
}
FieldRequiredDescription
record_idYesこの配信レコードの一意 ID
artifactYes広告が配信されたコンテンツアーティファクト
media_buy_idNoこのレコードが属するメディアバイ(複数買付のバッチ時)
timestampNo配信時刻
countryNoISO 3166-1 alpha-2 の国コード(ターゲティング文脈)
channelNoチャネル種別(display, video, audio, social など)
brand_contextNoポリシー評価用のブランド/SKU 情報(スキーマ未定)

Response

Schema: validate-content-delivery-response.json

Success Response

{
  "summary": {
    "total_records": 1000,
    "passed_records": 950,
    "failed_records": 50,
    "total_features": 5000,
    "passed_features": 4750,
    "failed_features": 250
  },
  "results": [
    {
      "record_id": "imp_12345",
      "features": [
        {
          "feature_id": "brand_safety",
          "status": "passed",
          "value": "safe"
        }
      ]
    },
    {
      "record_id": "imp_12346",
      "features": [
        {
          "feature_id": "brand_safety",
          "status": "failed",
          "value": "high_risk",
          "message": "Content contains violence"
        }
      ]
    }
  ]
}

Use Cases

Post-Campaign Audit

def audit_campaign_delivery(campaign_id, standards_id, content_standards_agent):
    """Audit all delivery records from a campaign."""
    # Fetch delivery records from your ad server
    records = fetch_delivery_records(campaign_id)

    # Validate in batches
    batch_size = 10000
    all_results = []

    for i in range(0, len(records), batch_size):
        batch = records[i:i + batch_size]
        response = content_standards_agent.validate_content_delivery(
            standards_id=standards_id,
            records=batch
        )
        all_results.extend(response["results"])

    return all_results

Real-Time Monitoring Sample

import random

def sample_and_validate(records, standards_id, sample_size=1000):
    """Validate a random sample for real-time monitoring."""
    sample = random.sample(records, min(sample_size, len(records)))
    return content_standards_agent.validate_content_delivery(
        standards_id=standards_id,
        records=sample
    )

Filter for Issues Only

# Only get failed records to reduce response size
response = content_standards_agent.validate_content_delivery(
    standards_id="nike_emea_safety",
    records=delivery_records,
    include_passed=False  # Only return failures
)

for result in response["results"]:
    print(f"Issue with {result['record_id']}")
    for feature in result["features"]:
        if feature["status"] == "failed":
            print(f"  - {feature['feature_id']}: {feature['message']}")