Skip to main content

get_media_buy_artifacts

Retrieve content artifacts from a media buy for validation. This is separate from get_media_buy_delivery which returns performance metrics - artifacts contain the actual content (text, images, video) where ads were placed. Response time: < 5s (batch of 1,000 artifacts)

Data Flow

The buyer requests artifacts from the seller using the same media buy parameters. The seller returns content samples based on the agreed sampling rate. The buyer then validates these against the verification agent.

Request

Schema: get-media-buy-artifacts-request.json
ParameterTypeRequiredDescription
account_idstringNoFilter to a specific account. Only returns artifacts for media buys belonging to this account. When omitted, returns artifacts across all accessible accounts. Optional if the agent has a single account.
media_buy_idstringYesMedia buy to get artifacts from
package_idsarrayNoFilter to specific packages
samplingobjectNoSampling parameters (defaults to media buy agreement)
time_rangeobjectNoFilter to specific time period
paginationobjectNoPagination parameters (see below)

Sampling Options

{
  "sampling": {
    "rate": 0.25,
    "method": "random"
  }
}
MethodDescription
randomRandom sample across all deliveries
stratifiedSample proportionally across packages/properties
recentMost recent deliveries first
failures_onlyOnly artifacts that failed local evaluation

Pagination

Uses higher limits than standard pagination because artifact result sets can be very large.
ParameterTypeDefaultDescription
pagination.max_resultsinteger1000Maximum artifacts per page (1-10,000)
pagination.cursorstring-Opaque cursor from a previous response

Response

Schema: get-media-buy-artifacts-response.json

Success Response

{
  "$schema": "/schemas/content-standards/get-media-buy-artifacts-response.json",
  "media_buy_id": "mb_nike_reddit_q1",
  "artifacts": [
    {
      "record_id": "imp_12345",
      "timestamp": "2025-01-15T10:30:00Z",
      "package_id": "pkg_feed_standard",
      "artifact": {
        "property_id": {"type": "domain", "value": "reddit.com"},
        "artifact_id": "r_fitness_abc123",
        "assets": [
          {"type": "text", "role": "title", "content": "Best protein sources for muscle building", "language": "en"},
          {"type": "text", "role": "paragraph", "content": "Looking for recommendations on high-quality protein sources for recovery", "language": "en"},
          {"type": "image", "url": "https://cdn.reddit.com/fitness-image.jpg", "alt_text": "Person lifting weights"}
        ]
      },
      "country": "US",
      "channel": "social",
      "brand_context": {"brand_id": "nike_global", "sku_id": "air_max_2025"},
      "local_verdict": "pass"
    },
    {
      "record_id": "imp_12346",
      "timestamp": "2025-01-15T10:35:00Z",
      "package_id": "pkg_feed_standard",
      "artifact": {
        "property_id": {"type": "domain", "value": "reddit.com"},
        "artifact_id": "r_news_politics_456",
        "assets": [
          {"type": "text", "role": "title", "content": "Election Results Analysis", "language": "en"},
          {"type": "text", "role": "paragraph", "content": "The latest polling data shows a tight race between candidates", "language": "en"}
        ]
      },
      "country": "US",
      "channel": "social",
      "brand_context": {"brand_id": "nike_global", "sku_id": "air_max_2025"},
      "local_verdict": "fail"
    }
  ],
  "sampling_info": {
    "total_deliveries": 100000,
    "sampled_count": 1000,
    "effective_rate": 0.01,
    "method": "random"
  },
  "pagination": {
    "cursor": "eyJvZmZzZXQiOjEwMDB9",
    "has_more": true
  }
}

Response Fields

FieldDescription
artifactsArray of delivery records with full artifact content
artifacts[].countryISO 3166-1 alpha-2 country code where delivery occurred
artifacts[].channelChannel type (display, video, audio, social)
artifacts[].brand_contextBrand/SKU information for policy evaluation (schema TBD)
artifacts[].local_verdictSeller’s local model verdict (pass/fail/unevaluated)
sampling_infoHow the sample was generated
paginationCursor for fetching more results

Use Cases

Validate Sample Against Standards

# Get artifacts from seller
artifacts_response = seller_agent.get_media_buy_artifacts(
    media_buy_id="mb_nike_reddit_q1",
    sampling={"rate": 0.25, "method": "random"}
)

# Convert to validation records
records = [
    {
        "record_id": a["record_id"],
        "timestamp": a["timestamp"],
        "media_buy_id": artifacts_response["media_buy_id"],
        "artifact": a["artifact"],
        "country": a.get("country"),
        "channel": a.get("channel"),
        "brand_context": a.get("brand_context")
    }
    for a in artifacts_response["artifacts"]
]

# Validate against verification agent
validation = verification_agent.validate_content_delivery(
    standards_id="nike_brand_safety",
    records=records
)

# Check for drift between local and verified verdicts
for i, result in enumerate(validation["results"]):
    local = artifacts_response["artifacts"][i]["local_verdict"]
    verified = result["verdict"]
    if local != verified:
        print(f"Drift detected: {result['record_id']} - local={local}, verified={verified}")

Focus on Local Failures

# Get only artifacts that failed local evaluation
failures = seller_agent.get_media_buy_artifacts(
    media_buy_id="mb_nike_reddit_q1",
    sampling={"method": "failures_only"},
    pagination={"max_results": 100}
)

# Verify these were correctly flagged
validation = verification_agent.validate_content_delivery(
    standards_id="nike_brand_safety",
    records=[{"record_id": a["record_id"], "artifact": a["artifact"]}
             for a in failures["artifacts"]]
)

# Check false positive rate
false_positives = sum(1 for r in validation["results"] if r["verdict"] == "pass")
print(f"False positive rate: {false_positives / len(failures['artifacts']):.1%}")

Delivery vs Artifacts

Aspectget_media_buy_deliveryget_media_buy_artifacts
PurposePerformance reportingContent validation
Data sizeSmall (metrics)Large (full content)
FrequencyRegular reportingSampled validation
ContainsImpressions, clicks, spendText, images, video
ConsumerBuyer for optimizationVerification agent