PUT /api/Rooms/{id}

Sample request:

PUT /rooms/{roomId} { "roomNumber": "101", "adultsCapacity": 2, "childrenCapacity": 1, "price": 100 }

Path parameters

  • id string(uuid) Required

    The id of the room to update

Body

The new data for the room

  • roomNumber integer(int32)

    Number of the room in the hotel

  • adultsCapacity integer(int32)

    Adults capacity of the room

  • childrenCapacity integer(int32)

    Children capacity of the room

  • price number(double)

    Price per night of the room

  • Additional properties are NOT allowed

Body

The new data for the room

  • roomNumber integer(int32)

    Number of the room in the hotel

  • adultsCapacity integer(int32)

    Adults capacity of the room

  • childrenCapacity integer(int32)

    Children capacity of the room

  • price number(double)

    Price per night of the room

  • Additional properties are NOT allowed

Body

The new data for the room

  • roomNumber integer(int32)

    Number of the room in the hotel

  • adultsCapacity integer(int32)

    Adults capacity of the room

  • childrenCapacity integer(int32)

    Children capacity of the room

  • price number(double)

    Price per night of the room

  • Additional properties are NOT allowed

Responses

  • Success

    Hide response attributes Show response attributes object
    • id string(uuid)
    • creationDate string(date-time)
    • lastModified string(date-time)
    • roomNumber integer(int32)
    • roomType string

      Values are Standard, Luxury, Budget, or Boutique.

    • adultsCapacity integer(int32)
    • childrenCapacity integer(int32)
    • hotelName string | null
    • Additional properties are NOT allowed
    Hide response attributes Show response attributes object
    • id string(uuid)
    • creationDate string(date-time)
    • lastModified string(date-time)
    • roomNumber integer(int32)
    • roomType string

      Values are Standard, Luxury, Budget, or Boutique.

    • adultsCapacity integer(int32)
    • childrenCapacity integer(int32)
    • hotelName string | null
    • Additional properties are NOT allowed
    Hide response attributes Show response attributes object
    • id string(uuid)
    • creationDate string(date-time)
    • lastModified string(date-time)
    • roomNumber integer(int32)
    • roomType string

      Values are Standard, Luxury, Budget, or Boutique.

    • adultsCapacity integer(int32)
    • childrenCapacity integer(int32)
    • hotelName string | null
    • Additional properties are NOT allowed
  • 204

    If the room is successfully updated

  • 400

    If the request data is invalid

  • 401

    If the user is not authenticated

  • 403

    If the user is not authorized (not an admin)

  • 404

    If the room is not found

PUT /api/Rooms/{id}
curl \
 -X PUT http://api.example.com/api/Rooms/{id} \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"roomNumber":42,"adultsCapacity":42,"childrenCapacity":42,"price":42.0}'
curl \
 -X PUT http://api.example.com/api/Rooms/{id} \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: text/json"
curl \
 -X PUT http://api.example.com/api/Rooms/{id} \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/*+json"
Request example
{
  "roomNumber": 42,
  "adultsCapacity": 42,
  "childrenCapacity": 42,
  "price": 42.0
}
Request examples
{
  "roomNumber": 42,
  "adultsCapacity": 42,
  "childrenCapacity": 42,
  "price": 42.0
}
Request examples
{
  "roomNumber": 42,
  "adultsCapacity": 42,
  "childrenCapacity": 42,
  "price": 42.0
}
Response examples (200)
{
  "id": "string",
  "creationDate": "2024-05-04T09:42:00+00:00",
  "lastModified": "2024-05-04T09:42:00+00:00",
  "roomNumber": 42,
  "roomType": "Standard",
  "adultsCapacity": 42,
  "childrenCapacity": 42,
  "hotelName": "string"
}
Response examples (200)
{
  "id": "string",
  "creationDate": "2025-05-04T09:42:00Z",
  "lastModified": "2025-05-04T09:42:00Z",
  "roomNumber": 42,
  "roomType": "Standard",
  "adultsCapacity": 42,
  "childrenCapacity": 42,
  "hotelName": "string"
}