> 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/extract-asynchronously.md).

# Extract asynchronously

`POST /extract`

Use this endpoint when extraction can continue after the request ends. The response returns an extraction identifier. Retrieve its result later or receive a webhook.

### Request

Send `content` or `file_url`. Use `documentType` for one extraction. Use `documentTypes` for multi-extraction.

Common options include `model`, `extractionFormat`, `extractionPrompt`, `metadata`, and `includeLayout`.

### Shared request parameters

| Property                 | Type                       | Description                                                      |
| ------------------------ | -------------------------- | ---------------------------------------------------------------- |
| `additionalParams`       | `AdditionalParams`         | Fine-grained extraction options.                                 |
| `agentInstructions`      | string                     | System-level LLM instructions.                                   |
| `analysisDepth`          | string                     | `quick` or `standard` analysis.                                  |
| `chartOfAccounts`        | object or array            | Chart-of-accounts mapping.                                       |
| `chartOfAccountsUrl`     | string                     | URL for chart-of-accounts JSON.                                  |
| `content`                | string                     | Base64-encoded file content.                                     |
| `custom_document_types`  | array                      | Custom V2 classification types.                                  |
| `documentType`           | string                     | One document type. Excludes `documentTypes`.                     |
| `documentTypes`          | array<`DocumentTypeEntry`> | Multiple document types. Excludes `documentType`.                |
| `enableCaching`          | boolean                    | Cache the extraction result.                                     |
| `enableDocumentAnalysis` | boolean                    | Run V2 document analysis.                                        |
| `enableJudge`            | boolean                    | Run post-extraction LLM evaluation.                              |
| `enablePageContent`      | boolean                    | Return OCR content and summaries by page.                        |
| `enablePageSummaries`    | boolean                    | Deprecated. Use `enablePageContent`.                             |
| `enableRawSections`      | boolean                    | Return OCR sections and bounding boxes.                          |
| `extractionFormat`       | object                     | Custom output JSON schema.                                       |
| `extractionPrompt`       | string                     | Custom extraction instruction.                                   |
| `file_url`               | string                     | Reachable document URL.                                          |
| `form8825Address`        | string                     | One Form 8825 property address.                                  |
| `form8825Addresses`      | array                      | Form 8825 property addresses.                                    |
| `formTypes`              | array                      | Tax document form types.                                         |
| `galleryIds`             | array                      | Knowledge Search galleries to tag.                               |
| `includeLayout`          | boolean                    | Return document layout structure.                                |
| `industry`               | string                     | Industry for the default chart of accounts.                      |
| `metadata`               | object                     | Extraction record metadata.                                      |
| `model`                  | string                     | `gpt-4.1`, `gpt-5.1`, `gemini-3`, or supported OpenRouter model. |
| `overrideCache`          | boolean                    | Bypass a cached result.                                          |
| `query`                  | string                     | Question to answer after extraction.                             |
| `quickExtract`           | boolean                    | Use Gemini native PDF extraction.                                |
| `rawExtractionOnly`      | boolean                    | Return OCR and layout only.                                      |
| `subtype`                | string                     | Document subtype.                                                |
| `tagInstructions`        | string                     | Tag instructions for `OtherWithMetadata`.                        |

### Nested objects

#### `AdditionalParams`

| Property                 | Type    | Description                                    |
| ------------------------ | ------- | ---------------------------------------------- |
| `extractImages`          | boolean | Extract images from well-formatted PDFs.       |
| `imageInstructions`      | string  | Vision-tag and rank extracted images.          |
| `returnFieldConfidences` | boolean | Return confidence scores for extracted fields. |

#### `DocumentTypeEntry`

| Property       | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| `documentType` | string | Document type for extraction. |
| `entity`       | string | Entity name.                  |
| `entityId`     | string | Entity identifier.            |
| `pageNumbers`  | array  | PDF pages to extract.         |
| `sheetNames`   | array  | Excel sheets to extract.      |

### Responses

| Status | Description                                      | Schema            |
| ------ | ------------------------------------------------ | ----------------- |
| `200`  | Extraction accepted for one document type.       | `ExtractResponse` |
| `202`  | Extraction accepted for multiple document types. | `ExtractResponse` |
| `400`  | Invalid request.                                 | `ValidationError` |
| `401`  | API key is missing or invalid.                   |                   |
| `500`  | Missing or invalid request body. Known defect.   |                   |

```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"
      }'
```

Use [Retrieve extraction results](/document-ai/api-reference/doc-ai-extraction/retrieve-extraction-results.md) to fetch the completed extraction.


---

# 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/extract-asynchronously.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.
