POST /api/Hotels

Sample request:

POST /hotels { "name": "Hotel Budapest", "owner": "Hungarian Hotels Ltd.", "street": "King lu, 19 st." "latitude": "15.9", "longitude": "20.5", "cityId": "{cityId}" "starRate" : "4" }

Body

The data for the new hotel

  • cityId string(uuid)

    Id of the city where the hotel is located

  • name string | null

    Name of the hotel

  • owner string | null

    Owner of the hotel

  • starRate integer(int32)

    Star Rate of the hotel

  • street string | null

    Street of the hotel

  • latitude number(double)

    Latitude for the hotel

  • longitude number(double)

    Longitude for the hotel

  • checkInTime string(time)

    Check in time for the hotel (default is 14:00)

  • checkOutTime string(time)

    Check out time for the hotel (default is 11:00)

  • Additional properties are NOT allowed

Body

The data for the new hotel

  • cityId string(uuid)

    Id of the city where the hotel is located

  • name string | null

    Name of the hotel

  • owner string | null

    Owner of the hotel

  • starRate integer(int32)

    Star Rate of the hotel

  • street string | null

    Street of the hotel

  • latitude number(double)

    Latitude for the hotel

  • longitude number(double)

    Longitude for the hotel

  • checkInTime string(time)

    Check in time for the hotel (default is 14:00)

  • checkOutTime string(time)

    Check out time for the hotel (default is 11:00)

  • Additional properties are NOT allowed

Body

The data for the new hotel

  • cityId string(uuid)

    Id of the city where the hotel is located

  • name string | null

    Name of the hotel

  • owner string | null

    Owner of the hotel

  • starRate integer(int32)

    Star Rate of the hotel

  • street string | null

    Street of the hotel

  • latitude number(double)

    Latitude for the hotel

  • longitude number(double)

    Longitude for the hotel

  • checkInTime string(time)

    Check in time for the hotel (default is 14:00)

  • checkOutTime string(time)

    Check out time for the hotel (default is 11:00)

  • 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)
    • name string | null
    • owner string | null
    • starRate integer(int32)
    • roomsNumber integer(int32)
    • Additional properties are NOT allowed
    Hide response attributes Show response attributes object
    • id string(uuid)
    • creationDate string(date-time)
    • lastModified string(date-time)
    • name string | null
    • owner string | null
    • starRate integer(int32)
    • roomsNumber integer(int32)
    • Additional properties are NOT allowed
    Hide response attributes Show response attributes object
    • id string(uuid)
    • creationDate string(date-time)
    • lastModified string(date-time)
    • name string | null
    • owner string | null
    • starRate integer(int32)
    • roomsNumber integer(int32)
    • Additional properties are NOT allowed
  • 201

    Returns the newly created hotel

  • 400

    If the request data is invalid

  • 401

    If the user is not authenticated

  • 403

    If the user is not authorized (not an admin)

POST /api/Hotels
curl \
 -X POST http://api.example.com/api/Hotels \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"cityId":"string","name":"string","owner":"string","starRate":42,"street":"string","latitude":42.0,"longitude":42.0,"checkInTime":"13:45:42.0000000","checkOutTime":"13:45:42.0000000"}'
curl \
 -X POST http://api.example.com/api/Hotels \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: text/json"
curl \
 -X POST http://api.example.com/api/Hotels \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/*+json"
Request example
{
  "cityId": "string",
  "name": "string",
  "owner": "string",
  "starRate": 42,
  "street": "string",
  "latitude": 42.0,
  "longitude": 42.0,
  "checkInTime": "13:45:42.0000000",
  "checkOutTime": "13:45:42.0000000"
}
Request examples
{
  "cityId": "string",
  "name": "string",
  "owner": "string",
  "starRate": 42,
  "street": "string",
  "latitude": 42.0,
  "longitude": 42.0,
  "checkInTime": "13:45:42.0000000",
  "checkOutTime": "13:45:42.0000000"
}
Request examples
{
  "cityId": "string",
  "name": "string",
  "owner": "string",
  "starRate": 42,
  "street": "string",
  "latitude": 42.0,
  "longitude": 42.0,
  "checkInTime": "13:45:42.0000000",
  "checkOutTime": "13:45:42.0000000"
}
Response examples (200)
{
  "id": "string",
  "creationDate": "2024-05-04T09:42:00+00:00",
  "lastModified": "2024-05-04T09:42:00+00:00",
  "name": "string",
  "owner": "string",
  "starRate": 42,
  "roomsNumber": 42
}
Response examples (200)
{
  "id": "string",
  "creationDate": "2025-05-04T09:42:00Z",
  "lastModified": "2025-05-04T09:42:00Z",
  "name": "string",
  "owner": "string",
  "starRate": 42,
  "roomsNumber": 42
}