---
title: "Edit City"
description: "Use PUT /countries/{country}/cities/{city} to update one city within a country."
canonical: https://docs.ordering.co/api-reference/guides/update-city/
---

# Edit City

> **API operation:** [Open the endpoint in Scalar](https://docs.ordering.co/api-reference/#tag/countries/PUT/countries/{country}/cities/{city})

Use `PUT /countries/{country}/cities/{city}` to update one city within a country. The current public operation is `City.update`.

Access is restricted to role levels `0` and `1`. `country_id` is taken from the route, and the city must belong to that country. Update fields include `name`, `administrator_id`, and `enabled`.

## Legacy SDK example

```javascript
const response = await ordering.countries(countryId).cities(cityId).save(changes)
```

Confirm the SDK package and version before using this historical example.

## OpenAPI reference

**Operation:** `PUT /countries/{country}/cities/{city}`

**Path parameters**

| Name      | Type    | Required | Description |
| --------- | ------- | -------- | ----------- |
| `country` | integer | Yes      | —           |
| `city`    | integer | Yes      | —           |

**Request body fields**

| Name               | Type            | Required |
| ------------------ | --------------- | -------- |
| `administrator_id` | integer \| null | No       |
| `country_id`       | integer         | No       |
| `enabled`          | boolean         | No       |
| `name`             | any             | No       |

**Responses**

| Code | Description                           |
| ---- | ------------------------------------- |
| 200  | OK (Envelope)                         |
| 400  | Bad Request (ErrorResponse)           |
| 401  | Unauthorized                          |
| 404  | Not Found                             |
| 429  | Too Many Requests (ErrorResponse)     |
| 500  | Internal Server Error (ErrorResponse) |
| 503  | Service Unavailable (ErrorResponse)   |

[Open this operation in the API reference](https://docs.ordering.co/api-reference/#tag/countries/PUT/countries/{country}/cities/{city})
