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

# Get job extraction results

> Retrieve full extraction results for a completed job.

Returns classification and extraction data with field-level metadata including
confidence scores, page numbers, and location hints.

Args:
    job_id: UUID of the extraction job to retrieve results for.
    session_and_auth: Database session and auth context (injected).

Returns:
    JobResultResponse: Classification and extraction results with metadata.

Raises:
    HTTPException 404: Job not found or not accessible by tenant.
    HTTPException 400: Job not completed (status must be 'completed').

Notes:
    - Confidence scores are self-reported by LLM and directionally useful
      but not calibrated (90% confidence != 90% accuracy)
    - Field metadata includes page numbers and location hints for provenance
    - For unknown document types, extraction may be null



## OpenAPI

````yaml openapi.json get /v1/jobs/{job_id}/results
openapi: 3.1.0
info:
  title: DocIntell API
  description: >-

    # DocIntell API


    **Turn Documents into Data. Keep the Source Safe.**


    Financial document intelligence platform that turns PDFs into queryable data
    while keeping source files secure and compliant.


    ## Features


    - **Document Ingestion**: Upload PDFs with SEC 17a-4 compliant immutable
    storage

    - **Schema Projection**: Query extracted data with custom schemas (not data
    dumps!)

    - **Multi-Schema Support**: Same document, multiple query patterns

    - **Webhook Delivery**: Async notifications on job completion

    - **Row-Level Security**: Multi-tenant isolation built-in


    ## Authentication


    All API endpoints (except `/health`, `/`, `/docs`, and `/redoc`) require API
    key authentication.


    Include your API key in the `Authorization` header:


    ```

    Authorization: Bearer dk_live_<your_key>

    ```


    Test keys start with `dk_test_`, production keys with `dk_live_`.


    ## Rate Limiting


    Per-tenant rate limits:

    - **Document ingestion**: 100 documents/hour

    - **Projection queries**: 1,000 requests/hour

    - **Schema operations**: 10 creates/hour


    Rate limit info is returned in response headers:

    - `X-RateLimit-Limit`: Maximum requests allowed

    - `X-RateLimit-Remaining`: Remaining requests in window

    - `X-RateLimit-Reset`: Unix timestamp when limit resets


    ## Error Handling


    All errors follow RFC 7807 Problem Details format:


    ```json

    {
      "error": "error_code",
      "message": "Human-readable description",
      "details": {}
    }

    ```


    Common error codes:

    - `unauthorized` (401): Missing or invalid API key

    - `rate_limit_exceeded` (429): Too many requests

    - `invalid_file_type` (400): Only PDFs supported

    - `file_too_large` (413): File exceeds size limit (default 100MB,
    configurable via MAX_UPLOAD_SIZE_MB)

    - `job_not_found` (404): Job ID doesn't exist or doesn't belong to tenant


    ## Getting Started


    1. Obtain API key from dashboard

    2. Upload PDF: `POST /v1/documents`

    3. Poll status: `GET /v1/documents/{document_id}/status`

    4. Query results: `POST /v1/documents/{document_id}/project`


    Full documentation: [https://docs.docintel.com](https://docs.docintel.com)
        
  contact:
    name: DocIntell Support
    url: https://docintel.com/support
    email: support@docintel.com
  license:
    name: Proprietary
    url: https://docintel.com/terms
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Local development
  - url: https://api.docintell.com
    description: Production API
  - url: https://api-staging.docintell.com
    description: Staging environment
security:
  - bearerAuth: []
tags:
  - name: health
    description: Health check operations. Verify service and dependency connectivity.
    x-mint-tag-group: System
  - name: api_keys
    description: API key management operations. Create, list, and revoke API keys.
    x-mint-tag-group: Management
  - name: documents
    description: Document ingestion operations. Upload PDFs for extraction.
    x-mint-tag-group: Core
  - name: jobs
    description: >-
      Job status and query operations. Check extraction status and query
      results.
    x-mint-tag-group: Core
  - name: document-types
    description: >-
      Document type schemas. List and retrieve extraction schema definitions for
      financial document types.
  - name: webhooks
    description: >-
      Webhook configuration management. Create, update, and manage webhook
      endpoints for job completion notifications.
    x-mint-tag-group: Integrations
  - name: stats
    description: Analytics and metrics endpoints. Get document, job, and schema statistics.
  - name: views
    description: >-
      View management for consumption layer. Define field subsets for querying
      extraction data.
paths:
  /v1/jobs/{job_id}/results:
    get:
      tags:
        - jobs
      summary: Get job extraction results
      description: >-
        Retrieve full extraction results for a completed job.


        Returns classification and extraction data with field-level metadata
        including

        confidence scores, page numbers, and location hints.


        Args:
            job_id: UUID of the extraction job to retrieve results for.
            session_and_auth: Database session and auth context (injected).

        Returns:
            JobResultResponse: Classification and extraction results with metadata.

        Raises:
            HTTPException 404: Job not found or not accessible by tenant.
            HTTPException 400: Job not completed (status must be 'completed').

        Notes:
            - Confidence scores are self-reported by LLM and directionally useful
              but not calibrated (90% confidence != 90% accuracy)
            - Field metadata includes page numbers and location hints for provenance
            - For unknown document types, extraction may be null
      operationId: get_job_results_v1_jobs__job_id__results_get
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: UUID of the extraction job
            title: Job Id
          description: UUID of the extraction job
      responses:
        '200':
          description: Full extraction results with classification and field metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResultResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    JobResultResponse:
      properties:
        job_id:
          type: string
          format: uuid
          title: Job Id
          description: Extraction job identifier
        document_id:
          type: string
          format: uuid
          title: Document Id
          description: Source document identifier
        status:
          type: string
          const: completed
          title: Status
          description: Job status
        classification:
          anyOf:
            - $ref: '#/components/schemas/ClassificationResponse'
            - type: 'null'
          description: Classification result with reasoning
        extraction:
          anyOf:
            - $ref: '#/components/schemas/ExtractionResultResponse'
            - type: 'null'
          description: Extraction result with field metadata
      type: object
      required:
        - job_id
        - document_id
        - status
      title: JobResultResponse
      description: Full job result with classification and extraction data.
      examples:
        - classification:
            citation: INVOICE
            citation_page: 1
            confidence: 0.95
            document_type: invoice
            reasoning: Document is a vendor invoice with itemized charges.
          document_id: 6789def0-abcd-4567-ef01-23456789abcd
          extraction:
            data:
              invoice_number: INV-2024-0892
            document_type: invoice
            field_metadata: {}
            page_count: 2
            validation:
              is_valid: true
          job_id: 550e8400-e29b-41d4-a716-446655440000
          status: completed
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ClassificationResponse:
      properties:
        document_type:
          type: string
          title: Document Type
          description: Classified document type code
        confidence:
          type: number
          maximum: 1
          minimum: 0
          title: Confidence
          description: Classification confidence (0-1)
        reasoning:
          type: string
          title: Reasoning
          description: 1-2 sentence explanation of classification
        citation:
          anyOf:
            - type: string
            - type: 'null'
          title: Citation
          description: Direct quote from document supporting classification
        citation_page:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Citation Page
          description: Page number where citation was found (1-indexed)
      type: object
      required:
        - document_type
        - confidence
        - reasoning
      title: ClassificationResponse
      description: Classification result with reasoning and evidence.
      examples:
        - citation: CAPITAL CALL NOTICE - Fund IV, L.P.
          citation_page: 1
          confidence: 0.95
          document_type: capital_call
          reasoning: Document is a capital call notice from a private equity fund.
    ExtractionResultResponse:
      properties:
        document_type:
          type: string
          title: Document Type
          description: Extracted document type
        page_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page Count
          description: Number of pages in document
        extraction_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Extraction Model
          description: LLM model used
        processing_time_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Processing Time Ms
          description: Processing time in milliseconds
        data:
          additionalProperties: true
          type: object
          title: Data
          description: Extracted fields as key-value pairs
        field_metadata:
          additionalProperties:
            $ref: '#/components/schemas/FieldMetadataResponse'
          type: object
          title: Field Metadata
          description: Per-field metadata
        validation:
          additionalProperties: true
          type: object
          title: Validation
          description: Validation results
      type: object
      required:
        - document_type
        - data
      title: ExtractionResultResponse
      description: Extraction result with data and field metadata.
      examples:
        - data:
            invoice_date: '2024-12-01'
            invoice_number: INV-2024-0892
            total_amount: 1234.56
          document_type: invoice
          extraction_model: google-vertex:gemini-2.5-flash
          field_metadata:
            invoice_number:
              confidence: 0.98
              location_hint: top right header
              page_number: 1
              raw_text: INV-2024-0892
          page_count: 2
          processing_time_ms: 3500
          validation:
            hard_violations: []
            is_valid: true
            soft_violations: []
    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
    FieldMetadataResponse:
      properties:
        confidence:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Confidence
          description: Self-reported confidence (0-1, directionally useful)
        page_number:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Page Number
          description: Page where found (1-indexed)
        location_hint:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Hint
          description: Qualitative location description
        raw_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Raw Text
          description: Original text as it appeared
        extraction_notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Extraction Notes
          description: Extraction issues or notes
      type: object
      title: FieldMetadataResponse
      description: Metadata for an extracted field.
      examples:
        - confidence: 0.95
          location_hint: top right header
          page_number: 1
          raw_text: INV-2024-0892
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API Key authentication. Format: dk_test_<key> or dk_live_<key>'

````