POST /api/Rooms

Sample request:

POST /rooms { "hotelId": "{hotelId}", "roomNumber": "101", "adultsCapacity": 2, "childrenCapacity": 1, "price": 100, "roomType": "Standard" }

Body

The data for the new room

  • hotelId string(uuid)

    Id of the hotel where the room is located

  • 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

  • roomType string

    Values are Standard, Luxury, Budget, or Boutique.

  • price number(double)

    Current price of the room

  • Additional properties are NOT allowed

Body

The data for the new room

  • hotelId string(uuid)

    Id of the hotel where the room is located

  • 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

  • roomType string

    Values are Standard, Luxury, Budget, or Boutique.

  • price number(double)

    Current price of the room

  • Additional properties are NOT allowed

Body

The data for the new room

  • hotelId string(uuid)

    Id of the hotel where the room is located

  • 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

  • roomType string

    Values are Standard, Luxury, Budget, or Boutique.

  • price number(double)

    Current price 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
  • 201

    Returns the newly created room

  • 401

    If the user is not authenticated

  • 403

    If the user is not authorized (not an admin)

  • 400

    If the request data is invalid

POST /api/Rooms
curl \
 -X POST http://api.example.com/api/Rooms \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"hotelId":"string","roomNumber":42,"adultsCapacity":42,"childrenCapacity":42,"roomType":"Standard","price":42.0}'
curl \
 -X POST http://api.example.com/api/Rooms \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: text/json"
curl \
 -X POST http://api.example.com/api/Rooms \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/*+json"
Request example
{
  "hotelId": "string",
  "roomNumber": 42,
  "adultsCapacity": 42,
  "childrenCapacity": 42,
  "roomType": "Standard",
  "price": 42.0
}
Request examples
{
  "hotelId": "string",
  "roomNumber": 42,
  "adultsCapacity": 42,
  "childrenCapacity": 42,
  "roomType": "Standard",
  "price": 42.0
}
Request examples
{
  "hotelId": "string",
  "roomNumber": 42,
  "adultsCapacity": 42,
  "childrenCapacity": 42,
  "roomType": "Standard",
  "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"
}