> ## Documentation Index
> Fetch the complete documentation index at: https://adcp-docs-ja.pier1.co.jp/llms.txt
> Use this file to discover all available pages before exploring further.

# フォーマット参照

> AdCP における format_id（構造化識別子オブジェクト）と format（完全な定義オブジェクト）の規範的リファレンス。

AdCP はクリエイティブフォーマットを扱うとき、関連するが明確に異なる 2 つの概念を使います。名前が似ているため、再発する実装エラーを引き起こします — このページは両方を正確に定義し、2 つの失敗モードを名指しします。

## format\_id — 構造化参照オブジェクト

`format_id` は**常に JSON オブジェクト**であり、素の文字列ではありません。それは、フォーマットを宣言したエージェントとフォーマットのローカルスラッグによってフォーマットを識別します:

```json theme={null}
{
  "agent_url": "https://creative.adcontextprotocol.org",
  "id": "display_300x250"
}
```

任意の dimension と duration フィールドが、パラメーター化されたテンプレートフォーマットのためにそれを拡張します:

```json theme={null}
{
  "agent_url": "https://creative.adcontextprotocol.org",
  "id": "display_static",
  "width": 300,
  "height": 250
}
```

`format_id` は**ポインター**です — 定義を運ばずにフォーマットを名指しします。

## format — 完全な定義オブジェクト

`format` はクリエイティブフォーマットの完全な仕様です。それは `list_creative_formats` および関連タスクによって返されます。`format` オブジェクトはそのプロパティの 1 つとして `format_id` を含み、加えてアセット要件、レンダー仕様、その他すべてのメタデータを含みます:

```json theme={null}
{
  "format_id": {
    "agent_url": "https://creative.adcontextprotocol.org",
    "id": "display_300x250"
  },
  "name": "Display Banner 300×250",
  "assets": [
    { "asset_id": "image", "asset_type": "image", "item_type": "individual", "required": true }
  ],
  "renders": [
    { "role": "primary", "dimensions": { "width": 300, "height": 250 } }
  ]
}
```

`format` は**定義**です — フォーマットが何を必要とし、どうレンダリングするかを記述します。

## 一目での対比

| Concept   | Field name   | JSON type                      | Use                                                           |
| --------- | ------------ | ------------------------------ | ------------------------------------------------------------- |
| フォーマット識別子 | `format_id`  | `object` — `{ agent_url, id }` | ポインター。クリエイティブマニフェスト、リクエストフィルター、プレースメント宣言で使う。                  |
| フォーマット定義  | `format`     | `object` — 完全な仕様               | `list_creative_formats` が返す。`format_id` をネストされたフィールドとして含む。    |
| 識別子の配列    | `format_ids` | `format_id` オブジェクトの `array`    | `list_creatives`、`list_creative_formats`、関連リクエストのフィルターパラメーター。 |
| 定義の配列     | `formats`    | `format` オブジェクトの `array`       | `list_creative_formats` のレスポンスフィールド。                          |

## 名前付きの 2 つの失敗モード

### アンチパターン A — `format_id` スロットの文字列

誤り — `format_id` は素の文字列ではなくオブジェクトでなければなりません:

```json theme={null}
{ "format_id": "display_300x250" }
```

正しい:

```json theme={null}
{ "format_id": { "agent_url": "https://creative.adcontextprotocol.org", "id": "display_300x250" } }
```

AJV エラー: `format_id must be of type object`。原因: `format_id` オブジェクト内の `.id` 文字列が自己完結した名前のように見え、時に抽出されて直接使われる。

### アンチパターン B — `format` / `formats` スロットの format\_id オブジェクト

誤り — `formats[]` の要素は素の `format_id` ではなく完全な定義オブジェクトでなければなりません:

```json theme={null}
{
  "formats": [
    { "agent_url": "https://creative.adcontextprotocol.org", "id": "display_300x250" }
  ]
}
```

正しい:

```json theme={null}
{
  "formats": [
    {
      "format_id": { "agent_url": "https://creative.adcontextprotocol.org", "id": "display_300x250" },
      "name": "Display Banner 300×250",
      "assets": [ { "asset_id": "image", "asset_type": "image", "item_type": "individual", "required": true } ]
    }
  ]
}
```

AJV エラー: `formats[0] must have required property 'name'`。原因: `format_id` と `format` はどちらもオブジェクト。より短いオブジェクトが、より大きいものを期待するスロットに時に置かれる。

## 関連項目

* [クリエイティブフォーマット](/docs/creative/formats) — 完全なフォーマットオブジェクト構造、アセットタイプ、レンダー仕様
* [テンプレートフォーマット ID](/docs/creative/template-format-ids) — dimension 可変テンプレート用のパラメーター化されたフォーマット ID
