Skip to main content
Template formats allow a single format definition to support multiple dimension or duration variants without creating separate format definitions for each variant. This eliminates format explosion when publishers support many similar variants.

The Problem: Format Explosion

Without template formats, each dimension variant requires a separate format definition and format_id:
Publisher with 50 placement sizes → 50 separate format definitions to create, maintain, and document.

The Solution: Template Formats with Parameters

A single template format definition (display_static) accepts dimension fields in the format_id object, allowing creatives to specify their exact dimensions.

Format Types and Format IDs

There are two types of format definitions, which produce three types of format IDs:

Format Definitions

  1. Concrete formats - Fixed dimensions in format definition
    • Have renders array with explicit dimensions
    • Example: display_300x250 always means 300×250px
    • Cannot accept parameters
  2. Template formats - Accept parameters in format_id
    • Have accepts_parameters array listing accepted parameters
    • Example: display_static can be any dimensions
    • Can be used with or without parameters

Format IDs

  1. Concrete format_id - References a concrete format
    • Example: {id: "display_300x250"}
    • No parameters (none accepted)
  2. Template format_id - References a template format without parameters
    • Example: {id: "display_static"}
    • Used in placements to accept any dimensions
  3. Parameterized format_id - Template format with parameters
    • Example: {id: "display_static", width: 300, height: 250}
    • Used in creatives to specify exact dimensions (in pixels)

Template Format Definition

Format definition that accepts parameters:
Key fields:
  • accepts_parameters: ["dimensions"] - Format accepts dimensions (width/height in pixels) in format_id
  • renders[].parameters_from_format_id: true - Render parameters come from format_id
  • requirements.parameters_from_format_id: true - Asset parameters must match format_id

Parameterized Format ID (Creative Manifest)

Creative specifies exact dimensions in format_id to use the template format:
This format_id is parameterized: Same dimensions always produce the same format_id object, enabling deduplication and caching.

Placement Constraints

CRITICAL: Sales agents MUST always return parameterized format_ids (with specific dimensions/duration) in placements. Template format_ids without parameters are ONLY used in format definitions from list_creative_formats(). Publishers specify supported dimensions by listing all supported variants:
Validation: Creative’s format_id must exactly match one of the placement’s parameterized format_ids. Why parameterized only in placements:
  • Buyers need to know exactly which dimensions are supported
  • No ambiguity about what will be accepted
  • Enables clear validation at creative submission time
  • Template format_ids without parameters are only for format discovery via list_creative_formats()

Benefits

Scalability - One template format supports unlimited dimension variants ✅ Predictable - Same dimensions = same format_id (enables caching/deduplication) ✅ Self-contained - Creatives fully specify their format via format_id ✅ Portable - A 300×250 creative works on any placement accepting 300×250 ✅ Publisher control - Placements specify exact dimension constraints ✅ Type-safe - Width/height are numbers, not encoded strings ✅ Backward compatible - Concrete (non-template) formats work unchanged

Format ID Fields

Visual Formats (Display, DOOH, Native)

Fields:
  • width (integer, minimum: 1) - Width in pixels
  • height (integer, minimum: 1) - Height in pixels
Example:

Time-Based Formats (Video, Audio)

Fields:
  • duration_ms (number, minimum: 1) - Duration in milliseconds
Example:

Combined (Video with Dimensions)

Fields:
  • width, height (integers) - Video frame dimensions in pixels
  • duration_ms (number) - Video length in milliseconds
Example:

Format Definition Patterns

Display Format (Flexible Dimensions)

Video Format (Flexible Duration)

DOOH Format (Pixel Dimensions)

Creative with pixel dimensions:
Note: All dimensions are in pixels. Physical screen dimensions (e.g., 48 feet × 14 feet billboard) are placement metadata, not format specifications.

Generative Formats with Output Formats

Generative formats specify which output formats they can produce: Option 1: Generate specific dimensions
Option 2: Generate any dimension (template output)
Use template outputs when your generation logic can handle arbitrary dimensions. Buyer specifies dimensions when calling the generative format.

Discovery Pattern

Format Definitions: list_creative_formats()

Both creative and sales agents can return template format definitions via list_creative_formats():
Purpose: Buyers discover what format types are available and what parameters they accept.

Placement Constraints: get_products()

