# NexHealth

> Book and manage NexHealth appointments, find open slots, manage patients, working hours and appointment types, and follow new patients and appointment changes.

App · 24 actions. Web page: https://docs.lodol.com/docs/integrations/nexhealth

## Actions

### Book appointment

Book an appointment for a patient with a provider. NexHealth accepts it first and writes it to the health record system when the practice's sync next runs.

**Inputs**

- Location (`location_id`, number, required): The practice location (office). At least 1.
- Patient ID (`patient_id`, number, required): The patient's NexHealth ID. At least 1.
- Provider (`provider`, number, required): The provider. At least 1.
- Starts at (`start_time`, date and time, required): When the appointment starts.
- Ends at (`end_time`, date and time): When it ends. Leave empty to use the appointment type's length.
- Appointment type (`appointment_type_id`, number): The appointment type: the same one the available slots were found for. At least 1.
- Operatory (`operatory_id`, number): The operatory (room or chair). Needed where the location books by operatory. At least 1.
- Note (`note`, text): A note written to the health record system, up to 128 characters.
- Notify patient (`notify_patient`, true/false): Send the patient NexHealth's booking message. Leave empty to send nothing.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "appt": {
        "appointment_type_id": 1,
        "cancelled": true,
        "cancelled_at": "example",
        "checked_out": true,
        "checkin_at": "example",
        "confirmed": true,
        "confirmed_at": "example",
        "created_at": "example",
        "end_time": "example",
        "foreign_id": "example",
        "id": 1,
        "is_new_clients_patient": true,
        "last_sync_time": "example",
        "location_id": 1,
        "note": "example",
        "operatory_id": 1,
        "patient_confirmed": true,
        "patient_id": 1,
        "patient_missed": true,
        "provider_id": 1,
        "provider_name": "example",
        "start_time": "example",
        "timezone": "example",
        "unavailable": true,
        "updated_at": "example"
      }
    },
    "description": "example"
  }
}
```

### Cancel appointment

Cancel an appointment that has reached the health record system.

**Inputs**

- Appointment ID (`appointment_id`, number, required): The appointment's NexHealth ID. At least 1.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "appt": {
        "appointment_type_id": 1,
        "cancelled": true,
        "cancelled_at": "example",
        "checked_out": true,
        "checkin_at": "example",
        "confirmed": true,
        "confirmed_at": "example",
        "created_at": "example",
        "end_time": "example",
        "foreign_id": "example",
        "id": 1,
        "is_new_clients_patient": true,
        "last_sync_time": "example",
        "location_id": 1,
        "note": "example",
        "operatory_id": 1,
        "patient_confirmed": true,
        "patient_id": 1,
        "patient_missed": true,
        "provider_id": 1,
        "provider_name": "example",
        "start_time": "example",
        "timezone": "example",
        "unavailable": true,
        "updated_at": "example"
      }
    },
    "description": "example"
  }
}
```

### Create appointment type

Add an appointment type with its length.

**Inputs**

- Name (`name`, text, required): The type's name. It must be unique.
- Length in minutes (`minutes`, number, required): How long it takes, in minutes (steps of 5 work best). At least 5.
- Bookable online (`bookable_online`, true/false): Let patients book it online.
- Location (`location_id`, number): The location, where appointment types are set per location. At least 1.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "bookable_online": true,
      "id": 1,
      "minutes": 1,
      "name": "example",
      "parent_id": 1,
      "parent_type": "example"
    },
    "description": "example"
  }
}
```

### Create patient

Add a patient at a location. They reach the health record system when their first appointment is booked.

**Inputs**

- Location (`location_id`, number, required): The practice location (office). At least 1.
- Provider (`provider`, number, required): The provider the patient is taken on with. At least 1.
- First name (`first_name`, text, required): First name.
- Last name (`last_name`, text, required): Last name.
- Email (`email`, text, required): Email address.
- Date of birth (`date_of_birth`, date, required): Date of birth.
- Phone number (`phone_number`, text, required): Phone number.
- Gender (`gender`, text): Gender. Leave empty and NexHealth records Female until the practice corrects it. One of: `Male`, `Female`, `Other`.
- Street address (`street_address`, text): Street address.
- City (`city`, text): City.
- State (`state`, text): State.
- ZIP code (`zip_code`, text): ZIP code.
- Return a matching patient (`return_existing`, true/false): Return the existing patient when one matches, instead of failing.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "user": {
        "bio": {
          "cell_phone_number": "example",
          "city": "example",
          "date_of_birth": "example",
          "gender": "example",
          "home_phone_number": "example",
          "phone_number": "example",
          "state": "example",
          "street_address": "example",
          "zip_code": "example"
        },
        "chart_id": "example",
        "created_at": "example",
        "email": "example",
        "first_name": "example",
        "foreign_id": "example",
        "foreign_id_type": "example",
        "guarantor_id": 1,
        "id": 1,
        "inactive": true,
        "institution_id": 1,
        "last_name": "example",
        "last_sync_time": "example",
        "location_ids": [
          1
        ],
        "middle_name": "example",
        "name": "example",
        "preferred_language": "example",
        "provider_id": 1,
        "updated_at": "example"
      }
    },
    "description": "example"
  }
}
```

