POST /api/Cities

Sample request:

POST /cities { "name": "Budapest", "country": "Hungary", "postOffice": "10543" }

Body

The data for the new city

  • name string | null

    Name of the City

  • country string | null

    Country of the City

  • postOffice string | null

    Post Office of the City

  • Additional properties are NOT allowed

Body

The data for the new city

  • name string | null

    Name of the City

  • country string | null

    Country of the City

  • postOffice string | null

    Post Office of the City

  • Additional properties are NOT allowed

Body

The data for the new city

  • name string | null

    Name of the City

  • country string | null

    Country of the City

  • postOffice string | null

    Post Office of the City

  • 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
    • country string | null
    • postOffice string | null
    • numberOfHotels 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
    • country string | null
    • postOffice string | null
    • numberOfHotels 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
    • country string | null
    • postOffice string | null
    • numberOfHotels integer(int32)
    • Additional properties are NOT allowed
  • 201

    Returns the newly created city

  • 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/Cities
curl \
 -X POST http://api.example.com/api/Cities \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"name":"string","country":"string","postOffice":"string"}'
curl \
 -X POST http://api.example.com/api/Cities \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: text/json"
curl \
 -X POST http://api.example.com/api/Cities \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/*+json"
Request example
{
  "name": "string",
  "country": "string",
  "postOffice": "string"
}
Request examples
{
  "name": "string",
  "country": "string",
  "postOffice": "string"
}
Request examples
{
  "name": "string",
  "country": "string",
  "postOffice": "string"
}
Response examples (200)
{
  "id": "string",
  "creationDate": "2024-05-04T09:42:00+00:00",
  "lastModified": "2024-05-04T09:42:00+00:00",
  "name": "string",
  "country": "string",
  "postOffice": "string",
  "numberOfHotels": 42
}
Response examples (200)
{
  "id": "string",
  "creationDate": "2025-05-04T09:42:00Z",
  "lastModified": "2025-05-04T09:42:00Z",
  "name": "string",
  "country": "string",
  "postOffice": "string",
  "numberOfHotels": 42
}