---
title: "Train Custom Model"
method: POST
path: "/custom/models"
---

# Train Custom Model

`POST /custom/models`

Create and train a custom model. The request must include a source parameter that is either an externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained is expected to be under the source folder or sub folders under it. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff'. Other type of content is ignored.

## Request body

- TrainRequest — Request parameter to train a new custom model.
  - `source` string, required — Source path containing the training documents.
  - `sourceFilter` TrainSourceFilter — Filter to apply to the documents in the source path for training.
    - `prefix` string — A case-sensitive prefix string to filter documents in the source path for training. For example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for training.
    - `includeSubFolders` boolean — A flag to indicate if sub folders within the set of prefix folders will also need to be included when searching for content to be preprocessed.
  - `useLabelFile` boolean — Use label file for training a model.

## Response `201`

Request is queued successfully.

## Other responses

- `default` — Response entity accompanying non-successful responses containing additional details about the error.

---

[API](https://skmtc.dev/azure/apis/form-recognizer-client.md) · [All operations](https://skmtc.dev/azure/apis/form-recognizer-client/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/form-recognizer-client/revisions/f77e48809807/schema)