### Create working hours

Add hours a provider can be booked at a location: on days of the week, on one date, or on a custom repeat.

**Inputs**

- Location (`location_id`, number, required): The practice location (office). At least 1.
- Provider (`provider`, number, required): The provider. At least 1.
- Starts at (`begin_time`, time, required): When the working hours start, in the location's time zone.
- Ends at (`end_time`, time, required): When they end, in the location's time zone.
- Operatory (`operatory_id`, number): The operatory (room or chair), for a location that books by operatory. At least 1.
- Appointment types (`appointment_type_ids`, list): Appointment types that can be booked in these hours.
- Days of the week (`days`, list): Days of the week they repeat on. One or more of: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Saturday`.
- On date (`specific_date`, date): A single date they apply to.
- Repeat every (`repeat_every`, number): For a custom repeat: how many days, weeks or months apart. At least 1.
- Repeat unit (`repeat_unit`, text): For a custom repeat: days, weeks or months. One of: `day` (Days), `week` (Weeks), `month` (Months).
- Repeat from (`repeat_from`, date): For a custom repeat: the date it starts from.
- Active (`active`, true/false): Whether the hours can be booked.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "active": true,
      "appointment_types": [
        {}
      ],
      "begin_time": "example",
      "custom_recurrence": {},
      "days": [
        "example"
      ],
      "end_time": "example",
      "id": 1,
      "location_id": 1,
      "operatory_id": 1,
      "provider_id": 1,
      "source": "example",
      "specific_date": "example",
      "tz_offset": "example"
    },
    "description": "example"
  }
}
```

### Delete appointment type

Delete an appointment type for good.

**Inputs**

- Appointment type (`appointment_type_id`, number, required): The appointment type. At least 1.
- Location (`location_id`, number): The location, where appointment types are set per location. At least 1.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "deleted": true,
    "id": 1
  }
}
```

### Delete working hours

Delete a working hours record.

**Inputs**

- Working hours ID (`working_hour_id`, number, required): The working hours record's ID. At least 1.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "deleted": true,
    "id": 1
  }
}
```

### Get appointment

Get an appointment with its patient, and its type and operatory if asked for.

**Inputs**

