Required. The parent (project, location and processor) to create the new version for. Format: projects/{project}/locations/{location}/processors/{processor}. It takes the form projects/{project}/locations/{location}/processors/{processor}.
Request body
The request body contains data with the following structure:
JSON representation
{"processorVersion": {object (ProcessorVersion)},"documentSchema": {object (DocumentSchema)},"inputData": {object (InputData)},"baseProcessorVersion": string,// Union field processor_flags can be only one of the following:"customDocumentExtractionOptions": {object (CustomDocumentExtractionOptions)},"foundationModelTuningOptions": {object (FoundationModelTuningOptions)}// End of list of possible types for union field processor_flags.}
Optional. The processor version to use as a base for training. This processor version must be a child of parent. Format: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}.
Optional. The number of steps to run for model tuning. Valid values are between 1 and 400. If not provided, recommended steps will be used.
learningRateMultiplier
number
Optional. The multiplier to apply to the recommended learning rate. Valid values are between 0.1 and 10. If not provided, recommended learning rate will be used.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-10 UTC."],[[["\u003cp\u003eThis API endpoint \u003ccode\u003eprojects.locations.processors.processorVersions.train\u003c/code\u003e is used to train a new processor version within the Document AI platform.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003eparent\u003c/code\u003e parameter specifying the project, location, and processor to which the new version will belong, as well as a request body containing the new \u003ccode\u003eprocessorVersion\u003c/code\u003e, and optionally, \u003ccode\u003edocumentSchema\u003c/code\u003e, \u003ccode\u003einputData\u003c/code\u003e, \u003ccode\u003ebaseProcessorVersion\u003c/code\u003e, \u003ccode\u003ecustomDocumentExtractionOptions\u003c/code\u003e or \u003ccode\u003efoundationModelTuningOptions\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTraining a new processor version requires the \u003ccode\u003edocumentai.processorVersions.create\u003c/code\u003e IAM permission on the parent resource and the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"],["\u003cp\u003eTraining data, specified within the \u003ccode\u003einputData\u003c/code\u003e field, can include separate sets of documents for both training (\u003ccode\u003etrainingDocuments\u003c/code\u003e) and testing (\u003ccode\u003etestDocuments\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecustomDocumentExtractionOptions\u003c/code\u003e field allows control over Custom Document Extraction (CDE) training, and the \u003ccode\u003efoundationModelTuningOptions\u003c/code\u003e field allows control over foundation model tuning, allowing specification of \u003ccode\u003etrainSteps\u003c/code\u003e and \u003ccode\u003elearningRateMultiplier\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: processorVersions.train\n\n**Full name**: projects.locations.processors.processorVersions.train\n\nTrains a new processor version. Operation metadata is returned as `TrainProcessorVersionMetadata`.\n\n### HTTP request\n\n`POST https://{endpoint}/v1beta3/{parent}/processorVersions:train`\n\nWhere `{endpoint}` is one of the [supported service endpoints](/document-ai/docs/reference/rest#rest_endpoints).\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/document-ai/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:\n\n- `documentai.processorVersions.create`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs).\n\nCustomDocumentExtractionOptions\n-------------------------------\n\nOptions to control the training of the Custom Document Extraction (CDE) Processor.\n\nTrainingMethod\n--------------\n\nTraining Method for CDE. `TRAINING_METHOD_UNSPECIFIED` will fall back to `MODEL_BASED`.\n\nFoundationModelTuningOptions\n----------------------------\n\nOptions to control foundation model tuning of the processor.\n\nInputData\n---------\n\nThe input data used to train a new [ProcessorVersion](/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.processorVersions#ProcessorVersion)."]]