## Resource: Processor

The first-class citizen for Document AI. Each processor defines how to extract structural information from a document.

| JSON representation |
|---|
| ``` { "name": string, "type": string, "displayName": string, "state": enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors#State`), "defaultProcessorVersion": string, "processorVersionAliases": [ { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors#ProcessorVersionAlias`) } ], "processEndpoint": string, "createTime": string, "kmsKeyName": string, "satisfiesPzs": boolean, "satisfiesPzi": boolean, "activeSchemaVersion": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Immutable. The resource name of the processor. Format: `projects/{project}/locations/{location}/processors/{processor}` |
| `type` | `string` The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. To get a list of processor types, see `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations/fetchProcessorTypes#google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes`. |
| `displayName` | `string` The display name of the processor. |
| `state` | ``enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors#State`)`` Output only. The state of the processor. |
| `defaultProcessorVersion` | `string` The default processor version. |
| `processorVersionAliases[]` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors#ProcessorVersionAlias`)`` Output only. The processor version aliases. |
| `processEndpoint` | `string` Output only. Immutable. The http endpoint that can be called to invoke processing. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time the processor was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `kmsKeyName` | `string` The [KMS key](https://cloud.google.com/security-key-management) used for encryption and decryption in CMEK scenarios. |
| `satisfiesPzs` | `boolean` Output only. Reserved for future use. |
| `satisfiesPzi` | `boolean` Output only. Reserved for future use. |
| `activeSchemaVersion` | `string` Optional. SchemaVersion used by the Processor. It is the same as Processor's `DatasetSchema.schema_version` Format is \`projects/{project}/locations/{location}/schemas/{schema}/schemaVersions/{schemaVersion}. |

## State

The possible states of the processor.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | The processor is in an unspecified state. |
| `ENABLED` | The processor is enabled, i.e., has an enabled version which can currently serve processing requests and all the feature dependencies have been successfully initialized. |
| `DISABLED` | The processor is disabled. |
| `ENABLING` | The processor is being enabled, will become `ENABLED` if successful. |
| `DISABLING` | The processor is being disabled, will become `DISABLED` if successful. |
| `CREATING` | The processor is being created, will become either `ENABLED` (for successful creation) or `FAILED` (for failed ones). Once a processor is in this state, it can then be used for document processing, but the feature dependencies of the processor might not be fully created yet. |
| `FAILED` | The processor failed during creation or initialization of feature dependencies. The user should delete the processor and recreate one as all the functionalities of the processor are disabled. |
| `DELETING` | The processor is being deleted, will be removed if successful. |

## ProcessorVersionAlias

Contains the alias and the aliased resource name of processor version.

| JSON representation |
|---|
| ``` { "alias": string, "processorVersion": string } ``` |

| Fields ||
|---|---|
| `alias` | `string` The alias in the form of `processorVersion` resource name. |
| `processorVersion` | `string` The resource name of aliased processor version. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/batchProcess` | LRO endpoint to batch process many documents. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/create` | Creates a processor from the `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processorTypes#ProcessorType` provided. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/delete` | Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/disable` | Disables a processor |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/enable` | Enables a processor |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/get` | Gets a processor detail. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/list` | Lists all processors which belong to this project. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/process` | Processes a single document. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/setDefaultProcessorVersion` | Set the default (active) version of a `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors#Processor` that will be used in `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/process#google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument` and `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors/batchProcess#google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments`. |