- Appointment ID (`appointment_id`, number, required): The appointment's NexHealth ID. At least 1.
- Include (`include`, list): Related records to add. One or more of: `patient`, `operatory`, `appointment_type` (Appointment type), `procedures`.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "appointment_type_id": 1,
      "cancelled": true,
      "cancelled_at": "example",
      "checked_out": true,
      "checkin_at": "example",
      "confirmed": true,
      "confirmed_at": "example",
      "created_at": "example",
      "end_time": "example",
      "foreign_id": "example",
      "id": 1,
      "is_new_clients_patient": true,
      "last_sync_time": "example",
      "location_id": 1,
      "note": "example",
      "operatory_id": 1,
      "patient": {
        "bio": {
          "cell_phone_number": "example",
          "city": "example",
          "date_of_birth": "example",
          "gender": "example",
          "home_phone_number": "example",
          "phone_number": "example",
          "state": "example",
          "street_address": "example",
          "zip_code": "example"
        },
        "chart_id": "example",
        "created_at": "example",
        "email": "example",
        "first_name": "example",
        "foreign_id": "example",
        "foreign_id_type": "example",
        "guarantor_id": 1,
        "id": 1,
        "inactive": true,
        "institution_id": 1,
        "last_name": "example",
        "last_sync_time": "example",
        "location_ids": [
          1
        ],
        "middle_name": "example",
        "name": "example",
        "preferred_language": "example",
        "provider_id": 1,
        "updated_at": "example"
      },
      "patient_confirmed": true,
      "patient_id": 1,
      "patient_missed": true,
      "provider_id": 1,
      "provider_name": "example",
      "start_time": "example",
      "timezone": "example",
      "unavailable": true,
      "updated_at": "example"
    },
    "description": "example"
  }
}
```

### Get location

Get a location's address, time zone and whether it books by operatory.

**Inputs**

- Location (`location_id`, number, required): The practice location (office). At least 1.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "city": "example",
      "country_code": "example",
      "created_at": "example",
      "email": "example",
      "id": 1,
      "inactive": true,
      "insert_appt_client": true,
      "institution_id": 1,
      "last_sync_time": "example",
      "map_by_operatory": true,
      "name": "example",
      "phone_number": "example",
      "set_availability_by_operatory": true,
      "state": "example",
      "street_address": "example",
      "tz": "example",
      "updated_at": "example",
      "zip_code": "example"
    },
    "description": "example"
  }
}
```

### Get patient

Get a patient's details, with their upcoming appointments if asked for.

**Inputs**

- Patient ID (`patient_id`, number, required): The patient's NexHealth ID. At least 1.
- Include (`include`, list): Related records to add. One or more of: `upcoming_appts` (Upcoming appointments), `last_visited_appointment` (Last visit), `guarantor`, `insurance_coverages` (Insurance coverages), `patient_alerts` (Patient alerts), `address`, `provider`.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "bio": {
        "cell_phone_number": "example",
        "city": "example",
        "date_of_birth": "example",
        "gender": "example",
        "home_phone_number": "example",
        "phone_number": "example",
        "state": "example",
        "street_address": "example",
        "zip_code": "example"
      },
      "chart_id": "example",
      "created_at": "example",
      "email": "example",
      "first_name": "example",
      "foreign_id": "example",
      "foreign_id_type": "example",
      "guarantor_id": 1,
      "id": 1,
      "inactive": true,
      "institution_id": 1,
      "last_name": "example",
      "last_sync_time": "example",
      "location_ids": [
        1
      ],
      "middle_name": "example",
      "name": "example",
      "preferred_language": "example",
      "provider_id": 1,
      "updated_at": "example"
    },
    "description": "example"
  }
}
```

### Get provider

Get a provider's details and the locations they work at.

**Inputs**

- Provider (`provider`, number, required): The provider. At least 1.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "created_at": "example",
      "display_name": "example",
      "email": "example",
      "first_name": "example",
      "foreign_id": "example",
      "id": 1,
      "inactive": true,
      "institution_id": 1,
      "last_name": "example",
      "locations": [
        {}
      ],
      "name": "example",
      "npi": "example",
      "specialty_code": "example",
      "updated_at": "example"
    },
    "description": "example"
  }
}
```

### Get sync status

Check whether NexHealth is reading from and writing to the practice's health record system right now.

**Inputs**

- Locations (`location_ids`, list): Only the syncs for these locations.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": [
      {
        "institution_id": 1,
        "locations": [
          {}
        ],
        "read_status": "example",
        "read_status_at": "example",
        "sync_source_name": "example",
        "sync_source_type": "example",
        "write_status": "example",
        "write_status_at": "example"
      }
    ],
    "description": "example"
  }
}
```

### Get working hours

Get one working hours record with its days, times and appointment types.

**Inputs**

- Working hours ID (`working_hour_id`, number, required): The working hours record's ID. At least 1.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "active": true,
      "appointment_types": [
        {}
      ],
      "begin_time": "example",
      "custom_recurrence": {},
      "days": [
        "example"
      ],
      "end_time": "example",
      "id": 1,
      "location_id": 1,
      "operatory_id": 1,
      "provider_id": 1,
      "source": "example",
      "specific_date": "example",
      "tz_offset": "example"
    },
    "description": "example"
  }
}
```

### List appointment types

List the practice's appointment types and how long each takes.

**Inputs**

