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

# Create Lab Report Parser Job

> Create or submit lab report parser job via the Junction API. Requires authentication with your team API key.

Upload a lab report file (PDF, JPEG, or PNG) to create a parsing job. The job will extract lab results and match them to LOINC codes.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
       --url '{{BASE_URL}}/lab_report/v1/parser/job' \
       --header 'accept: application/json' \
       --header 'x-vital-api-key: YOUR_API_KEY' \
       --header 'Content-Type: multipart/form-data' \
       --form 'file=@/path/to/lab_report.pdf' \
       --form 'user_id=<user_id>' \
       --form 'needs_human_review=false'
  ```

  ```python Python theme={null}
  from junction import Junction
  from junction.environment import JunctionEnvironment

  client = Junction(
      api_key="YOUR_API_KEY",
      environment=JunctionEnvironment.SANDBOX,
  )

  with open("lab_report.pdf", "rb") as f:
      data = client.lab_report.parser_create_job(
          file=[f],
          user_id="<user_id>",
          needs_human_review=False,
      )
  ```

  ```typescript TypeScript theme={null}
  import { JunctionClient, JunctionEnvironment } from "@junction-api/sdk";
  import * as fs from "fs";

  const client = new JunctionClient({
      apiKey: "YOUR_API_KEY",
      environment: JunctionEnvironment.Sandbox,
  });

  const data = await client.labReport.parserCreateJob({
      file: [fs.createReadStream("lab_report.pdf")],
      userId: "<user_id>",
      needsHumanReview: false,
  });
  ```

  ```java Java theme={null}
  import com.junction.api.Junction;
  import com.junction.api.core.Environment;
  import com.junction.api.resources.labreport.requests.CreateLabReportParserJobBody;
  import java.io.File;

  Junction client = Junction.builder()
      .apiKey("YOUR_API_KEY")
      .environment(Environment.SANDBOX)
      .build();

  var data = client.labReport().parserCreateJob(
      new File("lab_report.pdf"),
      CreateLabReportParserJobBody.builder()
          .userId("<user_id>")
          .needsHumanReview(false)
          .build()
  );
  ```

  ```go Go theme={null}
  import (
      "context"
      "os"

      junction "github.com/junction-api/junction-go"
      "github.com/junction-api/junction-go/client"
      "github.com/junction-api/junction-go/option"
  )

  c := client.NewClient(
      option.WithApiKey("YOUR_API_KEY"),
      option.WithBaseURL(junction.Environments.Sandbox),
  )

  file, _ := os.Open("lab_report.pdf")
  defer file.Close()

  response, err := c.LabReport.ParserCreateJob(context.TODO(), &junction.CreateLabReportParserJobBody{
      File:             []io.Reader{file},
      UserId:           "<user_id>",
      NeedsHumanReview: junction.Bool(false),
  })
  if err != nil {
      return err
  }
  fmt.Printf("Job ID: %s\n", response.JobId)
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "job_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "started",
    "data": null,
    "needs_human_review": false,
    "is_reviewed": false
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /lab_report/v1/parser/job
openapi: 3.1.0
info:
  title: Junction API
  description: https://docs.junction.com/
  version: 0.4.483
servers:
  - url: https://api.us.junction.com
    x-fern-server-name: Production
  - url: https://api.eu.junction.com
    x-fern-server-name: ProductionEU
  - url: https://api.sandbox.us.junction.com
    x-fern-server-name: Sandbox
  - url: https://api.sandbox.eu.junction.com
    x-fern-server-name: SandboxEU
security:
  - apiKeyAuth: []