REQUIREMENT: Sales agents MUST return parameterized format_ids (with specific dimensions/duration) in placements. Template format_ids without parameters are NOT allowed in placement specifications.
Purpose: Buyers discover which specific dimensions are supported for each placement. Why parameterized format_ids are required in placements:
  • Provides explicit list of accepted dimension variants
  • Eliminates ambiguity about what will be accepted
  • Enables clear validation at creative submission time
  • Buyers can match their creative dimensions against specific placement requirements
Discovery Flow:
  1. Buyer calls list_creative_formats() on creative or sales agent → learns display_static is a template format that accepts dimensions
  2. Buyer calls get_products() on sales agent → learns which specific dimensions are supported (300×250, 728×90)
  3. Buyer creates creative with parameterized format_id matching one of the placement’s supported dimensions

Implementation Guidelines

For Creative Agents

Format definitions:
  • Set accepts_parameters: ["dimensions"] for formats with flexible dimensions
  • Set accepts_parameters: ["duration"] for formats with flexible duration
  • Set accepts_parameters: ["dimensions", "duration"] for formats with both (e.g., video with dimensions)
  • Omit renders array when format accepts dimensions (dimensions come from format_id)
  • Include renders array for concrete formats with fixed dimensions
Validation:
  • Validate format_id dimensions against asset dimensions
  • Ensure width/height/unit are present together (not partial)
  • Return clear errors if format_id doesn’t match assets
Format lookup/matching:
  • list_creative_formats() returns template formats (without dimension parameters)
  • Format lookup by ID matches on base format (agent_url + id), ignoring dimension parameters
  • Example: Request for {id: "display_static", width: 300, height: 250} matches the template format {id: "display_static"}
  • Dimension parameters are used for creative validation, not format discovery

For Sales Agents

Product responses - CRITICAL REQUIREMENT:
  • MUST always return parameterized format_ids with specific dimensions/duration in placements
  • NEVER return template format_ids without parameters in placement format_ids arrays
  • List all supported dimension/duration variants explicitly:
Why this requirement exists:
  • Buyers need explicit lists of supported dimensions
  • No ambiguity about what will be accepted
  • Enables validation at creative submission time
  • Template format_ids without parameters are ONLY for list_creative_formats() responses
Creative validation:
  • Ensure creative format_id exactly matches at least one placement format_id
  • Match requires exact equality of all fields: agent_url, id, width, height, duration_ms
  • No partial matches or “close enough” dimensions

For Buyers

Creative manifest construction:
  • Fetch format definitions to check accepts_parameters array
  • Include dimension/duration fields in format_id when using template formats
  • Ensure asset dimensions match format_id dimensions
  • Validate against placement format_ids before syncing

Format ID Equality Rules

Two format_ids are identical if and only if:
  • agent_url matches exactly
  • id matches exactly
  • width matches exactly (if present)
  • height matches exactly (if present)
  • duration_ms matches exactly (if present)

Canonicalization

When comparing format_ids for equality or caching: Required fields:
  • Both width and height must be present together (cannot specify only one)
  • All dimensions are in pixels (integers)
Numeric precision:
  • Width and height are integers (300 not 300.5)
  • Duration can be decimal (30000.5ms for fractional seconds)
Field order:
  • JSON field order does NOT matter for equality
  • {"width": 300, "height": 250} equals {"height": 250, "width": 300}
Example equivalence:

Matching Logic

Placement Validation

IMPORTANT: Placements MUST always specify parameterized format_ids with explicit dimensions/duration. Template format_ids without parameters are NOT allowed in placements. Parameterized formats in placement (REQUIRED pattern):

Migration from Concrete Formats

Before (format explosion):
After (single template format):
Creative manifest change:

Common Patterns

IAB Standard Display Sizes

Instead of defining 15 separate formats for IAB sizes, use one template:
Creatives specify their size via parameters:
  • 300×250: {id: "display_static", width: 300, height: 250}
  • 728×90: {id: "display_static", width: 728, height: 90}
  • 160×600: {id: "display_static", width: 160, height: 600}
  • etc.

Video Duration Variants

Instead of separate 15s, 30s, 60s format definitions:
Creatives specify duration: {id: "video_hosted", duration_ms: 30000}

DOOH Screen Sizes

Instead of defining formats for every billboard size:
Creatives specify pixel dimensions: {id: "dooh_static", width: 1920, height: 560} Note: All dimensions are in pixels. Physical screen size (e.g., 48 feet × 14 feet) is placement metadata.

See Also