> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/document-ai/api-reference/doc-ai-extraction.md).

# Doc AI Extraction

{% if false %}
The Extraction endpoints turn a document into structured data. You choose how you want to wait for the answer: `/extract/sync` holds the connection open and returns the result in the response, `/extract` accepts the job and returns an ID you poll or receive a webhook for, and `/extract/bulk` does the same for many documents at once and groups them under a single identifier.

All three take the same rich parameter set — the document type, the model, the chart of accounts, the analysis toggles — so moving a working synchronous call to the asynchronous path is usually a change of URL and nothing else.

{% hint style="info" %}
Send the document one of two ways: `content` as base64, or `file_url` as a URL the platform can reach. Give one of them, not both. The same either/or applies to the document type: use `documentType` for a single type, or `documentTypes` for multi-extraction — again, one of them.
{% endhint %}

{% hint style="warning" %}
Neither constraint is expressed in the spec's `required` list — every property is formally optional, and the obligations live only in the property descriptions. A request that satisfies the schema can still be rejected.
{% endhint %}

For what the parameters mean in product terms — document types, models, chart of accounts, confidence — see [Document Extraction](/document-ai/guides-1/document-extraction.md).

### Get all extractions in a multi-extraction group, keyed by documentType.

`GET /document-extractions/group/{extraction_group_id}`

Requires the `X-Api-Key` header.

**Path and query parameters**

| Parameter             | In   | Type   | Required | Description |
| --------------------- | ---- | ------ | -------- | ----------- |
| `extraction_group_id` | path | string | Yes      |             |

**Responses**

| Status | Description                                                             | Schema                    |
| ------ | ----------------------------------------------------------------------- | ------------------------- |
| `200`  | OK                                                                      | `GroupExtractionResponse` |
| `400`  | Bad Request                                                             | `ValidationError`         |
| `401`  | Authentication required — the `X-Api-Key` header is missing or invalid. |                           |
| `404`  | No extraction group exists with that ID.                                |                           |

**Example**

```bash
curl -X GET "https://<api-host>/document-extractions/group/{extraction_group_id}" \
  -H "X-Api-Key: $DOCAI_API_KEY"
```

### Get extraction details

`GET /document-extractions/{extraction_id}`

Requires the `X-Api-Key` header.

**Path and query parameters**

| Parameter       | In   | Type   | Required | Description |
| --------------- | ---- | ------ | -------- | ----------- |
| `extraction_id` | path | string | Yes      |             |

**Responses**

| Status | Description                                                             | Schema                  |
| ------ | ----------------------------------------------------------------------- | ----------------------- |
| `200`  | OK                                                                      | `GetExtractionResponse` |
| `400`  | Bad Request                                                             | `ValidationError`       |
| `401`  | Authentication required — the `X-Api-Key` header is missing or invalid. |                         |
| `404`  | No extraction exists with that ID.                                      |                         |

**Example**

```bash
curl -X GET "https://<api-host>/document-extractions/{extraction_id}" \
  -H "X-Api-Key: $DOCAI_API_KEY"
```

### Extract document data (Async)

`POST /extract`

Requires the `X-Api-Key` header.

**Request body** — `application/json`, required: `ExtractRequest`

