> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 学習

データ抽出モデルを学習します。

<div id="http-request">
  ## HTTP リクエスト
</div>

```http theme={null}
POST https://api-{location-id}.flexicapture.com/v2/training
```

`{location-id}` を[対応ロケーション](/ja/flexi-capture/cloud/cloud-f-cfor-invoices-api#icaas-supported-countries)に応じた値に置き換えます。

<div id="request-body">
  ## リクエスト本文
</div>

リクエスト本文には、次の構造のデータが含まれます。

```json theme={null}
{
  "task_id": "string",
  "file_id": "string",
  "fields": [
    {
      "name": "string",
      "rectangles": [
        {
          "page_id": 0,
          "x1": 0,
          "y1": 0,
          "x2": 0,
          "y2": 0
        }
      ]
    }
  ]
}
```

<div id="fields">
  ### フィールド
</div>

| field   | 型                                      | 説明                |
| ------- | -------------------------------------- | ----------------- |
| `model` | body, object(TrainingCommandViewModel) | 必須。学習に使用する Model。 |

<div id="trainingcommandviewmodel">
  ### TrainingCommandViewModel
</div>

| field      | 型                             | 説明                  |
| ---------- | ----------------------------- | ------------------- |
| `task_id`  | string                        | 必須。タスクID。           |
| `file_id`  | string                        | 必須。ファイル ID。         |
| `fields[]` | object(FieldCommandViewModel) | 必須。学習用の field のセット。 |

<div id="fieldcommandviewmodel">
  ### FieldCommandViewModel
</div>

| field          | 型                          | 説明            |
| -------------- | -------------------------- | ------------- |
| `name`         | string                     | 必須。field の名前。 |
| `rectangles[]` | object(RectangleViewModel) | 必須。field の矩形。 |

<div id="rectangleviewmodel">
  ### RectangleViewModel
</div>

| field     | 型                | 説明           |
| --------- | ---------------- | ------------ |
| `page_id` | integer(\$int32) | 必須。内部ページ ID。 |
| `x1`      | integer(\$int32) | 必須。x1 の座標。   |
| `y1`      | integer(\$int32) | 必須。y1 の座標。   |
| `x2`      | integer(\$int32) | 必須。x2 の座標。   |
| `y2`      | integer(\$int32) | 必須。y2 の座標。   |

<div id="response">
  ## レスポンス
</div>

成功した場合、サーバーから HTTP ステータス `204 No Content` が返されます。