- Location (`location_id`, number): The location, where appointment types are set per location. At least 1.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": [
      {
        "bookable_online": true,
        "id": 1,
        "minutes": 1,
        "name": "example",
        "parent_id": 1,
        "parent_type": "example"
      }
    ],
    "description": "example"
  }
}
```

### List appointments

List a location's appointments starting in a time range, by patient or provider, or changed since a time.

**Inputs**

- Location (`location_id`, number, required): The practice location (office). At least 1.
- From (`start`, date and time, required): Appointments starting at or after this time.
- To (`end`, date and time, required): Appointments starting at or before this time.
- Providers (`provider_ids`, list): Only appointments with these providers.
- Patient IDs (`patient_ids`, list): Only these patients' appointments, up to 25 patient IDs.
- Cancelled (`cancelled`, true/false): Only cancelled appointments, or only those not cancelled. Leave empty for both.
- Blocked time (`unavailable`, true/false): Only blocked-off time, or only real appointments. Leave empty for both.
- Changed since (`updated_since`, date and time): Only records changed at or after this time.
- How many (`per_page`, number): How many to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Next page cursor (`end_cursor`, text): For the next page: the end cursor from the last page's page info.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": [
      {
        "appointment_type_id": 1,
        "cancelled": true,
        "cancelled_at": "example",
        "checked_out": true,
        "checkin_at": "example",
        "confirmed": true,
        "confirmed_at": "example",
        "created_at": "example",
        "end_time": "example",
        "foreign_id": "example",
        "id": 1,
        "is_new_clients_patient": true,
        "last_sync_time": "example",
        "location_id": 1,
        "note": "example",
        "operatory_id": 1,
        "patient_confirmed": true,
        "patient_id": 1,
        "patient_missed": true,
        "provider_id": 1,
        "provider_name": "example",
        "start_time": "example",
        "timezone": "example",
        "unavailable": true,
        "updated_at": "example"
      }
    ],
    "description": "example",
    "page_info": {
      "end_cursor": "example",
      "has_next_page": true,
      "has_previous_page": true,
      "start_cursor": "example"
    }
  }
}
```

### List available slots

Find the open times that can be booked at a location over the coming days, by provider and appointment type.

**Inputs**

- Location (`location_id`, number, required): The location to look at. At least 1.
- From (`start_date`, date, required): The first day to look on.
- Days (`days`, number, required): How many days to look over, counting the first. Up to 14 is fastest. From 1 to 31.
- Providers (`provider_ids`, list): Only these providers' times. Choose providers, an appointment type, or both.
- Appointment type (`appointment_type_id`, number): Only times this appointment type fits, as long as the type lasts. At least 1.
- Operatories (`operatory_ids`, list): Only these operatories, where the location books by operatory.
- Slot length (`slot_length`, number): How long each slot is, in minutes. Leave empty for 15, or the appointment type's length. At least 5.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": [
      {
        "lid": 1,
        "next_available_date": "example",
        "operatory_id": 1,
        "pid": 1,
        "slots": [
          {
            "end_time": "example",
            "operatory_id": 1,
            "provider_id": 1,
            "time": "example"
          }
        ]
      }
    ],
    "description": "example"
  }
}
```

### List locations

List the practice's locations (offices) with their addresses, time zones and booking settings.

**Inputs**

- Inactive (`inactive`, true/false): Only inactive locations, or only active ones. Leave empty for both.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": [
      {
        "id": 1,
        "locations": [
          {
            "city": "example",
            "country_code": "example",
            "created_at": "example",
            "email": "example",
            "id": 1,
            "inactive": true,
            "insert_appt_client": true,
            "institution_id": 1,
            "last_sync_time": "example",
            "map_by_operatory": true,
            "name": "example",
            "phone_number": "example",
            "set_availability_by_operatory": true,
            "state": "example",
            "street_address": "example",
            "tz": "example",
            "updated_at": "example",
            "zip_code": "example"
          }
        ],
        "name": "example",
        "subdomain": "example"
      }
    ],
    "description": "example"
  }
}
```

### List operatories

List a location's operatories: the rooms or chairs appointments are booked into.

**Inputs**