| Property                 | Type                       | Description                                                                                                                                                                              |
| ------------------------ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `additionalParams`       | `AdditionalParams`         | Additional extraction parameters for fine-grained control                                                                                                                                |
| `agentInstructions`      | string                     | Additional system-level instructions injected into the LLM system prompt                                                                                                                 |
| `analysisDepth`          | string                     | Depth of document analysis: 'quick' (skip classification if type provided) or 'standard' (full analysis). One of: `quick`, `standard`.                                                   |
| `chartOfAccounts`        | object \| array\<object>   | Chart of accounts mapping. Flat array for standard: \[{accountId, accountName}]. Structured dict for BusinessFinancialStatement: {BalanceSheet: \[...], ProfitAndLossStatement: \[...]}. |
| `chartOfAccountsUrl`     | string                     | URL to download chart of accounts JSON. Only used when chartOfAccounts is not provided directly.                                                                                         |
| `content`                | string                     | Base64-encoded file content                                                                                                                                                              |
| `custom_document_types`  | array\<string>             | Custom document type names to use for V2 classification instead of the built-in list                                                                                                     |
| `documentType`           | string                     | Document type. Mutually exclusive with documentTypes; one is required.                                                                                                                   |
| `documentTypes`          | array<`DocumentTypeEntry`> | Multi-extraction document types. Mutually exclusive with documentType; one is required.                                                                                                  |
| `enableCaching`          | boolean                    | If true, store extraction result in cache for future requests                                                                                                                            |
| `enableDocumentAnalysis` | boolean                    | Run AI document analysis to categorize content before extraction (V2 only)                                                                                                               |
| `enableJudge`            | boolean                    | Enable LLM-as-Judge evaluation: a second LLM reviews extraction quality post-hoc                                                                                                         |
| `enablePageContent`      | boolean                    | Include page-wise OCR content and AI-generated summaries per page                                                                                                                        |
| `enablePageSummaries`    | boolean                    | Deprecated — use enablePageContent instead                                                                                                                                               |
| `enableRawSections`      | boolean                    | Include raw OCR text sections with bounding boxes in the result (V2 only)                                                                                                                |
| `extractionFormat`       | object                     | Custom extraction JSON schema defining the output structure. Overrides the default DocumentConfig format.                                                                                |
| `extractionPrompt`       | string                     | Custom natural language prompt to guide LLM extraction behavior beyond the extractionFormat schema.                                                                                      |
| `file_url`               | string                     | Public URL to file                                                                                                                                                                       |
| `form8825Address`        | string                     | Single property address (backward-compatible alias for form8825Addresses with one entry)                                                                                                 |
| `form8825Addresses`      | array\<string>             | Property addresses for Form 8825 direct deep extraction. Skips property identification and runs a native-PDF extraction per address.                                                     |
| `formTypes`              | array\<string>             | Form types (for tax documents)                                                                                                                                                           |
| `galleryIds`             | array\<string>             | Knowledge Search gallery IDs to tag the document into after extraction                                                                                                                   |
| `includeLayout`          | boolean                    | Include document layout structure (tables, paragraphs, headings) in result                                                                                                               |
| `industry`               | string                     | Industry name to load default chart of accounts from database for supported document types                                                                                               |
| `metadata`               | object                     | Arbitrary key-value metadata to attach to the extraction record                                                                                                                          |
| `model`                  | string                     | LLM model for extraction. One of: `gpt-4.1`, `gpt-5.1`, `gemini-3`, `openrouter/z-ai/glm-5.2`, `openrouter/deepseek/deepseek-v4-pro`.                                                    |
| `overrideCache`          | boolean                    | If true, bypass cached extraction results and re-extract from scratch                                                                                                                    |
| `query`                  | string                     | Natural language question to answer after extraction completes. Enables async Q\&A on the result.                                                                                        |
| `quickExtract`           | boolean                    | Use Gemini native PDF extraction (bypasses Azure OCR). Faster but may have lower accuracy for complex layouts.                                                                           |
| `rawExtractionOnly`      | boolean                    | Skip LLM extraction entirely; return only OCR/layout data without structured extraction                                                                                                  |
| `subtype`                | string                     | Document subtype                                                                                                                                                                         |
| `tagInstructions`        | string                     | Tag classification instructions (only used when documentType is OtherWithMetadata)                                                                                                       |

**Nested objects**

`AdditionalParams`

| Property                 | Type    | Description                                                                                                                                                                                                                                                                                                                           |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `extractImages`          | boolean | When true, extract embedded images from well-formatted (digital) PDFs, store them in the storage bucket, and return signed URLs on result.extractedImages. Scanned/photo PDFs and non-PDF files are skipped with a message (imageExtraction.status). Signed URLs are valid for 7 days - consumers must fetch/copy within that window. |
| `imageInstructions`      | string  | Free-text instruction used to vision-tag and rank extracted images (e.g. 'property photos and map locations'). Requires extractImages=true. Matching images are ranked first (matchScore); images are never dropped.                                                                                                                  |
| `returnFieldConfidences` | boolean | When true, compute per-field confidence scores (inline + aggregate). Skips field confidence computation when false to reduce response size.                                                                                                                                                                                           |

