---
title: "Create working hour (beta)"
method: POST
path: "/working_hours"
tags: ["Working Hours"]
---

# Create working hour (beta)

`POST /working_hours`

## Request

- Base URL: `https://nexhealth.info`
- URL: `https://nexhealth.info/working_hours`
- Auth: API key in header `Authorization`

> 🚧 Beta
>
> Send `Nex-Api-Version: v3.1.0` to use this endpoint. It is still changing, and access is limited to approved partner institutions. Contact NexHealth before you build on it.

> **Changed from v3.0.0:** Adds response fields `data.appointment_types`, `data.appointment_types[].active`, `data.appointment_types[].bookable_online`, `data.appointment_types[].data_source_id` (+20 more).

## Query parameters

- `subdomain` string, required
- `location_id` integer, required

## Headers

- `Nex-Api-Version` string, required

## Request body

- PostWorkingHours: Create working hour
  - `working_hour` object, required: Configure only one of days, specific_date or custom_recurrence
    - `provider_id` integer, required: ID of the provider
    - `begin_time` string, required: Start time of the working hour as HH:MM, in the location's time zone
    - `end_time` string, required: End time of the working hour as HH:MM, in the location's time zone
    - `operatory_id` integer: ID of the operatory
    - `appointment_type_ids` integer[]: Associate appointment types with this working hour
    - `days` string[]: Configure days of the week for this working hour
    - `specific_date` string, date: Configure a specific date for this working hour
    - `custom_recurrence` object: Configure custom recurrence
      - `num` integer, required: Unit count
      - `ref` string, date, required: Starting date
      - `unit` '' | 'day' | 'week' | 'month', required: Every # days/weeks/months
    - `active` boolean: Is this working hour active?

## Response `201`

Successful

- APIV31EntitiesWorkingHourResponse: API_V31_Entities_WorkingHour_Response model
  - `code` boolean: Indicates the success or failure of the request
  - `description` string: Additional context on the request to help with debugging.
  - `error` string[]: Any errors that occur during the execution of the request.
  - `data` APIV31EntitiesWorkingHour
    - `id` integer: Resource ID
    - `provider_id` integer, nullable: Provider ID
    - `location_id` integer, nullable: Location ID
    - `operatory_id` integer, nullable: Operatory ID
    - `begin_time` string: Availability start time in the practices timezone
    - `end_time` string: Availability end time in the practices timezone
    - `days` string[], nullable: Configured week days. Empty when the working hour is configured for a custom recurrence
    - `specific_date` string, date, nullable: Configured specific date
    - `custom_recurrence` object, nullable: Configured custom recurrence, with the fields num (recurrence interval count), ref (starting date), and unit (day, week, or month)
    - `tz_offset` string: UTC offset for the practice
    - `active` boolean: Is active?
    - `source` 'manual' | 'synced': Source of the working hour
    - `label` APIV31EntitiesWorkingHourLabel
      - `id` integer: Resource ID
      - `location_id` integer, nullable: The location ID
      - `name` string: The name for working hour label
      - `color_hex` string, nullable: The color of the working hour label as a hex code
      - `default_duration_minutes` integer, nullable: Slot length in minutes applied to working hours that inherit this label when no restriction row sets one
      - `active` boolean: False when the working hour label has been deactivated
    - `schedule_template` APIV31EntitiesScheduleTemplate
      - `id` integer: Schedule template NexHealth ID
      - `name` string: The name of the schedule template
      - `color_hex` string, nullable: The color of the schedule template as a hex code
      - `active` boolean: False when the EHR has deactivated the schedule template
      - `location_id` integer, nullable: The NexHealth ID of the location the schedule template belongs to, null when it applies to every location of the data source
      - `foreign_id` string, nullable: Identifier NexHealth uses to uniquely match this record to its counterpart in the integrated EHR. How it is derived differs between EHRs and may change; treat it as an opaque string and do not parse it.
    - `type` 'booking' | 'block': Kind of schedule row: `booking` is bookable time, possibly restricted to appointment types; `block` is time that cannot be booked, such as closures or lunch
    - `inherit_label_restrictions` boolean: Whether the label's restriction rows apply to this working hour
    - `appointment_types` APIV31EntitiesAppointmentTypeCore[]: Manual appointment type mappings; EHR restrictions are read from `/working_hours/{id}/appointment_types`
      - `id` integer: Appointment type ID
      - `name` string: Appointment type name. Unique string identifier
      - `parent_type` string: Parent type for appointment type. Defines the belongs to relationship with either Institution or Location
      - `parent_id` integer: Identifies the specific resource the appointment type belongs to (see parent_type)
      - `minutes` integer: Default duration of appointments of this appointment type
      - `bookable_online` boolean: True if this appointment type should be bookable via the NexHealth online booking page
      - `display_name` string, nullable: Patient-facing name shown instead of `name` when present
      - `source` 'manual' | 'synced': Where the appointment type is managed: `manual` in NexHealth, `synced` in the EHR
      - `active` boolean: False when the EHR has deactivated a synced appointment type
      - `foreign_id` string, nullable: Identifier NexHealth uses to uniquely match this record to its counterpart in the integrated EHR. How it is derived differs between EHRs and may change; treat it as an opaque string and do not parse it.
      - `data_source_id` integer, nullable: The NexHealth ID of the data source a synced appointment type came from, null for manual appointment types
  - `count` integer: Number of total objects, in case of collection.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/nexhealth/apis/nexhealth-api-v3-1-0-beta.md) - [All operations](https://skmtc.dev/nexhealth/apis/nexhealth-api-v3-1-0-beta/llms.txt) - [OpenAPI document](https://skmtc.dev/nexhealth/apis/nexhealth-api-v3-1-0-beta/revisions/93cb4af790a5?raw)
