> ## 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 Account Teams

> Patch org lab account via the Junction API. Requires authentication with your team API key.

<Info>
  [Junction Management API](/api-details/junction-management-api) is available for [the Scale plan](https://tryvital.io/pricing).
</Info>

<Tip>
  The base URL of this endpoint is `https://api.management.junction.com/`.

  The endpoint accepts only [Management Key](/api-details/junction-management-api#authentication) (`X-Management-Key`).
  Team API Key is not accepted.
</Tip>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url https://api.management.junction.com/v1/org/{org_id}/lab_account/{env}/{region}/{account_id} \
    --header 'X-Vital-Org-Key: <api-key>' \
    --data '{ "team_id_allowlist": "<team-id>" }'
  ```
</RequestExample>


## OpenAPI

````yaml patch /v1/org/{org_id}/lab_account/{env}/{region}/{account_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_account/{env}/{region}/{account_id}:
    patch:
      tags:
        - Team Lab Accounts
      summary: Update Lab Account Team Id Allowlist
      operationId: >-
        update_lab_account_team_id_allowlist_v1_org__org_id__lab_account__env___region___account_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: account_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Account Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabAccountTeamIdAllowlistUpdateBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabAccountResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Env:
      type: string
      enum:
        - production
        - sandbox
      title: Env
    LabAccountTeamIdAllowlistUpdateBody:
      properties:
        team_id_allowlist:
          items:
            type: string
            format: uuid
          type: array
          title: Team Id Allowlist
      type: object
      required:
        - team_id_allowlist
      title: LabAccountTeamIdAllowlistUpdateBody
    LabAccountResponse:
      properties:
        lab_account:
          anyOf:
            - $ref: '#/components/schemas/ClientFacingLabAccount'
            - type: 'null'
      type: object
      title: LabAccountResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ClientFacingLabAccount:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        lab:
          $ref: '#/components/schemas/Labs'
        org_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Org Id
        status:
          $ref: '#/components/schemas/LabAccountStatus'
        delegated_flow:
          $ref: '#/components/schemas/LabAccountDelegatedFlow'
        provider_account_id:
          type: string
          title: Provider Account Id
        account_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Name
        default_clinical_notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Clinical Notes
        business_units:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Business Units
        allowed_billing:
          additionalProperties:
            items:
              $ref: '#/components/schemas/USState'
            type: array
          propertyNames:
            $ref: '#/components/schemas/Billing'
          type: object
          title: Allowed Billing
        team_id_allowlist:
          items:
            type: string
            format: uuid
          type: array
          title: Team Id Allowlist
      type: object
      required:
        - id
        - lab
        - status
        - delegated_flow
        - provider_account_id
        - allowed_billing
        - team_id_allowlist
      title: ClientFacingLabAccount
    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
    Labs:
      type: string
      enum:
        - ayumetrix
        - spiriplex
        - ussl
        - quest
        - sonora_quest
        - labcorp
        - bioreference
        - us_biotek
        - manual
        - sanocardio
        - ihd
        - nexus
        - my_uti
        - crl
      title: Labs
    LabAccountStatus:
      type: string
      enum:
        - active
        - pending
        - suspended
        - ready_to_launch
      title: LabAccountStatus
    LabAccountDelegatedFlow:
      type: string
      enum:
        - order_delegated
        - result_delegated
        - fully_delegated
        - not_delegated
      title: LabAccountDelegatedFlow
      description: >-
        Describes which parts of the lab testing flow are delegated to the
        customer.


        - ORDER_DELEGATED: Ordering using client's physicians, critical result
        follow up via Junction

        - RESULT_DELEGATED: Ordering using Junction's Physician Network,
        critical results handled by client

        - FULLY_DELEGATED: Order and critical results handled by client

        - NOT_DELEGATED: Junction handles both ordering and results
    USState:
      type: string
      enum:
        - AL
        - AK
        - AZ
        - AR
        - CA
        - CO
        - CT
        - DE
        - FL
        - GA
        - HI
        - ID
        - IL
        - IN
        - IA
        - KS
        - KY
        - LA
        - ME
        - MD
        - MA
        - MI
        - MN
        - MS
        - MO
        - MT
        - NE
        - NV
        - NH
        - NJ
        - NM
        - NY
        - NC
        - ND
        - OH
        - OK
        - OR
        - PA
        - RI
        - SC
        - SD
        - TN
        - TX
        - UT
        - VT
        - VA
        - WA
        - WV
        - WI
        - WY
      title: USState
  securitySchemes:
    ManagementKey:
      type: apiKey
      in: header
      name: X-Management-Key

````