`DocumentTypeEntry`

| Property       | Type            | Description                     |
| -------------- | --------------- | ------------------------------- |
| `documentType` | string          | Document type for extraction    |
| `entity`       | string          | Entity name for this extraction |
| `entityId`     | string          | Entity ID for this extraction   |
| `pageNumbers`  | array\<integer> | Target page numbers (PDF)       |
| `sheetNames`   | array\<string>  | Target sheet names (Excel)      |

**Responses**

| Status | Description                                                                                                                                                         | Schema            |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
| `200`  | OK                                                                                                                                                                  | `ExtractResponse` |
| `202`  | Accepted — returned instead of `200` when the request uses `documentTypes` for a multi-extraction. The success code varies with the request, not just the endpoint. |                   |
| `400`  | Bad Request                                                                                                                                                         | `ValidationError` |
| `401`  | Authentication required — the `X-Api-Key` header is missing or invalid.                                                                                             |                   |
| `500`  | Returned instead of `400` when the request body is missing or invalid. **Known defect.**                                                                            |                   |

**Example**

```bash
curl -X POST "https://<api-host>/extract" \
  -H "X-Api-Key: $DOCAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
         "documentType": "BankStatements",
         "file_url": "https://example.com/statement.pdf"
       }'
```

### Bulk document extraction (Async)

`POST /extract/bulk`

Requires the `X-Api-Key` header.

**Request body** — `application/json`, required: `ExtractBulkRequest`

| Property | Type                            | Description                                              |
| -------- | ------------------------------- | -------------------------------------------------------- |
| `files`  | array<`ExtractBulkRequestFile`> | List of files to extract, each with content or file\_url |

**Nested objects**

`ExtractBulkRequestFile`

| Property                 | Type                       | Description                                                                                                                                                                              |
| ------------------------ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `additionalParams`       | `AdditionalParams`         | Additional extraction parameters for fine-grained control                                                                                                                                |
| `agentInstructions`      | string                     | Additional system-level instructions injected into the LLM system prompt                                                                                                                 |
| `analysisDepth`          | string                     | Depth of document analysis: 'quick' (skip classification if type provided) or 'standard' (full analysis). One of: `quick`, `standard`.                                                   |
| `chartOfAccounts`        | object \| array\<object>   | Chart of accounts mapping. Flat array for standard: \[{accountId, accountName}]. Structured dict for BusinessFinancialStatement: {BalanceSheet: \[...], ProfitAndLossStatement: \[...]}. |
| `chartOfAccountsUrl`     | string                     | URL to download chart of accounts JSON. Only used when chartOfAccounts is not provided directly.                                                                                         |
| `content`                | string                     | Base64-encoded file content                                                                                                                                                              |
| `custom_document_types`  | array\<string>             | Custom document type names to use for V2 classification instead of the built-in list                                                                                                     |
| `documentType`           | string                     | Document type. Mutually exclusive with documentTypes; one is required.                                                                                                                   |
| `documentTypes`          | array<`DocumentTypeEntry`> | Multi-extraction document types. Mutually exclusive with documentType; one is required.                                                                                                  |
| `enableCaching`          | boolean                    | If true, store extraction result in cache for future requests                                                                                                                            |
| `enableDocumentAnalysis` | boolean                    | Run AI document analysis to categorize content before extraction (V2 only)                                                                                                               |
| `enableJudge`            | boolean                    | Enable LLM-as-Judge evaluation: a second LLM reviews extraction quality post-hoc                                                                                                         |
| `enablePageContent`      | boolean                    | Include page-wise OCR content and AI-generated summaries per page                                                                                                                        |
| `enablePageSummaries`    | boolean                    | Deprecated — use enablePageContent instead                                                                                                                                               |
| `enableRawSections`      | boolean                    | Include raw OCR text sections with bounding boxes in the result (V2 only)                                                                                                                |
| `extractionFormat`       | object                     | Custom extraction JSON schema defining the output structure. Overrides the default DocumentConfig format.                                                                                |
| `extractionPrompt`       | string                     | Custom natural language prompt to guide LLM extraction behavior beyond the extractionFormat schema.                                                                                      |
| `file_url`               | string                     | Public URL to file                                                                                                                                                                       |
| `form8825Address`        | string                     | Single property address (backward-compatible alias for form8825Addresses with one entry)                                                                                                 |
| `form8825Addresses`      | array\<string>             | Property addresses for Form 8825 direct deep extraction. Skips property identification and runs a native-PDF extraction per address.                                                     |
| `formTypes`              | array\<string>             | Form types (for tax documents)                                                                                                                                                           |
| `galleryIds`             | array\<string>             | Knowledge Search gallery IDs to tag the document into after extraction                                                                                                                   |
| `includeLayout`          | boolean                    | Include document layout structure (tables, paragraphs, headings) in result                                                                                                               |
| `industry`               | string                     | Industry name to load default chart of accounts from database for supported document types                                                                                               |
| `metadata`               | object                     | Arbitrary key-value metadata to attach to the extraction record                                                                                                                          |
| `model`                  | string                     | LLM model for extraction. One of: `gpt-4.1`, `gpt-5.1`, `gemini-3`, `openrouter/z-ai/glm-5.2`, `openrouter/deepseek/deepseek-v4-pro`.                                                    |
| `overrideCache`          | boolean                    | If true, bypass cached extraction results and re-extract from scratch                                                                                                                    |
| `query`                  | string                     | Natural language question to answer after extraction completes. Enables async Q\&A on the result.                                                                                        |
| `quickExtract`           | boolean                    | Use Gemini native PDF extraction (bypasses Azure OCR). Faster but may have lower accuracy for complex layouts.                                                                           |
| `rawExtractionOnly`      | boolean                    | Skip LLM extraction entirely; return only OCR/layout data without structured extraction                                                                                                  |
| `subtype`                | string                     | Document subtype                                                                                                                                                                         |
| `tagInstructions`        | string                     | Tag classification instructions (only used when documentType is OtherWithMetadata)                                                                                                       |