- Location (`location_id`, number, required): The practice location (office). At least 1.
- Name contains (`search_name`, text): Only operatories whose name contains this.
- How many (`per_page`, number): How many to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Next page cursor (`end_cursor`, text): For the next page: the end cursor from the last page's page info.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": [
      {
        "active": true,
        "bookable_online": true,
        "created_at": "example",
        "display_name": "example",
        "foreign_id": "example",
        "id": 1,
        "location_id": 1,
        "name": "example",
        "updated_at": "example"
      }
    ],
    "description": "example",
    "page_info": {
      "end_cursor": "example",
      "has_next_page": true,
      "has_previous_page": true,
      "start_cursor": "example"
    }
  }
}
```

### List patients

List or search a location's patients by name, email, phone or date of birth, or those changed since a time.

**Inputs**

- Location (`location_id`, number, required): The practice location (office). At least 1.
- Name (`name`, text): Only patients with this name.
- Email (`email`, text): Only patients with this email address.
- Phone number (`phone_number`, text): Only patients with this phone number.
- Date of birth (`date_of_birth`, date): Only patients born on this date.
- Inactive (`inactive`, true/false): Only inactive patients, or only active ones. Leave empty for both.
- This location only (`location_strict`, true/false): Only patients of this location, not every location sharing its health record system.
- Changed since (`updated_since`, date and time): Only records changed at or after this time.
- Sort by (`sort`, text): The order. Leave empty to sort by ID. One of: `id` (ID, lowest first), `-id` (ID, highest first), `updated_at` (Last changed, oldest first), `-updated_at` (Last changed, newest first).
- How many (`per_page`, number): How many to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Next page cursor (`end_cursor`, text): For the next page: the end cursor from the last page's page info.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": [
      {
        "bio": {
          "cell_phone_number": "example",
          "city": "example",
          "date_of_birth": "example",
          "gender": "example",
          "home_phone_number": "example",
          "phone_number": "example",
          "state": "example",
          "street_address": "example",
          "zip_code": "example"
        },
        "chart_id": "example",
        "created_at": "example",
        "email": "example",
        "first_name": "example",
        "foreign_id": "example",
        "foreign_id_type": "example",
        "guarantor_id": 1,
        "id": 1,
        "inactive": true,
        "institution_id": 1,
        "last_name": "example",
        "last_sync_time": "example",
        "location_ids": [
          1
        ],
        "middle_name": "example",
        "name": "example",
        "preferred_language": "example",
        "provider_id": 1,
        "updated_at": "example"
      }
    ],
    "description": "example",
    "page_info": {
      "end_cursor": "example",
      "has_next_page": true,
      "has_previous_page": true,
      "start_cursor": "example"
    }
  }
}
```

### List providers

List the practice's providers (doctors and hygienists), at one location or all.

**Inputs**

- Location (`location_id`, number): The practice location (office). At least 1.
- Bookable online (`requestable`, true/false): Only providers patients can book online at the location.
- Inactive (`inactive`, true/false): List inactive providers instead of active ones.
- Changed since (`updated_since`, date and time): Only records changed at or after this time.
- How many (`per_page`, number): How many to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Next page cursor (`end_cursor`, text): For the next page: the end cursor from the last page's page info.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": [
      {
        "created_at": "example",
        "display_name": "example",
        "email": "example",
        "first_name": "example",
        "foreign_id": "example",
        "id": 1,
        "inactive": true,
        "institution_id": 1,
        "last_name": "example",
        "locations": [
          {}
        ],
        "name": "example",
        "npi": "example",
        "specialty_code": "example",
        "updated_at": "example"
      }
    ],
    "description": "example",
    "page_info": {
      "end_cursor": "example",
      "has_next_page": true,
      "has_previous_page": true,
      "start_cursor": "example"
    }
  }
}
```

### List working hours

List the hours providers can be booked at a location.

**Inputs**

- Location (`location_id`, number, required): The practice location (office). At least 1.
- Provider (`provider`, number): Only this provider's hours. At least 1.
- Active (`active`, true/false): Inactive hours instead of active ones: leave empty for active.
- Skip past dates (`ignore_past_dates`, true/false): Leave out hours set for single dates already past.
- How many (`per_page`, number): How many to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Next page cursor (`end_cursor`, text): For the next page: the end cursor from the last page's page info.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": [
      {
        "active": true,
        "appointment_types": [
          {}
        ],
        "begin_time": "example",
        "custom_recurrence": {},
        "days": [
          "example"
        ],
        "end_time": "example",
        "id": 1,
        "location_id": 1,
        "operatory_id": 1,
        "provider_id": 1,
        "source": "example",
        "specific_date": "example",
        "tz_offset": "example"
      }
    ],
    "description": "example",
    "page_info": {
      "end_cursor": "example",
      "has_next_page": true,
      "has_previous_page": true,
      "start_cursor": "example"
    }
  }
}
```

