Skip to main content
Create a media buy from selected packages. Handles validation, approval if needed, and campaign creation. Response Time: Instant to days (returns completed, working < 120s, or submitted for hours/days) Request Schema: /schemas/v2/media-buy/create-media-buy-request.json Response Schema: /schemas/v2/media-buy/create-media-buy-response.json

Quick Start

Create a simple media buy with two packages:

Request Parameters

Package Object

Response

Success Response

Error Response

Note: Responses use discriminated unions - you get either success fields OR errors, never both. Always check for errors before accessing success fields.

Common Scenarios

Campaign with Targeting

Add geographic restrictions and frequency capping:

Campaign with Inline Creatives

Upload creatives at the same time as creating the campaign:

Campaign with Reporting Webhook

Receive automated reporting notifications:

Error Handling

Common errors and resolutions: Example error response:

Key Concepts

Format Specification

Format IDs are required for each package because:
  • Publishers create placeholder creatives in ad servers
  • Both parties know exactly what creative assets are needed
  • Validation ensures products support requested formats
  • Progress tracking shows which assets are missing
See Format Workflow below for complete details.

Brand Manifest

The brand_manifest field identifies the advertiser for policy compliance and business purposes. Minimal manifests are acceptable for sales agents:
Full manifests with colors, fonts, and product catalogs are only needed for creative generation. See Brand Manifest.

Pricing & Currency

Each package specifies its pricing_option_id, which determines:
  • Currency (USD, EUR, etc.)
  • Pricing model (CPM, CPCV, CPP, etc.)
  • Rate and whether it’s fixed or auction-based
Packages can use different currencies when sellers support it. See Pricing Models.

Targeting Overlays

Use sparingly - most targeting should be in your brief and handled through product selection. Use overlays only for:
  • Geographic restrictions (RCT testing, regulatory compliance)
  • Frequency capping
  • AXE segment inclusion/exclusion
See Targeting for details.

Format Workflow

Why Format Specification Matters

When creating a media buy, format specification enables:
  1. Placeholder Creation - Publisher creates placeholders in ad server with correct specs
  2. Validation - System validates products support requested formats
  3. Clear Expectations - Both parties know exactly what’s needed
  4. Progress Tracking - Track which assets are missing vs. required
  5. Technical Setup - Ad server configured before creatives arrive

Complete Workflow

Format Validation

Publishers MUST validate:
  • All formats are supported by the product
  • Format specifications match list_creative_formats output
  • Creative requirements can be fulfilled within timeline
Invalid format example:

Asynchronous Operations

This task can complete instantly or take days depending on complexity and approval requirements. The response includes a status field that tells you what happened and what to do next. Note: For the complete status list see Core Concepts - Task Status System.

Immediate Success (completed)

The task completed synchronously. No async handling needed.Request:
Response:

Long-Running (submitted)

The task is queued for manual approval. Configure a webhook to receive updates.Request with webhook:
Initial response:
Webhook POST when approved:

Error (failed)

Response:
For complete async handling patterns, see Task Management.

Usage Notes

  • Total budget is distributed across packages based on individual budget values
  • Both media buys and packages have buyer_ref fields for tracking
  • Creative assets must be uploaded before deadline for campaign activation
  • AXE segments enable advanced audience targeting
  • Pending states (working, submitted) are normal, not errors
  • Orchestrators MUST handle pending states as part of normal workflow

Policy Compliance

Brand and products are validated during creation. Policy violations return errors:
Publishers should ensure:
  • Brand/products align with selected packages
  • Creatives match declared brand/products
  • Campaign complies with all advertising policies

Next Steps

After creating a media buy:
  1. Upload Creatives: Use sync_creatives before deadline
  2. Monitor Status: Use get_media_buy_delivery
  3. Optimize: Use provide_performance_feedback
  4. Update: Use update_media_buy to modify campaign

Learn More