`AdditionalParams`

| Property                 | Type    | Description                                                                                                                                                                                                                                                                                                                           |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `extractImages`          | boolean | When true, extract embedded images from well-formatted (digital) PDFs, store them in the storage bucket, and return signed URLs on result.extractedImages. Scanned/photo PDFs and non-PDF files are skipped with a message (imageExtraction.status). Signed URLs are valid for 7 days - consumers must fetch/copy within that window. |
| `imageInstructions`      | string  | Free-text instruction used to vision-tag and rank extracted images (e.g. 'property photos and map locations'). Requires extractImages=true. Matching images are ranked first (matchScore); images are never dropped.                                                                                                                  |
| `returnFieldConfidences` | boolean | When true, compute per-field confidence scores (inline + aggregate). Skips field confidence computation when false to reduce response size.                                                                                                                                                                                           |

`DocumentTypeEntry`

| Property       | Type            | Description                     |
| -------------- | --------------- | ------------------------------- |
| `documentType` | string          | Document type for extraction    |
| `entity`       | string          | Entity name for this extraction |
| `entityId`     | string          | Entity ID for this extraction   |
| `pageNumbers`  | array\<integer> | Target page numbers (PDF)       |
| `sheetNames`   | array\<string>  | Target sheet names (Excel)      |

**Responses**

| Status | Description                                                             | Schema                |
| ------ | ----------------------------------------------------------------------- | --------------------- |
| `200`  | OK                                                                      | `ExtractBulkResponse` |
| `400`  | Bad Request                                                             | `ValidationError`     |
| `401`  | Authentication required — the `X-Api-Key` header is missing or invalid. |                       |

**Example**

```bash
curl -X POST "https://<api-host>/extract/bulk" \
  -H "X-Api-Key: $DOCAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
         "files": [
           {
             "documentType": "BalanceSheet",
             "file_url": "https://example.com/bs.pdf"
           },
           {
             "documentType": "ProfitAndLossStatement",
             "file_url": "https://example.com/pl.pdf"
           }
         ]
       }'
```