paths:
  /lab_report/v1/parser/job:
    post:
      tags:
        - lab_report
      summary: Create Lab Report Parser Job
      description: >-
        Creates a parse job, uploads the file(s) to provider, persists the job
        row,

        and starts the ParseLabReport. Returns a generated job_id.
      operationId: CreateLabReportParserJob
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateLabReportParserJobBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParsingJob'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateLabReportParserJobBody:
      properties:
        file:
          items:
            type: string
            format: binary
          type: array
          title: File
        user_id:
          type: string
          format: uuid
          title: User Id
        needs_human_review:
          type: boolean
          title: Needs Human Review
          default: false
      type: object
      required:
        - file
        - user_id
      title: CreateLabReportParserJobBody
    ParsingJob:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        status:
          $ref: '#/components/schemas/ParsingJobStatus'
          description: ℹ️ This enum is non-exhaustive.
        failure_reason:
          anyOf:
            - $ref: '#/components/schemas/ParsingJobFailureReason'
            - type: 'null'
          description: ℹ️ This enum is non-exhaustive.
        data:
          anyOf:
            - $ref: '#/components/schemas/ParsedLabReportData'
            - type: 'null'
        needs_human_review:
          type: boolean
          title: Needs Human Review
        is_reviewed:
          type: boolean
          title: Is Reviewed
      type: object
      required:
        - id
        - status
        - needs_human_review
        - is_reviewed
      title: ParsingJob
      example:
        data:
          metadata:
            date_collected: '2024-12-30'
            date_reported: '2025-01-01'
            dob: '1990-01-01'
            lab_name: Acme Labs
            patient_first_name: Jane
            patient_last_name: Doe
            specimen_number: ABC123
          results:
            - interpretation: normal
              is_above_max_range: false
              is_below_min_range: false
              loinc_matches:
                - aliases: []
                  confidence_score: 0.99
                  display_name: Glucose
                  loinc_code: 2345-7
                  loinc_name: Glucose [Mass/volume] in Serum or Plasma
              max_reference_range: 99
              measurement_kind: direct
              min_reference_range: 70
              sample_type: serum_plasma_blood
              source_panel_name: CMP
              test_name: Glucose
              type: numeric
              units: mg/dL
              value: '90'
        id: 8eb0217f-4683-4a3c-adca-faf95ac65739
        is_reviewed: false
        needs_human_review: false
        status: completed
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    ParsingJobStatus:
      type: string
      enum:
        - upload_pending
        - started
        - completed
        - failed
      title: ParsingJobStatus
      description: ℹ️ This enum is non-exhaustive.
    ParsingJobFailureReason:
      type: string
      enum:
        - invalid_input
        - low_quality
        - not_english
      title: ParsingJobFailureReason
      description: >-
        Machine-readable failure reasons for parsing jobs. ℹ️ This enum is
        non-exhaustive.
    ParsedLabReportData:
      properties:
        metadata:
          $ref: '#/components/schemas/ResultMetadata'
        results:
          items:
            $ref: '#/components/schemas/LabReportResult'
          type: array
          title: Results
      type: object
      required:
        - metadata
        - results
      title: ParsedLabReportData
    ResultMetadata:
      properties:
        patient_first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient First Name
        patient_last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Last Name
        dob:
          anyOf:
            - type: string
            - type: 'null'
          title: Dob
        gender:
          type: string
          enum:
            - male
            - female
            - other
          title: Gender
          default: other
          description: ℹ️ This enum is non-exhaustive.
        lab_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Lab Name
        date_reported:
          anyOf:
            - type: string
            - type: 'null'
          title: Date Reported
        date_collected:
          anyOf:
            - type: string
            - type: 'null'
          title: Date Collected
        specimen_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Specimen Number
      type: object
      title: ResultMetadata
    LabReportResult:
      properties:
        test_name:
          type: string
          title: Test Name
        value:
          type: string
          title: Value
        sample_type:
          type: string
          enum:
            - urine
            - serum_plasma_blood
            - capillary_blood
            - stool
            - saliva
            - other
            - unknown
          title: Sample Type
          default: unknown
          description: ℹ️ This enum is non-exhaustive.
        measurement_kind:
          type: string
          enum:
            - direct
            - calculated
            - ratio
            - unknown
          title: Measurement Kind
          default: unknown
          description: ℹ️ This enum is non-exhaustive.
        type:
          anyOf:
            - $ref: '#/components/schemas/LabReportResultType'
            - type: 'null'
          description: ℹ️ This enum is non-exhaustive.
        units:
          anyOf:
            - type: string
            - type: 'null'
          title: Units
        max_reference_range:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Reference Range
        min_reference_range:
          anyOf:
            - type: number
            - type: 'null'
          title: Min Reference Range
        source_panel_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Panel Name
        loinc_matches:
          anyOf:
            - items:
                $ref: '#/components/schemas/LoincMatch'
              type: array
            - type: 'null'
          title: Loinc Matches
        loinc_match_status:
          anyOf:
            - type: string
              enum:
                - auto_match
                - needs_review
                - no_match
            - type: 'null'
          title: Loinc Match Status
          description: ℹ️ This enum is non-exhaustive.
        interpretation:
          anyOf:
            - $ref: '#/components/schemas/Interpretation'
            - type: 'null'
          description: ℹ️ This enum is non-exhaustive.
        is_above_max_range:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Above Max Range
        is_below_min_range:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Below Min Range
      type: object
      required:
        - test_name
        - value
      title: LabReportResult
    LabReportResultType:
      type: string
      enum:
        - numeric
        - range
        - comment
        - boolean
        - duration
        - percentage
        - ratio
      title: LabReportResultType
      description: ℹ️ This enum is non-exhaustive.
    LoincMatch:
      properties:
        loinc_code:
          type: string
          title: Loinc Code
        loinc_name:
          type: string
          title: Loinc Name
        display_name:
          type: string
          title: Display Name
          default: ''
        aliases:
          items:
            type: string
          type: array
          title: Aliases
          default: []
        confidence_score:
          type: number
          title: Confidence Score
      type: object
      required:
        - loinc_code
        - loinc_name
        - confidence_score
      title: LoincMatch
    Interpretation:
      type: string
      enum:
        - normal
        - abnormal
        - critical
        - unknown
      title: Interpretation
      description: ℹ️ This enum is non-exhaustive.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````