> ## 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 appointment reschedule

> Partially update order phlebotomy appointment reschedule via the Junction API. Requires authentication with your team API key.

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
       --url '{{BASE_URL}}/v3/order/413d7205-f8a9-42ed-aa4a-edb99e481ca0/phlebotomy/appointment/reschedule' \
       --header 'accept: application/json' \
       --header 'x-vital-api-key: YOUR_API_KEY' \
       --data '
  {
      "booking_key": "bar456",
      "appointment_notes": "Updated: need morning appointment"
  }
  '
  ```

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

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

  data = client.lab_tests.reschedule_phlebotomy_appointment(
      "<order_id>",
      booking_key="<booking_key>",
  )
  ```

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

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

  const data = await client.labTests.reschedulePhlebotomyAppointment({
      orderId: "<order_id>",
      body: {
          bookingKey: "<booking_key>",
      },
  });
  ```

  ```java Java theme={null}
  import com.junction.api.Junction;
  import com.junction.api.core.Environment;
  import com.junction.api.resources.labtests.requests.ReschedulePhlebotomyAppointmentLabTestsRequest;
  import com.junction.api.types.AppointmentRescheduleRequest;

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

  var data = client.labTests().reschedulePhlebotomyAppointment(
      "<order_id>",
      ReschedulePhlebotomyAppointmentLabTestsRequest.builder()
          .body(
              AppointmentRescheduleRequest.builder()
                  .bookingKey("<booking_key>")
                  .build()
          )
          .build()
  );
  ```

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

      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),
  )

  response, err := c.LabTests.ReschedulePhlebotomyAppointment(context.TODO(), &junction.ReschedulePhlebotomyAppointmentLabTestsRequest{
      OrderId: "<order_id>",
      Body: &junction.AppointmentRescheduleRequest{
          BookingKey: "<booking_key>",
      },
  })
  if err != nil {
      return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "id": "413d7205-f8a9-42ed-aa4a-edb99e481ca0",
      "user_id": "202b2c2f-fb4c-44dc-a4f8-621186fde227",
      "address": {
          "first_line": "West Lincoln Street",
          "second_line": "",
          "city": "Phoenix",
          "state": "AZ",
          "zip_code": "85004",
          "unit": "14",
          "access_notes": "Gate code #1234, use side entrance"
      },
      "location": {
          "lng": -112.0772235,
          "lat": 33.4421912
      },
      "start_at": "2023-05-17T20:00:00+00:00",
      "end_at": "2023-05-17T22:00:00+00:00",
      "iana_timezone": "America/Phoenix",
      "type": "phlebotomy",
      "provider": "getlabs",
      "status": "pending",
      "provider_id": "e89eb489-7382-4966-bb14-7ab4763eba6c",
      "can_reschedule": true,
      "appointment_notes": "Updated: need morning appointment"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml PATCH /v3/order/{order_id}/phlebotomy/appointment/reschedule
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:
  /v3/order/{order_id}/phlebotomy/appointment/reschedule:
    patch:
      tags:
        - order
      summary: Reschedule Phlebotomy Appointment
      description: Reschedule a previously booked at-home phlebotomy appointment.
      operationId: >-
        reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch
      parameters:
        - name: order_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Your Order ID.
            title: Order Id
          description: Your Order ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppointmentRescheduleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientFacingAppointment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AppointmentRescheduleRequest:
      properties:
        booking_key:
          type: string
          title: Booking Key
        appointment_notes:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Appointment Notes
      type: object
      required:
        - booking_key
      title: AppointmentRescheduleRequest
    ClientFacingAppointment:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        user_id:
          type: string
          format: uuid4
          title: User Id
        order_id:
          type: string
          format: uuid4
          title: Order Id
        order_transaction_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Transaction Id
        address:
          $ref: '#/components/schemas/USAddress'
        location:
          $ref: '#/components/schemas/LngLat'
        start_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start At
          description: Time is in UTC
        end_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End At
          description: Time is in UTC
        iana_timezone:
          anyOf:
            - type: string
              pattern: >-
                ^(?:(?:[A-Za-z_\-]+\/[A-Za-z_\-]+(?:\/[A-Za-z_\-]+)?)|(?:Etc\/[A-Za-z0-9+\-]+(?:\/[A-Za-z0-9]+)?|(?:CET|CST6CDT|EET|EST|EST5EDT|MET|MST|MST7MDT|PST8PDT|HST)))$
            - type: 'null'
          title: Iana Timezone
        type:
          $ref: '#/components/schemas/AppointmentType'
          description: ℹ️ This enum is non-exhaustive.
        provider:
          $ref: '#/components/schemas/AppointmentProvider'
          description: ℹ️ This enum is non-exhaustive.
        status:
          $ref: '#/components/schemas/AppointmentStatus'
          description: ℹ️ This enum is non-exhaustive.
        provider_id:
          type: string
          title: Provider Id
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
        can_reschedule:
          type: boolean
          title: Can Reschedule
        appointment_notes:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Appointment Notes
        event_status:
          $ref: '#/components/schemas/AppointmentEventStatus'
          description: ℹ️ This enum is non-exhaustive.
        event_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Event Data
        events:
          items:
            $ref: '#/components/schemas/ClientFacingAppointmentEvent'
          type: array
          title: Events
      type: object
      required:
        - id
        - user_id
        - order_id
        - address
        - location
        - start_at
        - end_at
        - type
        - provider
        - status
        - provider_id
        - can_reschedule
        - event_status
        - events
      title: ClientFacingAppointment
      example:
        address:
          access_notes: 'Gate code #1234, use side entrance'
          city: San Francisco
          country: United States
          first_line: 123 Main St.
          second_line: Apt. 208
          state: CA
          zip_code: '91189'
        appointment_notes: Please bring photo ID
        can_reschedule: true
        end_at: '2022-01-01T00:00:00'
        event_data:
          description: >-
            Metadata field containing provider specific data, like cancellation
            reason or origin
        event_status: scheduled
        events:
          - created_at: '2022-01-01T00:00:00Z'
            status: scheduled
          - created_at: '2022-01-02T00:00:00Z'
            status: completed
        external_id: ext-123
        iana_timezone: America/New_York
        id: 6638e23d-925f-4df9-be13-0e8c6d59413e
        location:
          lat: 37.7749295
          lng: -122.4194155
        order_id: 2d5322d6-3494-4fe5-9328-1f99810bb962
        order_transaction_id: 30449996-8a88-4e1b-b74a-d9ddc5793ae6
        provider: getlabs
        provider_id: '123'
        start_at: '2022-01-01T00:00:00'
        status: confirmed
        type: phlebotomy
        user_id: c5c37e29-4d6a-44f7-b42c-779167514c50
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    USAddress:
      properties:
        first_line:
          type: string
          title: First Line
        second_line:
          anyOf:
            - type: string
            - type: 'null'
          title: Second Line
        city:
          type: string
          title: City
        state:
          type: string
          title: State
        zip_code:
          type: string
          pattern: ^\d{5}(-\d{4})?$
          title: Zip Code
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
          description: >-
            Deprecated. Use `second_line` instead to provide the unit number.
            Subject to removal after 20 Nov 2023.
          deprecated: true
        access_notes:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Access Notes
      type: object
      required:
        - first_line
        - city
        - state
        - zip_code
      title: USAddress
    LngLat:
      properties:
        lng:
          type: number
          maximum: 180
          minimum: -180
          title: Lng
        lat:
          type: number
          maximum: 90
          minimum: -90
          title: Lat
      type: object
      required:
        - lng
        - lat
      title: LngLat
    AppointmentType:
      type: string
      enum:
        - phlebotomy
        - patient_service_center
      title: AppointmentType
      description: ℹ️ This enum is non-exhaustive.
    AppointmentProvider:
      type: string
      enum:
        - getlabs
        - phlebfinders
        - quest
        - sonora_quest
      title: AppointmentProvider
      description: ℹ️ This enum is non-exhaustive.
    AppointmentStatus:
      type: string
      enum:
        - confirmed
        - pending
        - reserved
        - in_progress
        - completed
        - cancelled
      title: AppointmentStatus
      description: ℹ️ This enum is non-exhaustive.
    AppointmentEventStatus:
      type: string
      enum:
        - pending
        - reserved
        - scheduled
        - completed
        - cancelled
        - in_progress
      title: AppointmentEventStatus
      description: ℹ️ This enum is non-exhaustive.
    ClientFacingAppointmentEvent:
      properties:
        created_at:
          type: string
          format: date-time
          title: Created At
        status:
          $ref: '#/components/schemas/AppointmentEventStatus'
          description: ℹ️ This enum is non-exhaustive.
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Data
      type: object
      required:
        - created_at
        - status
      title: ClientFacingAppointmentEvent
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````