{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.0.0/core/format-id.json",
  "title": "Format ID",
  "description": "Structured format identifier with agent URL and format name. Can reference: (1) a concrete format with fixed dimensions (id only), (2) a template format without parameters (id only), or (3) a template format with parameters (id + dimensions/duration). Template formats accept parameters in format_id while concrete formats have fixed dimensions in their definition. Parameterized format IDs create unique, specific format variants.",
  "x-entity": "creative_format",
  "type": "object",
  "properties": {
    "agent_url": {
      "type": "string",
      "format": "uri",
      "description": "URL of the agent that defines this format (e.g., 'https://creatives.adcontextprotocol.org' for standard formats, or 'https://publisher.com/.well-known/adcp/sales' for custom formats)"
    },
    "id": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]+$",
      "description": "Format identifier within the agent's namespace (e.g., 'display_static', 'video_hosted', 'audio_standard'). When used alone, references a template format. When combined with dimension/duration fields, creates a parameterized format ID for a specific variant."
    },
    "width": {
      "type": "integer",
      "minimum": 1,
      "description": "Width in pixels for visual formats. When specified, height must also be specified. Both fields together create a parameterized format ID for dimension-specific variants."
    },
    "height": {
      "type": "integer",
      "minimum": 1,
      "description": "Height in pixels for visual formats. When specified, width must also be specified. Both fields together create a parameterized format ID for dimension-specific variants."
    },
    "duration_ms": {
      "type": "number",
      "minimum": 1,
      "description": "Duration in milliseconds for time-based formats (video, audio). When specified, creates a parameterized format ID. Omit to reference a template format without parameters."
    }
  },
  "required": [
    "agent_url",
    "id"
  ],
  "additionalProperties": true,
  "dependencies": {
    "width": [
      "height"
    ],
    "height": [
      "width"
    ]
  }
}
