---
title: "Assign a room to a practitioner's custom availability on a date"
method: POST
path: "/shop/practitioners/{practitionerId}/room-assignments"
tags: ["Practitioners"]
---

# Assign a room to a practitioner's custom availability on a date

`POST /shop/practitioners/{practitionerId}/room-assignments`

Applies a room assignment (or clears one when `room_id` is null) to the
practitioner's custom availability rules for the given `date` and time
range. The server carves the matching availability segments and returns
the resulting `PractitionerCustomAvailability` rules for that day.

The request only succeeds when the target period falls within an
existing availability window for the practitioner on that date.

## Request body

- object
  - `date` string, date, required — The date to target, in YYYY-MM-DD format.
  - `time_from` string, required — Start time of the target range in HH:MM format.
  - `time_to` string, required — End time of the target range in HH:MM format. Must be after `time_from`.
  - `room_id` string, object-id, nullable — The room to assign to the target range. Pass null to remove a room assignment.
  - `category_ids` string[] — Optional category IDs used when carving matching availability segments.
  - `offerings` OfferingIdentifier[] — The offerings to assign to the target range. Pass an empty array to remove all offering assignments from the targeted segments. Omitting this field leaves existing offering assignments unchanged.
    - `offering_id` string, mongo-id, required — The ID of the offering.
    - `offering_name` string, required — The name of the offering.
    - `offering_type` 'appointment' | 'appointment_enquiry' | 'area_booking' | 'course' | 'hotel_room_reservation' | 'membership' | 'package' | 'product' | 'session' | 'table_reservation' | 'voucher', required — Discriminator describing what kind of sellable item an `Offering` represents. The value determines which downstream schema (`Appointment`, `Session`, `Package`, etc.) the offering's `offering_id` resolves against, and which checkout/booking flow applies.

## Response `200`

A paginated list of `PractitionerCustomAvailability` rules for the practitioner.

- object
  - `data` PractitionerCustomAvailability[], required — The custom availability rules covering the filtered range. Order is by `date_time_from` ascending.
    - `id` string, object-id, required — The unique identifier of the custom availability rule.
    - `has_availability_id` string, object-id, required — The ID of the resource this rule belongs to. For rules created through this endpoint, this is the practitioner ID.
    - `date_time_from` string, date-time, required — The start of the window the rule covers, in ISO 8601 with the practitioner's timezone offset.
    - `date_time_to` string, date-time, required — The end of the window the rule covers, in ISO 8601 with the practitioner's timezone offset.
    - `is_available` boolean, required — `true` means the practitioner is bookable during the window; `false` blocks bookings. A `false` rule overrides any regular rota availability for the same period.
    - `room_id` string, object-id, nullable, required — The ID of the room the practitioner is assigned to during this window, if any.
    - `category_ids` string[], required — The IDs of the service categories the practitioner is available for during this window. An empty array means all categories are available.
    - `offerings` OfferingIdentifier[], required — The offerings the practitioner is assigned to during this window. An empty array means the practitioner is not linked to specific offerings for this window.
      - `offering_id` string, mongo-id, required — The ID of the offering.
      - `offering_name` string, required — The name of the offering.
      - `offering_type` 'appointment' | 'appointment_enquiry' | 'area_booking' | 'course' | 'hotel_room_reservation' | 'membership' | 'package' | 'product' | 'session' | 'table_reservation' | 'voucher', required — Discriminator describing what kind of sellable item an `Offering` represents. The value determines which downstream schema (`Appointment`, `Session`, `Package`, etc.) the offering's `offering_id` resolves against, and which checkout/booking flow applies.
  - `meta` PaginationMeta, required — Counts and positional information for the current page of a list response. Use `current_page` and `last_page` to drive pagination UI, `total` for result counts, and `per_page` to confirm the page size the server actually applied (which may differ from the requested value when capped).
    - `from` integer, required — The item number from which this results set starts from
    - `to` integer, required — The item number from which this results set ends at
    - `total` integer, required — The total number of results
    - `current_page` integer, required — The current page number
    - `last_page` integer, required — The page number of the last result set
    - `per_page` integer, required — The number of results per page
    - `path` string, required — The path of this api request
  - `links` PaginationLinks, required — Hypermedia navigation links for paging through a list response. Each property is a fully-qualified URL that preserves the original query string (filters, sort, page size) and only swaps the `page` parameter. `next` and `prev` are `null` at the ends of the result set; `first` and `last` are always present.
    - `first` string, required — The url of the first page for the paginated results set
    - `next` string, nullable, required — The url of the next page for the paginated results set
    - `prev` string, nullable, required — The url of the previous page for the paginated results set
    - `last` string, required — The url of the last page for the paginated results set

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `404` — The resource couldn't be found
- `422` — The request didn't pass validation

---

[API](https://skmtc.dev/try/apis/trybe-api.md) · [All operations](https://skmtc.dev/try/apis/trybe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/try/trybe-api/revisions/f37f92702da5/schema)
