> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meibel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get structured parse result

> Download the fully structured parse result (the json format): pages, typed elements, tables, chart data, chart OCR text, and bounding boxes. The response schema (StructuredDocument) is defined by the parsing engine and hoisted into this spec by the OpenAPI generator.



## OpenAPI

````yaml /api-v2.json get /documents/{job_id}/structured
openapi: 3.1.0
info:
  title: Meibel AI API
  summary: Meibel Gateway Service
  description: >-
    Our API allows you to interact with our services. Read the
    [docs](https://docs.meibel.ai) to learn how to use it.
  version: 0.6.4
servers:
  - url: https://api.meibel.ai/v2
    description: Meibel API (v2)
  - url: https://api.dev.meibel.ai/v2
    description: Meibel Dev API (v2)
  - url: http://localhost:8000/v2
    description: Local Development
security: []
tags:
  - name: Datasources
    description: v2 datasource management
  - name: Data Elements
    description: v2 data element CRUD and search
  - name: File Upload
    description: Upload files to a datasource and track upload progress
  - name: Ingest
    description: Trigger and monitor datasource ingestion
  - name: Datasource Downloads
    description: Export all datasource content as a zip archive
  - name: Table Descriptions
    description: v2 table and column descriptions
  - name: Metadata Model Catalog
    description: v2 metadata model catalog
  - name: Confidence Scoring
    description: v2 confidence scoring jobs and summaries
  - name: Documents
    description: Parse and transform documents into structured data
  - name: Agents
    description: Agent definition management
  - name: Sessions
    description: Agent session (execution) management and chat
  - name: Execution Policies
    description: Data access and tool usage constraints scoped to agent sessions
  - name: Artifact Schemas
    description: Agent artifact schema management
paths:
  /documents/{job_id}/structured:
    get:
      tags:
        - Documents
      summary: Get structured parse result
      description: >-
        Download the fully structured parse result (the json format): pages,
        typed elements, tables, chart data, chart OCR text, and bounding boxes.
        The response schema (StructuredDocument) is defined by the parsing
        engine and hoisted into this spec by the OpenAPI generator.
      operationId: getStructuredDocumentResult
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParseStructuredDocument'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          label: Python
          source: |-
            from meibel import MeibelClient

            client = MeibelClient(api_key="your-api-key")

            result = client.documents.get_structured_result("job_id_value")
            print(result)
        - lang: TypeScript
          label: TypeScript
          source: >-
            import { MeibelClient } from 'meibel';


            const client = new MeibelClient({ apiKey: 'your-api-key' });


            const result = await
            client.documents.getStructuredResult('job_id_value');

            console.log(result);
        - lang: Go
          label: Go
          source: >-
            import v2 "github.com/meibel-ai/meibel-go/v2"


            client := v2.NewClient(v2.WithAPIKey("your-api-key"))

            ctx := context.Background()


            result, err := client.Documents.GetStructuredResult(ctx,
            "job_id_value")

            if err != nil {
                log.Fatal(err)
            }

            fmt.Println(result)
components:
  schemas:
    ParseStructuredDocument:
      title: StructuredDocument
      description: 'The final output of the pipeline: a fully structured document.'
      type: object
      required:
        - confidence
        - num_pages
        - pages
      properties:
        confidence:
          description: Aggregate confidence scores across all pages.
          allOf:
            - $ref: '#/components/schemas/ParseConfidenceScores'
        format:
          description: >-
            Detected input format (e.g. "pdf", "docx", "markdown"). `None` for
            documents processed before this field was added.
          type:
            - string
            - 'null'
        gpu_ms:
          description: >-
            Total GPU inference time in milliseconds across all stages (layout
            detection + table encoder + table decoder + OCR). Zero for non-PDF
            formats that don't use the ML pipeline.
          default: 0
          type: integer
          format: uint64
          minimum: 0
        num_pages:
          description: Number of pages in the source document.
          type: integer
          format: uint
          minimum: 0
        ocr_pages:
          description: Number of pages that required OCR (had no extractable text).
          default: 0
          type: integer
          format: uint32
          minimum: 0
        orientation_pages:
          description: >-
            Number of pages where orientation detection applied a non-zero
            rotation.
          default: 0
          type: integer
          format: uint32
          minimum: 0
        pages:
          description: Per-page structured content.
          type: array
          items:
            $ref: '#/components/schemas/ParseStructuredPage'
        remote_regions:
          description: >-
            Number of regions dispatched to remote endpoints (charts, formulas,
            seals).
          default: 0
          type: integer
          format: uint32
          minimum: 0
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ParseConfidenceScores:
      description: Aggregate confidence scores for the document.
      type: object
      required:
        - mean_layout_confidence
        - min_layout_confidence
        - num_elements
        - num_tables
      properties:
        mean_layout_confidence:
          description: Mean layout detection confidence across all elements.
          type: number
          format: double
        min_layout_confidence:
          description: Minimum layout detection confidence across all elements.
          type: number
          format: double
        num_elements:
          description: Total number of layout elements detected.
          type: integer
          format: uint
          minimum: 0
        num_tables:
          description: Number of tables recognized.
          type: integer
          format: uint
          minimum: 0
    ParseStructuredPage:
      description: Structured content for a single page.
      type: object
      required:
        - elements
        - page_bbox
        - page_number
      properties:
        elements:
          description: Document elements in reading order.
          type: array
          items:
            $ref: '#/components/schemas/ParseDocumentElement'
        extracted_page_no:
          description: >-
            The page number printed on the mini-page itself ("Page 62"): read
            off the page by the grid detector when legible, inferred from the
            confirmed reading order when obscured.
          type:
            - integer
            - 'null'
          format: uint32
          minimum: 0
        image_size:
          description: Image dimensions in pixels (if a page image was provided).
          type:
            - array
            - 'null'
          items:
            - type: integer
              format: uint32
              minimum: 0
            - type: integer
              format: uint32
              minimum: 0
          maxItems: 2
          minItems: 2
        ocr_applied:
          description: Whether OCR was applied to this page.
          default: false
          type: boolean
        ocr_dpi:
          description: >-
            Adaptive OCR rendering DPI used for this page (150-600, computed
            from page size). Only present when OCR was applied.
          type:
            - integer
            - 'null'
          format: uint32
          minimum: 0
        ocr_reason:
          description: >-
            OCR detection signal breakdown (e.g. "enc=0.85(majority_bad),
            font=0.15(rich_fonts), ...").
          type:
            - string
            - 'null'
        ocr_score:
          description: >-
            OCR detection composite score (0.0 = definitely has text, 1.0 =
            definitely needs OCR). Present even when OCR was not applied.
          type:
            - number
            - 'null'
          format: double
        orientation_degrees:
          description: >-
            Orientation correction applied to this page in degrees (0, 90, 180,
            270). 0 means no correction was needed or orientation detection was
            disabled.
          default: 0
          type: integer
          format: uint16
          minimum: 0
        page_bbox:
          description: Page dimensions in PDF points (bottom-left origin).
          allOf:
            - $ref: '#/components/schemas/ParseBBox'
        page_number:
          description: Page number (0-indexed).
          type: integer
          format: uint
          minimum: 0
        physical_page:
          description: 0-based index of the physical PDF page this output page came from.
          type:
            - integer
            - 'null'
          format: uint
          minimum: 0
        quadrant:
          description: >-
            Which grid cell of the physical page this output page is, numbered
            in reading order.
          type:
            - integer
            - 'null'
          format: uint8
          minimum: 0
        sheet_rect:
          description: >-
            Rectangle this output page occupies on the physical page, in the
            physical page's coordinate space. The viewer uses this to reassemble
            split pages onto the source PDF.
          anyOf:
            - $ref: '#/components/schemas/ParseBBox'
            - type: 'null'
        transcript_lines:
          description: >-
            Present when the page was detected as a line-numbered legal
            transcript. The gutter numbers are stripped from body text and kept
            here so page:line citations remain resolvable.
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ParseTranscriptLine'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ParseDocumentElement:
      description: >-
        A single document element (text block, table, figure, etc.) in reading
        order.
      type: object
      required:
        - bbox
        - confidence
        - label
        - reading_order
        - text
      properties:
        bbox:
          description: >-
            Bounding box in pixel coordinates (top-left origin). Normalized to
            [0,1] for annotated export.
          allOf:
            - $ref: '#/components/schemas/ParseBBox'
        chart_data:
          description: If this is a Chart element, the digitized plot data.
          anyOf:
            - $ref: '#/components/schemas/ParseChartData'
            - type: 'null'
        confidence:
          description: Confidence score from the layout model.
          type: number
          format: double
        heading_level:
          description: >-
            Heading level (1-6) for Title/SectionHeader elements. Determined by
            font-size clustering: largest font → H1, decreasing → H2-H6. `None`
            for non-heading elements.
          type:
            - integer
            - 'null'
          format: uint8
          minimum: 0
        label:
          description: Layout label from the detection model.
          allOf:
            - $ref: '#/components/schemas/ParseLayoutLabel'
        ocr_text:
          description: >-
            Recognized text on a Chart region, with positions and provenance.
            Sibling to `chart_data` so it survives when chart_data is None.
          type: array
          items:
            $ref: '#/components/schemas/ParseChartText'
        reading_order:
          description: Position in reading order (0-indexed within page).
          type: integer
          format: uint
          minimum: 0
        table:
          description: If this is a Table element, the recognized table structure.
          anyOf:
            - $ref: '#/components/schemas/ParseTable'
            - type: 'null'
        text:
          description: Text content (assembled from cells within this region).
          type: string
    ParseBBox:
      description: Axis-aligned bounding box.
      type: object
      required:
        - x0
        - x1
        - y0
        - y1
      properties:
        x0:
          type: number
          format: double
        x1:
          type: number
          format: double
        y0:
          type: number
          format: double
        y1:
          type: number
          format: double
    ParseTranscriptLine:
      description: A transcript gutter line number stripped from the text flow.
      type: object
      required:
        - bbox
        - number
      properties:
        bbox:
          description: Bounding box of the number in pixel coordinates (top-left origin).
          allOf:
            - $ref: '#/components/schemas/ParseBBox'
        number:
          description: The printed line number (1-25/26).
          type: integer
          format: uint32
          minimum: 0
    ParseChartData:
      type: object
      required:
        - categories
        - chart_type
        - modality
        - overall_confidence
        - plot_area
        - series
        - warnings
        - x_axis
      properties:
        categories:
          items:
            type: string
          type: array
        chart_type:
          $ref: '#/components/schemas/ParseChartType'
        modality:
          $ref: '#/components/schemas/ParseModality'
        overall_confidence:
          type: number
          format: double
        plot_area:
          $ref: '#/components/schemas/ParseDualBBox'
        series:
          type: array
          items:
            $ref: '#/components/schemas/ParseSeries'
        title:
          type:
            - string
            - 'null'
        warnings:
          items:
            type: string
          type: array
        x_axis:
          $ref: '#/components/schemas/ParseAxisCalibration'
        y_axis_left:
          anyOf:
            - $ref: '#/components/schemas/ParseAxisCalibration'
            - type: 'null'
        y_axis_right:
          anyOf:
            - $ref: '#/components/schemas/ParseAxisCalibration'
            - type: 'null'
    ParseLayoutLabel:
      description: >-
        Layout element types for document layout detection.


        PP-DocLayoutV3 produces 25 classes (indices 0-24) which are mapped to
        these labels. Legacy heron labels (Checkbox*, Form, KeyValueRegion,
        ListItem) are retained for backward compatibility but no longer emitted
        by the model.
      oneOf:
        - description: Caption for a figure or table.
          type: string
          enum:
            - Caption
        - description: Chart or plot.
          type: string
          enum:
            - Chart
        - description: Footnote text.
          type: string
          enum:
            - Footnote
        - description: Mathematical formula (display or inline).
          type: string
          enum:
            - Formula
        - description: Bullet or numbered list item (legacy, not in V3).
          type: string
          enum:
            - ListItem
        - description: Footer/running foot at bottom of page.
          type: string
          enum:
            - PageFooter
        - description: Header/running head at top of page.
          type: string
          enum:
            - PageHeader
        - description: Figure, diagram, or image.
          type: string
          enum:
            - Picture
        - description: Seal or stamp.
          type: string
          enum:
            - Seal
        - description: Section heading.
          type: string
          enum:
            - SectionHeader
        - description: Table — triggers table structure recognition.
          type: string
          enum:
            - Table
        - description: Running body text.
          type: string
          enum:
            - Text
        - description: Document or section title.
          type: string
          enum:
            - Title
        - description: Table of contents / document index.
          type: string
          enum:
            - DocumentIndex
        - description: Code block or monospaced listing.
          type: string
          enum:
            - Code
        - description: Selected checkbox (legacy, not in V3).
          type: string
          enum:
            - CheckboxSelected
        - description: Unselected checkbox (legacy, not in V3).
          type: string
          enum:
            - CheckboxUnselected
        - description: Form region (legacy, not in V3).
          type: string
          enum:
            - Form
        - description: Key-value region (legacy, not in V3).
          type: string
          enum:
            - KeyValueRegion
    ParseChartText:
      description: >-
        One recognized text run on a chart, with dual-space position and
        provenance.
      type: object
      required:
        - bbox
        - confidence
        - source
        - text
      properties:
        bbox:
          $ref: '#/components/schemas/ParseDualBBox'
        confidence:
          type: number
          format: double
        source:
          $ref: '#/components/schemas/ParseChartTextSource'
        text:
          type: string
    ParseTable:
      description: >-
        A recognized table structure on a page. Produced by the table structure
        recognition model (TableFormer via ONNX).
      type: object
      required:
        - bbox
        - cells
        - num_cols
        - num_rows
        - page_number
      properties:
        bbox:
          description: Bounding box of the entire table.
          allOf:
            - $ref: '#/components/schemas/ParseBBox'
        cells:
          description: >-
            Table cells (not to be confused with TextCell — these are table grid
            cells).
          type: array
          items:
            $ref: '#/components/schemas/ParseTableCell'
        num_cols:
          description: Number of columns.
          type: integer
          format: uint
          minimum: 0
        num_rows:
          description: Number of rows.
          type: integer
          format: uint
          minimum: 0
        page_number:
          description: Page number this table belongs to (0-indexed).
          type: integer
          format: uint
          minimum: 0
    ParseChartType:
      type: string
      enum:
        - Line
        - Scatter
        - Bar
        - Area
        - Pie
        - Mixed
        - Unknown
    ParseModality:
      type: string
      enum:
        - Vector
        - Raster
    ParseDualBBox:
      description: >-
        A bbox in both coordinate spaces. `pixel` = rendered-image space
        (top-left origin); `pdf` = page points (bottom-left origin, BOTTOMLEFT).
      type: object
      required:
        - pdf
        - pixel
      properties:
        pdf:
          $ref: '#/components/schemas/ParseBBox'
        pixel:
          $ref: '#/components/schemas/ParseBBox'
    ParseSeries:
      type: object
      required:
        - points
        - style
        - y_axis
      properties:
        color:
          type:
            - array
            - 'null'
          items:
            type: integer
            format: uint8
            minimum: 0
          maxItems: 3
          minItems: 3
        dash_pattern:
          description: >-
            PDF dash array identifying the series alongside color.
            `Some(vec![])` = solid. Distinguishes monochrome series (Apple 10-K
            case). `None` = unknown (raster).
          type:
            - array
            - 'null'
          items:
            type: number
            format: double
        name:
          type:
            - string
            - 'null'
        points:
          type: array
          items:
            $ref: '#/components/schemas/ParseDataPoint'
        style:
          $ref: '#/components/schemas/ParseSeriesStyle'
        y_axis:
          $ref: '#/components/schemas/ParseYAxisRef'
    ParseAxisCalibration:
      type: object
      required:
        - data_range
        - pixel_to_data
        - scale
        - ticks
      properties:
        data_range:
          type: array
          items:
            - type: number
              format: double
            - type: number
              format: double
          maxItems: 2
          minItems: 2
        pixel_to_data:
          $ref: '#/components/schemas/ParseAffineFit'
        scale:
          $ref: '#/components/schemas/ParseAxisScale'
        ticks:
          type: array
          items:
            $ref: '#/components/schemas/ParseTickMark'
        title:
          type:
            - string
            - 'null'
        unit:
          type:
            - string
            - 'null'
    ParseChartTextSource:
      description: Where a `ChartText` came from.
      oneOf:
        - description: >-
            Sliced from the parser's PDF text cells (vector charts). PDF cells
            carry no confidence, so a synthesized 1.0 is used.
          type: string
          enum:
            - PdfText
        - description: >-
            Produced by the det+rec OCR engine on the chart crop (raster
            charts).
          type: string
          enum:
            - Ocr
    ParseTableCell:
      description: A single cell in a recognized table.
      type: object
      required:
        - bbox
        - col
        - col_span
        - is_header
        - row
        - row_span
        - text
      properties:
        bbox:
          description: Bounding box of this table cell.
          allOf:
            - $ref: '#/components/schemas/ParseBBox'
        col:
          description: Column index (0-indexed).
          type: integer
          format: uint
          minimum: 0
        col_span:
          description: Number of columns this cell spans (1 = no spanning).
          type: integer
          format: uint
          minimum: 0
        is_header:
          description: Whether this is a header cell.
          type: boolean
        row:
          description: Row index (0-indexed).
          type: integer
          format: uint
          minimum: 0
        row_span:
          description: Number of rows this cell spans (1 = no spanning).
          type: integer
          format: uint
          minimum: 0
        text:
          description: >-
            Text content of this cell (assembled from text cells within the
            bbox).
          type: string
    ParseDataPoint:
      description: >-
        One digitized data value. `x` is in data units after inversion; when
        `x_is_category` it is the float index into `ChartData::categories`; for
        a DateTime axis it is a unix timestamp (seconds).
      type: object
      required:
        - bbox
        - confidence
        - source
        - x
        - x_is_category
        - 'y'
      properties:
        bbox:
          $ref: '#/components/schemas/ParseDualBBox'
        confidence:
          type: number
          format: double
        source:
          $ref: '#/components/schemas/ParseValueSource'
        x:
          type: number
          format: double
        x_is_category:
          type: boolean
        'y':
          type: number
          format: double
    ParseSeriesStyle:
      type: string
      enum:
        - Line
        - Scatter
        - Bar
        - Area
        - PieSlice
    ParseYAxisRef:
      description: >-
        Which Y axis a series reads against. `Ambiguous` is the fallback defined
        canonically in the spec §7f (dual-Y detected ∧ color match inconclusive
        ∧ no VLM) — emitted with a warning rather than a wrong guess.
      type: string
      enum:
        - Left
        - Right
        - Ambiguous
    ParseAffineFit:
      description: >-
        Linear fit `value = slope * pixel_pos + intercept` (on log10(value) for
        Log10, on unix-timestamp for DateTime). `r_squared` retained to warn on
        weak fits.
      type: object
      required:
        - intercept
        - r_squared
        - slope
      properties:
        intercept:
          type: number
          format: double
        r_squared:
          type: number
          format: double
        slope:
          type: number
          format: double
    ParseAxisScale:
      type: string
      enum:
        - Linear
        - Log10
        - Categorical
        - DateTime
    ParseTickMark:
      type: object
      required:
        - label_bbox
        - pixel_pos
        - source
        - value
      properties:
        label_bbox:
          $ref: '#/components/schemas/ParseDualBBox'
        pixel_pos:
          type: number
          format: double
        source:
          $ref: '#/components/schemas/ParseValueSource'
        value:
          type: number
          format: double
    ParseValueSource:
      description: Provenance for a digitized value — drives confidence and auditability.
      type: string
      enum:
        - VectorPath
        - RasterMask
        - RasterMarker
        - VlmAdjudicated
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Meibel-API-Key

````