### Synchronous document extraction

`POST /extract/sync`

Requires the `X-Api-Key` header.

**Request body** — `application/json`, required: `ExtractSyncRequest`

| Property                 | Type                       | Description                                                                                                                                                                              |
| ------------------------ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `additionalParams`       | `AdditionalParams`         | Additional extraction parameters for fine-grained control                                                                                                                                |
| `agentInstructions`      | string                     | Additional system-level instructions injected into the LLM system prompt                                                                                                                 |
| `analysisDepth`          | string                     | Depth of document analysis: 'quick' (skip classification if type provided) or 'standard' (full analysis). One of: `quick`, `standard`.                                                   |
| `chartOfAccounts`        | object \| array\<object>   | Chart of accounts mapping. Flat array for standard: \[{accountId, accountName}]. Structured dict for BusinessFinancialStatement: {BalanceSheet: \[...], ProfitAndLossStatement: \[...]}. |
| `chartOfAccountsUrl`     | string                     | URL to download chart of accounts JSON. Only used when chartOfAccounts is not provided directly.                                                                                         |
| `content`                | string                     | Base64-encoded file content                                                                                                                                                              |
| `custom_document_types`  | array\<string>             | Custom document type names to use for V2 classification instead of the built-in list                                                                                                     |
| `documentType`           | string                     | Document type. Mutually exclusive with documentTypes; one is required.                                                                                                                   |
| `documentTypes`          | array<`DocumentTypeEntry`> | Multi-extraction document types. Mutually exclusive with documentType; one is required.                                                                                                  |
| `enableCaching`          | boolean                    | If true, store extraction result in cache for future requests                                                                                                                            |
| `enableDocumentAnalysis` | boolean                    | Run AI document analysis to categorize content before extraction (V2 only)                                                                                                               |
| `enableJudge`            | boolean                    | Enable LLM-as-Judge evaluation: a second LLM reviews extraction quality post-hoc                                                                                                         |
| `enablePageContent`      | boolean                    | Include page-wise OCR content and AI-generated summaries per page                                                                                                                        |
| `enablePageSummaries`    | boolean                    | Deprecated — use enablePageContent instead                                                                                                                                               |
| `enableRawSections`      | boolean                    | Include raw OCR text sections with bounding boxes in the result (V2 only)                                                                                                                |
| `extractionFormat`       | object                     | Custom extraction JSON schema defining the output structure. Overrides the default DocumentConfig format.                                                                                |
| `extractionId`           | string                     | Existing extraction document ID for incremental instruction mode. When provided, runs instruction extraction on the stored document instead of standard extraction.                      |
| `extractionPrompt`       | string                     | Custom natural language prompt to guide LLM extraction behavior beyond the extractionFormat schema.                                                                                      |
| `file_url`               | string                     | Public URL to file                                                                                                                                                                       |
| `form8825Address`        | string                     | Single property address (backward-compatible alias for form8825Addresses with one entry)                                                                                                 |
| `form8825Addresses`      | array\<string>             | Property addresses for Form 8825 direct deep extraction. Skips property identification and runs a native-PDF extraction per address.                                                     |
| `formTypes`              | array\<string>             | Form types (for tax documents)                                                                                                                                                           |
| `galleryIds`             | array\<string>             | Knowledge Search gallery IDs to tag the document into after extraction                                                                                                                   |
| `includeLayout`          | boolean                    | Include document layout structure (tables, paragraphs, headings) in result                                                                                                               |
| `industry`               | string                     | Industry name to load default chart of accounts from database for supported document types                                                                                               |
| `mapToSchema`            | boolean                    | If true, instruction extraction results are mapped to the document type's JSON schema                                                                                                    |
| `mergeMode`              | string                     | How to merge instruction extraction results with existing data: append, overwrite, or replace. One of: `append`, `overwrite`, `replace`.                                                 |
| `metadata`               | object                     | Arbitrary key-value metadata to attach to the extraction record                                                                                                                          |
| `model`                  | string                     | LLM model for extraction. One of: `gpt-4.1`, `gpt-5.1`, `gemini-3`, `openrouter/z-ai/glm-5.2`, `openrouter/deepseek/deepseek-v4-pro`.                                                    |
| `overrideCache`          | boolean                    | If true, bypass cached extraction results and re-extract from scratch                                                                                                                    |
| `query`                  | string                     | Natural language query on the extraction result                                                                                                                                          |
| `quickExtract`           | boolean                    | Use Gemini native PDF extraction (bypasses Azure OCR). Faster but may have lower accuracy for complex layouts.                                                                           |
| `rawExtractionOnly`      | boolean                    | Skip LLM extraction entirely; return only OCR/layout data without structured extraction                                                                                                  |
| `subtype`                | string                     | Document subtype                                                                                                                                                                         |
| `tagInstructions`        | string                     | Tag classification instructions (only used when documentType is OtherWithMetadata)                                                                                                       |
| `targetFields`           | array\<string>             | Target field names for instruction extraction mode. Limits extraction to these fields.                                                                                                   |

