> ## Documentation Index
> Fetch the complete documentation index at: https://docs.series.hr/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign Room

> Assign a hotel room to a user

Assign a room to a user. If `RoomNumber` is `null` or omitted, the API randomly selects an available room from the requested type.

## Request

```bash theme={null}
curl -X POST https://api.series.hr/hotel/assign-room \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "TargetUserId": "714760171",
    "RoomTypeId": "deluxe-suite",
    "RoomNumber": null
  }'
```

## Body

<ParamField body="TargetUserId" type="string" required>
  Roblox user ID or username to assign the room to.
</ParamField>

<ParamField body="RoomTypeId" type="string" required>
  The room type ID to assign from.
</ParamField>

<ParamField body="RoomNumber" type="string | null">
  Specific room number to assign, or `null` for a random available room.
</ParamField>

## Response

<ResponseField status={200} name="200">
  ```json theme={null}
  {
    "success": true,
    "data": {
      "WorkspaceId": "a7d5339a-5531-4336-99c6-6f3249c9ac20",
      "RoomNumber": "204",
      "Action": "assign",
      "Room": {
        "RoomNumber": "204",
        "TypeId": "deluxe-suite",
        "Floor": 2,
        "Status": "occupied"
      },
      "Rooms": []
    }
  }
  ```
</ResponseField>

## Status Codes

* `200`: Room assigned successfully
* `400`: Invalid input, no available rooms, or gamepass check failed
* `401`: API key is required or invalid
* `403`: Hotel module is disabled or workspace access is denied
