> ## 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.

# Update Lab Test Template

> Update a lab test template draft or replace its desired team assignments.

> [!NOTE]
>
> [Junction Management API](https://docs.junction.com/api-details/junction-management-api.md) is available for [the Scale plan](https://tryvital.io/pricing).

> [!TIP]
>
> The base URL of this endpoint is `https://api.management.junction.com/`.
>
> The endpoint accepts only [Management Key](https://docs.junction.com/api-details/junction-management-api.md#authentication) (`X-Management-Key`).
> Team API Key is not accepted.


## OpenAPI

````yaml patch /v1/org/{org_id}/lab_test_template/{env}/{region}/{template_id}
openapi: 3.1.0
info:
  title: Org Management
  version: 0.1.0
servers:
  - url: https://api.management.junction.com
    description: Production Management API server
security:
  - ManagementKey: []
paths:
  /v1/org/{org_id}/lab_test_template/{env}/{region}/{template_id}:
    patch:
      tags:
        - Lab Test Templates
      summary: Update Lab Test Template
      operationId: >-
        update_lab_test_template_v1_org__org_id__lab_test_template__env___region___template_id__patch
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Org Id
        - name: env
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/Env'
        - name: region
          in: path
          required: true
          schema:
            type: string
            enum:
              - us
              - eu
            title: Region
        - name: template_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Template Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLabTestTemplateBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientFacingLabTestTemplate'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Env:
      type: string
      enum:
        - production
        - sandbox
      title: Env
    UpdateLabTestTemplateBody:
      properties:
        name:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        lab_slug:
          anyOf:
            - $ref: '#/components/schemas/Labs'
            - type: 'null'
        fasting:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Fasting
        marker_ids:
          anyOf:
            - items:
                type: integer
              type: array
              minItems: 1
            - type: 'null'
          title: Marker Ids
        provider_ids:
          anyOf:
            - items:
                type: string
              type: array
              minItems: 1
            - type: 'null'
          title: Provider Ids
        lab_account_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Lab Account Id
        team_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Team Ids
      additionalProperties: false
      type: object
      title: UpdateLabTestTemplateBody
    ClientFacingLabTestTemplate:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        archived:
          type: boolean
          title: Archived
        draft:
          $ref: '#/components/schemas/LabTestTemplateDefinition'
        desired_team_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Desired Team Ids
        active_team_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Active Team Ids
        lab_test_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Lab Test Id
        latest_published_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Latest Published Version
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Published At
      type: object
      required:
        - id
        - archived
        - draft
        - desired_team_ids
        - active_team_ids
        - lab_test_id
        - latest_published_version
        - published_at
      title: ClientFacingLabTestTemplate
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Labs:
      type: string
      enum:
        - ayumetrix
        - spiriplex
        - ussl
        - quest
        - sonora_quest
        - labcorp
        - bioreference
        - us_biotek
        - manual
        - sanocardio
        - ihd
        - nexus
        - my_uti
        - crl
        - mtl
        - slopes
      title: Labs
    LabTestTemplateDefinition:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        lab_slug:
          $ref: '#/components/schemas/Labs'
        collection_method:
          $ref: '#/components/schemas/LabTestTemplateCollectionMethod'
        fasting:
          type: boolean
          title: Fasting
        marker_ids:
          items:
            type: integer
          type: array
          title: Marker Ids
        lab_account_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Lab Account Id
        sample_type:
          anyOf:
            - $ref: '#/components/schemas/LabTestTemplateSampleType'
            - type: 'null'
        lab_test_provider_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Lab Test Provider Id
        turnaround_time_lower:
          anyOf:
            - type: integer
            - type: 'null'
          title: Turnaround Time Lower
        turnaround_time_upper:
          anyOf:
            - type: integer
            - type: 'null'
          title: Turnaround Time Upper
        skus:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Skus
        logistics_routing_row_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Logistics Routing Row Id
        logistics_kit_variant_row_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Logistics Kit Variant Row Id
        tube_configuration:
          anyOf:
            - items:
                $ref: '#/components/schemas/LabTestTemplateTubeConfiguration'
              type: array
            - type: 'null'
          title: Tube Configuration
        approximate_tube_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Approximate Tube Count
        status:
          anyOf:
            - $ref: '#/components/schemas/LabTestTemplateStatus'
            - type: 'null'
      type: object
      required:
        - name
        - description
        - lab_slug
        - collection_method
        - fasting
        - marker_ids
        - lab_account_id
      title: LabTestTemplateDefinition
    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
    LabTestTemplateCollectionMethod:
      type: string
      enum:
        - testkit
        - walk_in_test
        - at_home_phlebotomy
        - on_site_collection
      title: LabTestTemplateCollectionMethod
    LabTestTemplateSampleType:
      type: string
      enum:
        - dried_blood_spot
        - arm_collector
        - serum
        - saliva
        - urine
        - stool
      title: LabTestTemplateSampleType
    LabTestTemplateTubeConfiguration:
      properties:
        specimen_type:
          type: string
          minLength: 1
          title: Specimen Type
      type: object
      required:
        - specimen_type
      title: LabTestTemplateTubeConfiguration
    LabTestTemplateStatus:
      type: string
      enum:
        - active
        - pending_approval
        - inactive
      title: LabTestTemplateStatus
  securitySchemes:
    ManagementKey:
      type: apiKey
      in: header
      name: X-Management-Key

````

## Related topics

- [Organization-Managed Lab Test Templates](https://docs.junction.com/lab/workflow/organization-managed-lab-test-templates.md)
- [Create Lab Test Template](https://docs.junction.com/api-reference/org-management/lab-test-templates/create-lab-test-template.md)
- [List Lab Test Templates](https://docs.junction.com/api-reference/org-management/lab-test-templates/list-lab-test-templates.md)
- [Get Lab Test Template](https://docs.junction.com/api-reference/org-management/lab-test-templates/get-lab-test-template.md)
- [Archive Lab Test Template](https://docs.junction.com/api-reference/org-management/lab-test-templates/archive-lab-test-template.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.