### Update appointment

Reschedule, confirm, check in or change the note or operatory of an appointment that has reached the health record system.

**Inputs**

- Appointment ID (`appointment_id`, number, required): The appointment's NexHealth ID. At least 1.
- Starts at (`start_time`, date and time): A new start time.
- Ends at (`end_time`, date and time): A new end time.
- Confirmed (`confirmed`, true/false): Mark it confirmed by the office.
- Checked in at (`checkin_at`, date and time): When the patient checked in.
- Operatory ID (`operatory_id`, number): A new operatory (room or chair). At least 1.
- Note (`note`, text): A new note.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "appt": {
        "appointment_type_id": 1,
        "cancelled": true,
        "cancelled_at": "example",
        "checked_out": true,
        "checkin_at": "example",
        "confirmed": true,
        "confirmed_at": "example",
        "created_at": "example",
        "end_time": "example",
        "foreign_id": "example",
        "id": 1,
        "is_new_clients_patient": true,
        "last_sync_time": "example",
        "location_id": 1,
        "note": "example",
        "operatory_id": 1,
        "patient_confirmed": true,
        "patient_id": 1,
        "patient_missed": true,
        "provider_id": 1,
        "provider_name": "example",
        "start_time": "example",
        "timezone": "example",
        "unavailable": true,
        "updated_at": "example"
      }
    },
    "description": "example"
  }
}
```

### Update appointment type

Rename an appointment type or change its length or online booking.

**Inputs**

- Appointment type (`appointment_type_id`, number, required): The appointment type. At least 1.
- Name (`name`, text): A new name.
- Length in minutes (`minutes`, number): A new length, in minutes. At least 5.
- Bookable online (`bookable_online`, true/false): Let patients book it online.
- Location (`location_id`, number): The location, where appointment types are set per location. At least 1.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "bookable_online": true,
      "id": 1,
      "minutes": 1,
      "name": "example",
      "parent_id": 1,
      "parent_type": "example"
    },
    "description": "example"
  }
}
```

### Update working hours

Change a working hours record's times, schedule, appointment types or whether it's active.

**Inputs**

- Working hours ID (`working_hour_id`, number, required): The working hours record's ID. At least 1.
- Provider (`provider`, number): A different provider. At least 1.
- Location (`location_id`, number): The location, to pick an operatory from. It isn't changed. At least 1.
- Starts at (`begin_time`, time): When the working hours start, in the location's time zone.
- Ends at (`end_time`, time): When they end, in the location's time zone.
- Operatory (`operatory_id`, number): The operatory (room or chair), for a location that books by operatory. At least 1.
- Appointment types (`appointment_type_ids`, list): Appointment types that can be booked in these hours.
- Days of the week (`days`, list): Days of the week they repeat on. One or more of: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Saturday`.
- On date (`specific_date`, date): A single date they apply to.
- Repeat every (`repeat_every`, number): For a custom repeat: how many days, weeks or months apart. At least 1.
- Repeat unit (`repeat_unit`, text): For a custom repeat: days, weeks or months. One of: `day` (Days), `week` (Weeks), `month` (Months).
- Repeat from (`repeat_from`, date): For a custom repeat: the date it starts from.
- Active (`active`, true/false): Whether the hours can be booked.

**Outputs**

- `data` (object): The response from NexHealth.

**Example output**

```json
{
  "data": {
    "code": true,
    "count": 1,
    "data": {
      "active": true,
      "appointment_types": [
        {}
      ],
      "begin_time": "example",
      "custom_recurrence": {},
      "days": [
        "example"
      ],
      "end_time": "example",
      "id": 1,
      "location_id": 1,
      "operatory_id": 1,
      "provider_id": 1,
      "source": "example",
      "specific_date": "example",
      "tz_offset": "example"
    },
    "description": "example"
  }
}
```
