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

# Document

> Document data type in the ABBYY FlexiCapture Web Services API: holds document details like ID, batch, pages, processing stage, status flags, and errors.

## What it does

The **Document** data type stores information about a document.

## Fields

<table width="100%"><tbody><tr><td><p><strong>Name</strong></p></td><td><p><strong>Type</strong></p></td><td><p><strong>Description</strong></p></td></tr><tr><td><p>Id</p></td><td><p>int</p></td><td><p>The ID of a document.</p><p>The only way to set an ID for a document is to use the <a href="/flexi-capture/api/methods/get-batch-ids-range">GetBatchIdsRange</a> method, which allows reserving IDs for new documents. We recommend that you set an ID for a document before you add the document to a batch.</p><p>A document ID will be generated automatically if you set its value to -1.</p></td></tr><tr><td><p>BatchId</p></td><td><p>int</p></td><td><p>The ID of the batch</p></td></tr><tr><td><p>ParentId</p></td><td><p>int</p></td><td><p>The ID of the parent document of the set.</p><p>If a new document should be part of a set, this field should be assigned the value of the parent document of the set.</p><p>If a new document should not be part of any set, set the value of the field to 0.</p><p><strong>Important! </strong> The parent document must be created before child documents are created.</p></td></tr><tr><td><p>ChildrenOrder</p></td><td><p><a href="/flexi-capture/api/structures/children-order">ChildrenOrder</a> \[]</p></td><td><p>A set of child documents enabling the sorting of documents in the set.</p><p>When data are read from the server, the field is filled out automatically.</p><p>If this field is empty, the documents in the set will be arranged in the order in which they were added.</p></td></tr><tr><td><p>DocIndex</p></td><td><p>int</p></td><td><p>Document index</p></td></tr><tr><td><p>TemplateName</p></td><td><p>string</p></td><td><p>The name of the Document Definition</p></td></tr><tr><td><p>ProcessingStageType</p></td><td><p>int</p></td><td><p>The type of the processing stage; values come from <a href="/flexi-capture/api/structures/t-processing-stage-type">ProcessingStageType</a></p></td></tr><tr><td><p>Comment</p></td><td><p>string</p></td><td><p>Comment</p></td></tr><tr><td><p>Pages</p></td><td><p><a href="/flexi-capture/api/structures/page">Page</a>\[]</p></td><td><p>The set of pages in the document</p></td></tr><tr><td><p>IsProcessed</p></td><td><p>bool</p></td><td><p>A flag that shows whether the document has been processed or not</p></td></tr><tr><td><p>HasProcessingErrors</p></td><td><p>bool</p></td><td><p>A flag that shows whether there were processing errors</p></td></tr><tr><td><p>HasDocumentErrors</p></td><td><p>bool</p></td><td><p>A flag that shows whether there are errors in the document (e.g. format errors, rules errors, assembly errors)</p></td></tr><tr><td><p>ErrorText</p></td><td><p>string</p></td><td><p>A description of the document processing errors</p></td></tr><tr><td><p>ExternalId</p></td><td><p>string</p></td><td><p>The external ID of the document</p></td></tr><tr><td><p>Properties</p></td><td><p><a href="/flexi-capture/api/structures/registration-property">RegistrationProperty</a>\[]</p></td><td><p>The set of registration parameters for the document</p></td></tr><tr><td><p>Priority</p></td><td><p><a href="/flexi-capture/api/structures/t-priority">Priority</a>\[]</p></td><td><p>Document priority</p></td></tr><tr><td><p>FileVersion</p></td><td><p>int</p></td><td><p>The version of the document file on the server</p></td></tr><tr><td><p>OwnerId</p></td><td><p>int</p></td><td><p>The ID of the user or group who owns the project</p></td></tr><tr><td><p>StageExternalId</p></td><td><p>int</p></td><td><p>The ID of the processing stage in which the task was created (unique within the batch type)</p></td></tr><tr><td><p>TaskId</p></td><td><p>int</p></td><td><p>The ID of the task the document belongs to</p></td></tr><tr><td><p>UncertainSymbols</p></td><td><p>int</p></td><td><p>The number of uncertain characters</p></td></tr><tr><td><p>VerificationSymbols</p></td><td><p>int</p></td><td><p>The number of verified characters</p></td></tr><tr><td><p>TotalSymbols</p></td><td><p>int</p></td><td><p>The total number of characters in the document</p></td></tr><tr><td><p>HasErrors</p></td><td><p>bool</p></td><td><p>A flag that shows whether there are any validation rule errors</p></td></tr><tr><td><p>HasWarnings</p></td><td><p>bool</p></td><td><p>A flag that shows whether there are any validation rule warnings</p></td></tr><tr><td><p>HasAssemblingErrors</p></td><td><p>bool</p></td><td><p>A flag that shows whether there were assembling errors</p></td></tr><tr><td><p>HasAttachments</p></td><td><p>bool</p></td><td><p>A flag that shows whether the document has attachments</p></td></tr><tr><td><p>Flags</p></td><td><p>int</p></td><td><p>A set of flags that describe the status of the document. The value of a field is a combination of the values of the flags, which include:</p><ul><li>BIF\_IsAnalyzed = 0x100 shows that the document is analysed;</li><li>BIF\_IsRecognized = 0x200 shows that the document is recognized;</li><li>BIF\_IsVerified = 0x400 shows that the document is verified;</li><li>BIF\_IsExported = 0x800 shows that the document is exported;</li><li>BIF\_HasRuleErrors = 0x10000 shows that the document contains rule execution errors;</li><li>BIF\_HasRuleWarnings = 0x20000 - shows that the document contains rule execution warnings;</li><li>BIF\_HasMergeVersionErrors = 0x80000 - shows that the document contains errors of merging double verification results (verification results do not match);</li><li>BIF\_HasUserAttachments = 0x100000 - shows that the document has attachments;</li><li>BIF\_HasUnmatchedFieldErrors = 0x200000 - shows that the document contains unmatched fields;</li><li>BIF\_NeedsPreprocessing = 0x800000 - shows that the document needs preprocessing;</li><li>BIF\_IsManuallyCreated = 0x1000000 - shows that the document was created manually;</li><li>BIF\_IsExcludedFromAutomaticAssembling = 0x2000000 - shows that the document is excluded from automatic assembly;</li><li>BIF\_IsSourceImageAttached = 0x4000000 - shows that a source image file is attached to the document.</li></ul><p><strong>Note: </strong> Only those flags are listed which are useful when working with the tasks and <a href="/flexi-capture/api/methods/methods">methods of the Web Services API</a>.</p></td></tr></tbody></table>
