# Parse documents into structured content

Launch stage: GA

`POST /api/2.0/ai-functions/ai-parse-document`

Parse structured content from unstructured documents.

API scopes: ai-functions

## Request body

- `content` (string, required)
  The document to parse, given as a Unity Catalog volume path to the source file (the REST API accepts only a UC volume path, not inline binary data). Supported formats: PDF, DOCX, DOC, PPTX, PPT, JPG, JPEG, PNG, TIFF. Accepts up to 100 pages and 100 MB per document.
- `options` (object, optional)
  Function options. Omitted fields fall back to their documented defaults.
  - `version` (string, optional)
    The ai_parse_document output schema version. Supported value: "2.0".
  - `description_element_types` (string, optional)
    Element types for which an AI-generated description is produced. Use "*" (default) to generate descriptions for all supported element types, "figure" to generate them for figures only, or "" (empty string) to generate none. Only figure descriptions are supported for version "2.0", so "*" and "figure" produce the same behavior.
  - `image_output_path` (string, optional)
    Unity Catalog volume path where rendered page and element images are written.
  - `page_range` (string, optional)
    Pages to parse (1-indexed), as a comma-separated list of page numbers or ranges (e.g. "1,3,5-10").

## Returns

- `document` (object, optional)
  The parsed document as a JSON value, containing the extracted pages and elements.
- `error_status` (array of object, optional)
  Per-page partial-failure details; present when the request succeeds (2xx) but individual pages fail.
  - `error_message` (string, optional)
    Message describing why the page failed.
  - `page_id` (int64, optional)
    0-based index of the page that failed.
- `metadata` (object, optional)
  Additional metadata returned by AI Parse Document.
  - `id` (string, optional)
    Unique identifier for the parse request.
  - `version` (string, optional)
    The resolved function version.
  - `file_metadata` (object, optional)
    Describes the source file; present only for file-path input.
    - `file_path` (string, optional)
      Unity Catalog volume path of the source file.
    - `file_name` (string, optional)
      Base name of the source file.
    - `file_size` (int64, optional)
      Size of the source file in bytes.
    - `file_modification_time` (string, optional)
      Last-modified timestamp of the source file, as an HTTP date string.

## Response

```json
{
  "document": {},
  "error_status": [
    {
      "error_message": "string",
      "page_id": 0
    }
  ],
  "metadata": {
    "id": "string",
    "version": "string",
    "file_metadata": {}
  }
}
```

