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
| Parameter | Type | Required | Description |
|---|---|---|---|
buyer_ref | string | Yes | Your reference identifier for this media buy |
packages | Package[] | Yes | Array of package configurations (see below) |
brand_manifest | BrandManifestRef | Yes | Brand identity - minimal (name/URL) acceptable for sales agents. See Brand Manifest |
start_time | string | Yes | "asap" or ISO 8601 date-time |
end_time | string | Yes | ISO 8601 date-time (UTC unless timezone specified) |
po_number | string | No | Purchase order number |
reporting_webhook | ReportingWebhook | No | Automated reporting delivery configuration |
Package Object
| Parameter | Type | Required | Description |
|---|---|---|---|
buyer_ref | string | Yes | Your reference for this package |
product_id | string | Yes | Product ID from get_products |
pricing_option_id | string | Yes | Pricing option ID from product’s pricing_options array |
format_ids | FormatID[] | Yes | Format IDs that will be used - must be supported by product |
budget | number | Yes | Budget in currency specified by pricing option |
pacing | string | No | "even" (default), "asap", or "front_loaded" |
bid_price | number | No | Bid price for auction pricing (required when is_fixed is false) |
targeting_overlay | TargetingOverlay | No | Additional targeting criteria (see Targeting) |
creative_ids | string[] | No | Existing library creative IDs to assign |
creatives | CreativeAsset[] | No | Full creative objects to upload and assign |
Response
Success Response
| Field | Description |
|---|---|
media_buy_id | Publisher’s unique identifier |
buyer_ref | Your reference identifier |
creative_deadline | ISO 8601 timestamp for creative upload deadline |
packages | Array of created packages with complete state |
Error Response
| Field | Description |
|---|---|
errors | Array of error objects explaining failure |
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:| Error Code | Description | Resolution |
|---|---|---|
PRODUCT_NOT_FOUND | Invalid product_id | Verify product exists via get_products |
FORMAT_INCOMPATIBLE | Format not supported by product | Check product’s format_ids field |
BUDGET_INSUFFICIENT | Budget below product minimum | Increase budget or choose different product |
TARGETING_TOO_NARROW | Targeting yields zero inventory | Broaden geographic or audience criteria |
POLICY_VIOLATION | Brand/product violates policy | Review publisher’s content policies |
INVALID_PRICING_OPTION | pricing_option_id not found | Use ID from product’s pricing_options |
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
Brand Manifest
Thebrand_manifest field identifies the advertiser for policy compliance and business purposes.
Minimal manifests are acceptable for sales agents:
Pricing & Currency
Each package specifies itspricing_option_id, which determines:
- Currency (USD, EUR, etc.)
- Pricing model (CPM, CPCV, CPP, etc.)
- Rate and whether it’s fixed or auction-based
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
Format Workflow
Why Format Specification Matters
When creating a media buy, format specification enables:- Placeholder Creation - Publisher creates placeholders in ad server with correct specs
- Validation - System validates products support requested formats
- Clear Expectations - Both parties know exactly what’s needed
- Progress Tracking - Track which assets are missing vs. required
- 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_formatsoutput - Creative requirements can be fulfilled within timeline
Asynchronous Operations
This task can complete instantly or take days depending on complexity and approval requirements. The response includes astatus field that tells you what happened and what to do next.
| Status | Meaning | Your Action |
|---|---|---|
completed | Done immediately | Process the result |
working | Processing (~2 min) | Poll frequently or wait for webhook |
submitted | Long-running (hours/days) | Use webhooks or poll infrequently |
input-required | Needs your input | Read message, respond with info |
failed | Error occurred | Handle the error |
- MCP
- A2A
Usage Notes
- Total budget is distributed across packages based on individual
budgetvalues - Both media buys and packages have
buyer_reffields 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:- Brand/products align with selected packages
- Creatives match declared brand/products
- Campaign complies with all advertising policies
Next Steps
After creating a media buy:- Upload Creatives: Use
sync_creativesbefore deadline - Monitor Status: Use
get_media_buy_delivery - Optimize: Use
provide_performance_feedback - Update: Use
update_media_buyto modify campaign
Learn More
- Media Buy Lifecycle - Complete campaign workflow
- get_products - Discover inventory
- Targeting - Targeting strategies
- Pricing Models - Currency and pricing