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

# Parse Result

> Get the results of a parse job.

Parse job results are retained for up to 30 days after job creation. Fetching results for a parse job that is older than 30 days will return a 404 error.



## OpenAPI

````yaml api-reference/openapi.json get /parse/jobs/{job_id}/results
openapi: 3.1.0
info:
  title: Endpoints
  version: '1.0'
servers:
  - url: https://api.contextual.ai/v1
security:
  - BearerAuth: []
paths:
  /parse/jobs/{job_id}/results:
    get:
      tags:
        - /parse
      summary: Parse Result
      description: >-
        Get the results of a parse job.


        Parse job results are retained for up to 30 days after job creation.
        Fetching results for a parse job that is older than 30 days will return
        a 404 error.
      operationId: parse_results_parse_jobs__job_id__results_get
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Unique ID of the parse job
            title: Job Id
          description: Unique ID of the parse job
        - name: output_types
          in: query
          required: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ParseOutputFormat'
            description: >-
              The desired output format(s) of the parsed file. Must be
              `markdown-document`, `markdown-per-page`, and/or
              `blocks-per-page`. Specify multiple values to get multiple formats
              in the response. `markdown-document` parses the whole document
              into a single concatenated markdown output. `markdown-per-page`
              provides markdown output per page. `blocks-per-page` provides a
              structured JSON representation of the content blocks on each page,
              sorted by reading order.
                          
            default:
              - markdown-per-page
            title: Output Types
          description: >-
            The desired output format(s) of the parsed file. Must be
            `markdown-document`, `markdown-per-page`, and/or `blocks-per-page`.
            Specify multiple values to get multiple formats in the response.
            `markdown-document` parses the whole document into a single
            concatenated markdown output. `markdown-per-page` provides markdown
            output per page. `blocks-per-page` provides a structured JSON
            representation of the content blocks on each page, sorted by reading
            order.
                        
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParseResultsResponseV1'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ParseOutputFormat:
      type: string
      enum:
        - markdown-document
        - markdown-per-page
        - blocks-per-page
      title: ParseOutputFormat
      description: The format of the output to be returned by the /parse endpoint.
    ParseResultsResponseV1:
      properties:
        file_name:
          type: string
          title: File Name
          description: The name of the file that was uploaded for parsing
        status:
          $ref: '#/components/schemas/DocumentStatusEnum'
          title: Job Status
          description: The current status of the parse job
          examples:
            - completed
        pages:
          items:
            $ref: '#/components/schemas/ParsedPage'
          type: array
          title: Parsed Pages
          description: >-
            Per-page parse results, containing per-page Markdown (if
            `markdown-per-page` was requested) and/or per-page `ParsedBlock`s
            (if `blocks-per-page` was requested).
        markdown_document:
          type: string
          title: Parsed Markdown File
          description: >-
            The parsed, structured Markdown of the input file. Only present if
            `markdown-document` was among the requested output types.
        document_metadata:
          $ref: '#/components/schemas/DocumentMetadata'
          title: Document Metadata
          description: Document-level metadata parsed from the document
      type: object
      required:
        - file_name
        - status
      title: ParseResultsResponseV1
      description: /parse results reponse object.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentStatusEnum:
      type: string
      enum:
        - pending
        - processing
        - retrying
        - completed
        - failed
        - cancelled
      title: DocumentStatusEnum
    ParsedPage:
      properties:
        index:
          type: integer
          title: Page Index
          description: The index of the parsed page (zero-indexed)
          examples:
            - 0
        markdown:
          type: string
          title: Markdown
          description: >-
            The parsed, structured Markdown of this page. Present if
            `markdown-per-page` was among the requested output types.
        blocks:
          items:
            $ref: '#/components/schemas/ParsedBlock'
          type: array
          title: Blocks
          description: >-
            The parsed, structured blocks of this page. Present if
            `blocks-per-page` was among the requested output types.
      type: object
      required:
        - index
      title: ParsedPage
      description: Per-page parse results.
    DocumentMetadata:
      properties:
        hierarchy:
          $ref: '#/components/schemas/DocumentHierarchy'
          title: Hierarchy
          description: >-
            Hierarchy of the document, as both heading blocks and a markdown
            table of contents
      type: object
      title: DocumentMetadata
      description: Metadata about the document that was parsed.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ParsedBlock:
      properties:
        id:
          type: string
          format: uuid
          title: Block ID
          description: Unique ID of the block
        type:
          $ref: '#/components/schemas/ParsedBlockType'
          title: Block Type
          description: The type of the block
        bounding_box:
          $ref: '#/components/schemas/BlockBoundingBox'
          title: Bounding Box
          description: >-
            The normalized bounding box of the block, as relative percentages of
            the page width and height
        markdown:
          type: string
          title: Block Markdown
          description: The Markdown representation of the block
        confidence_level:
          $ref: '#/components/schemas/ParsedBlockConfidenceLevel'
          title: Table Confidence Level
          description: >-
            The confidence level of this block categorized as 'low', 'medium',
            or 'high'. Only available for blocks of type 'table' currently.
          examples:
            - high
        page_index:
          type: integer
          title: Page Index
          description: >-
            The page (0-indexed) that this block belongs to. Only set for
            heading blocks that are returned in the table of contents.
        parent_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Parent Block IDs
          description: >-
            The IDs of the parent in the document hierarchy, sorted from
            root-level to bottom. For root-level heading blocks, this will be an
            empty list. Only present if `enable_document_hierarchy` was set to
            true in the request.
        hierarchy_level:
          type: integer
          title: Block Hierarchy Level
          description: >-
            The level of the block in the document hierarchy, starting at 0 for
            the root-level title block. Only present if
            `enable_document_hierarchy` was set to true in the request.
      type: object
      required:
        - id
        - type
        - bounding_box
        - markdown
      title: ParsedBlock
      description: One logical block of content from a parsed page.
    DocumentHierarchy:
      properties:
        blocks:
          items:
            $ref: '#/components/schemas/ParsedBlock'
          type: array
          title: Heading Blocks
          description: Heading blocks which define the hierarchy of the document
        table_of_contents:
          type: string
          title: Markdown Table of Contents
          description: Markdown representation of the table of contents for this document
      additionalProperties: false
      type: object
      title: DocumentHierarchy
      description: Document hierarchy within the parsed document
    ParsedBlockType:
      type: string
      enum:
        - heading
        - text
        - table
        - figure
      title: ParsedBlockType
      description: The type of a parsed block.
    BlockBoundingBox:
      properties:
        x0:
          type: number
          maximum: 1
          minimum: 0
          title: X0
          description: The x-coordinate of the top-left corner of the bounding box
        y0:
          type: number
          maximum: 1
          minimum: 0
          title: Y0
          description: The y-coordinate of the top-left corner of the bounding box
        x1:
          type: number
          maximum: 1
          minimum: 0
          title: X1
          description: The x-coordinate of the bottom-right corner of the bounding box
        y1:
          type: number
          maximum: 1
          minimum: 0
          title: Y1
          description: The y-coordinate of the bottom-right corner of the bounding box
      type: object
      required:
        - x0
        - y0
        - x1
        - y1
      title: BlockBoundingBox
      description: >-
        Normalized bounding box of a block, as relative percentages of the page
        width and height.
    ParsedBlockConfidenceLevel:
      type: string
      enum:
        - low
        - medium
        - high
      title: ParsedBlockConfidenceLevel
      description: The confidence level of a parsed block.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````