**Nested objects**

`AdditionalParams`

| Property                 | Type    | Description                                                                                                                                                                                                                                                                                                                           |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `extractImages`          | boolean | When true, extract embedded images from well-formatted (digital) PDFs, store them in the storage bucket, and return signed URLs on result.extractedImages. Scanned/photo PDFs and non-PDF files are skipped with a message (imageExtraction.status). Signed URLs are valid for 7 days - consumers must fetch/copy within that window. |
| `imageInstructions`      | string  | Free-text instruction used to vision-tag and rank extracted images (e.g. 'property photos and map locations'). Requires extractImages=true. Matching images are ranked first (matchScore); images are never dropped.                                                                                                                  |
| `returnFieldConfidences` | boolean | When true, compute per-field confidence scores (inline + aggregate). Skips field confidence computation when false to reduce response size.                                                                                                                                                                                           |

`DocumentTypeEntry`

| Property       | Type            | Description                     |
| -------------- | --------------- | ------------------------------- |
| `documentType` | string          | Document type for extraction    |
| `entity`       | string          | Entity name for this extraction |
| `entityId`     | string          | Entity ID for this extraction   |
| `pageNumbers`  | array\<integer> | Target page numbers (PDF)       |
| `sheetNames`   | array\<string>  | Target sheet names (Excel)      |

**Responses**

| Status | Description                                                                              | Schema                |
| ------ | ---------------------------------------------------------------------------------------- | --------------------- |
| `200`  | OK                                                                                       | `ExtractSyncResponse` |
| `400`  | Bad Request                                                                              | `ValidationError`     |
| `401`  | Authentication required — the `X-Api-Key` header is missing or invalid.                  |                       |
| `500`  | Returned instead of `400` when the request body is missing or invalid. **Known defect.** |                       |

**Example**

```bash
curl -X POST "https://<api-host>/extract/sync" \
  -H "X-Api-Key: $DOCAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
         "documentType": "BalanceSheet",
         "file_url": "https://example.com/balance-sheet.pdf",
         "model": "gemini-3"
       }'
```

### Related pages

* [Document Extraction](/document-ai/guides-1/document-extraction.md) — the same capability through the UI, including result review and corrections.
* [Document Types](/document-ai/guides-1/document-types.md) — the registry of values accepted by `documentType`.
* [Quickstart: extract a document](broken://pages/FtkBf037MMS2GEj287Gi) — a working call, end to end.
  {% endif %}

Choose how to wait for extraction results:

* Use asynchronous extraction for long-running work and webhooks.
* Use bulk extraction for several documents in one request.
* Use synchronous extraction when the caller can wait for a response.

### Shared request rules

Send one document source: `content` as base64, or `file_url` as a reachable URL.

Send one document type selector: `documentType` for one type, or `documentTypes` for multi-extraction.

All extraction endpoints require `X-Api-Key`.

{% hint style="warning" %}
Properties can be optional in the schema while still required by a request rule.
{% endhint %}

See [Document Extraction](/document-ai/guides-1/document-extraction.md) for document types, models, chart-of-accounts mapping, and confidence.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.uptiq.ai/document-ai/api-reference/doc-ai-extraction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
