---
title: "Group rooms into reference buckets"
method: POST
path: "/rooms/group/with-reference"
tags: ["Room Group"]
---

# Group rooms into reference buckets

`POST /rooms/group/with-reference`

## Request

- Base URL: `https://api.liteapi.travel/v3.0`
- URL: `https://api.liteapi.travel/v3.0/rooms/group/with-reference`
- Auth: API key in header `X-API-Key`

**What it does:** Assigns each supplier room to **one reference bucket**.

**Workflow role:** Alternate **sync** view (not step 0 of the main flow).

**Use when:** You want reference-centric grouping instead of per-supplier scores.

**Do not use when:** You need ranked candidates or async persistence.

Details, examples, limits, and result codes: **Implementation Workflow** (doc page: `implementation-workflow`).

## Request body

- object
  - `hotelId` string, nullable: Correlation ID echoed in the response
  - `chunkKey` string, nullable: Batch/chunk ID for large jobs
  - `threshold` number: Minimum score to attach a supplier to a reference group
  - `references` ReferenceRoom[], required: Reference room buckets
    - `id` union, required: Reference room identifier
      - string
      - integer
    - `name` string, required: Reference room title
  - `suppliers` SupplierRoom[], required: Supplier rooms to assign
    - `i` integer, required: Supplier row index (stable within the request)
    - `name` string, required: Supplier room title

## Response `200`

OK

- object
  - `data` object
    - `hotelId` string, nullable
    - `supplier_assignment` string
    - `model_version` string
    - `groups` object[]
      - `reference_id` union
        - string
        - integer
      - `reference` string
      - `match_count` integer
      - `matches` object[]
    - `unmatched_suppliers` object[]

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `500`: Internal Server Error

---

[API](https://skmtc.dev/liteapi/apis/api-mapping.md) - [All operations](https://skmtc.dev/liteapi/apis/api-mapping/llms.txt) - [OpenAPI document](https://skmtc.dev/liteapi/apis/api-mapping/revisions/82f8d27a93af?raw)
