---
updatedAt: 2026-09-18T12:28:54.000Z
agentTools:
  projectIndex: https://docs.nuitee.com/llms.txt
---

# Group rooms into reference buckets

**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`).

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "API: Mapping",
    "version": "3.0.0",
    "description": "Hotel and room mapping APIs. Map partner hotel IDs to LiteAPI catalogue hotels, and map or group supplier room names against your room catalog. Room matching: **Implementation Workflow** (`implementation-workflow`)."
  },
  "servers": [
    {
      "url": "https://api.liteapi.travel/v3.0"
    }
  ],
  "security": [
    {
      "apikeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "apikeyAuth": {
        "name": "X-API-Key",
        "type": "apiKey",
        "in": "header"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable error message",
            "example": "partner is required"
          }
        }
      },
      "ReferenceRoom": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ],
            "description": "Reference room identifier",
            "example": "ref-1"
          },
          "name": {
            "type": "string",
            "description": "Reference room title",
            "example": "King Room"
          }
        }
      },
      "SupplierRoom": {
        "type": "object",
        "required": [
          "i",
          "name"
        ],
        "properties": {
          "i": {
            "type": "integer",
            "description": "Supplier row index (stable within the request)",
            "example": 0
          },
          "name": {
            "type": "string",
            "description": "Supplier room title",
            "example": "Deluxe King"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Room Group",
      "description": "Cluster supplier names with or without a catalog. See **Implementation Workflow**."
    }
  ],
  "paths": {
    "/rooms/group/with-reference": {
      "post": {
        "tags": [
          "Room Group"
        ],
        "summary": "Group rooms into reference buckets",
        "operationId": "post_rooms-group-with-reference",
        "description": "**What it does:** Assigns each supplier room to **one reference bucket**.\n\n**Workflow role:** Alternate **sync** view (not step 0 of the main flow).\n\n**Use when:** You want reference-centric grouping instead of per-supplier scores.\n\n**Do not use when:** You need ranked candidates or async persistence.\n\nDetails, examples, limits, and result codes: **Implementation Workflow** (doc page: `implementation-workflow`).",
        "security": [
          {
            "apikeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "references",
                  "suppliers"
                ],
                "x-examples": {
                  "Example 1": {
                    "hotelId": "hotel-1",
                    "chunkKey": "chunk-1",
                    "threshold": 0.8,
                    "references": [
                      {
                        "id": "ref-1",
                        "name": "room, 1 king bed, balcony guest"
                      },
                      {
                        "id": "ref-2",
                        "name": "room, 1 king bed, city view"
                      },
                      {
                        "id": "ref-3",
                        "name": "room, 2 twin beds, city view"
                      }
                    ],
                    "suppliers": [
                      {
                        "i": 0,
                        "name": "standard king room with balcony"
                      },
                      {
                        "i": 1,
                        "name": "deluxe king room city view"
                      },
                      {
                        "i": 2,
                        "name": "city view room twin beds"
                      },
                      {
                        "i": 3,
                        "name": "suite ocean view"
                      }
                    ]
                  }
                },
                "properties": {
                  "hotelId": {
                    "type": "string",
                    "nullable": true,
                    "description": "Correlation ID echoed in the response",
                    "example": "hotel-1"
                  },
                  "chunkKey": {
                    "type": "string",
                    "nullable": true,
                    "description": "Batch/chunk ID for large jobs",
                    "example": "chunk-1"
                  },
                  "threshold": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0.8,
                    "description": "Minimum score to attach a supplier to a reference group",
                    "example": 0.8
                  },
                  "references": {
                    "type": "array",
                    "minItems": 1,
                    "description": "Reference room buckets",
                    "items": {
                      "$ref": "#/components/schemas/ReferenceRoom"
                    }
                  },
                  "suppliers": {
                    "type": "array",
                    "minItems": 1,
                    "description": "Supplier rooms to assign",
                    "items": {
                      "$ref": "#/components/schemas/SupplierRoom"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "hotelId": {
                          "type": "string",
                          "nullable": true,
                          "example": "hotel-1"
                        },
                        "supplier_assignment": {
                          "type": "string",
                          "example": "best_reference_exclusive"
                        },
                        "model_version": {
                          "type": "string"
                        },
                        "groups": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "reference_id": {
                                "oneOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "integer"
                                  }
                                ]
                              },
                              "reference": {
                                "type": "string"
                              },
                              "match_count": {
                                "type": "integer"
                              },
                              "matches": {
                                "type": "array",
                                "items": {
                                  "type": "object"
                                }
                              }
                            }
                          }
                        },
                        "unmatched_suppliers": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true,
    "apply-tag-changes": true
  }
}
```