> ## 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.

# Entraîner

Entraîner un Model de capture de données.

<div id="http-request">
  ## Requête HTTP
</div>

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

Remplacez `{location-id}` par votre [localisation prise en charge](/fr/flexi-capture/cloud/cloud-f-cfor-invoices-api#icaas-supported-countries).

<div id="request-body">
  ## Corps de la requête
</div>

Le corps de la requête contient des données ayant la structure suivante :

```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">
  ### Champs
</div>

| Champ   | Type                                    | Description                                     |
| ------- | --------------------------------------- | ----------------------------------------------- |
| `model` | corps, object(TrainingCommandViewModel) | Obligatoire. Model utilisé pour l’entraînement. |

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

| Champ      | Type                          | Description                                          |
| ---------- | ----------------------------- | ---------------------------------------------------- |
| `task_id`  | string                        | Obligatoire. ID de la tâche.                         |
| `file_id`  | string                        | Obligatoire. ID du fichier.                          |
| `fields[]` | object(FieldCommandViewModel) | Obligatoire. Ensemble de champs pour l’entraînement. |

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

| Champ          | Type                       | Description                       |
| -------------- | -------------------------- | --------------------------------- |
| `name`         | string                     | Obligatoire. Nom du champ.        |
| `rectangles[]` | object(RectangleViewModel) | Obligatoire. Rectangles du champ. |

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

| Champ     | Type             | Description                         |
| --------- | ---------------- | ----------------------------------- |
| `page_id` | integer(\$int32) | Obligatoire. ID interne de la page. |
| `x1`      | integer(\$int32) | Obligatoire. Coordonnée x1.         |
| `y1`      | integer(\$int32) | Obligatoire. Coordonnée y1.         |
| `x2`      | integer(\$int32) | Obligatoire. Coordonnée x2.         |
| `y2`      | integer(\$int32) | Obligatoire. Coordonnée y2.         |

<div id="response">
  ## Réponse
</div>

En cas de succès, le serveur renvoie le code d’état HTTP `204 No Content`.
