## Update a location `PUT https://getkollek.com/api/locations/{location}` Update the name, parent and emoji of a location. Moves that would create a cycle are rejected with a 422 response: a location cannot be its own parent, or be nested under one of its own descendants. **Permissions:** Owners and editors. Viewers get a 404 response. ### Path parameters - `location` (integer, required): The ID of the location. ### Body parameters - `name` (string, required): The name of the location. Maximum 255 characters. - `parent_id` (integer, optional): The ID of the parent location. Omit it or send null to move the location to the top level. - `emoji` (string, optional): The emoji shown next to the location name. One of 📦, 🏠, 🚪, 🛋️, 🗄️, 📚, 🧰, 🏢, 🚗, 🗃️, 🖼️ or 🎁. **Returns:** The updated location object. ### Example request ```bash curl https://getkollek.com/api/locations/2 \ -X PUT \ -H "Authorization: Bearer $API_KEY" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "name": "Box 1", "parent_id": 1, "emoji": "📦" }' ``` ### Example response `Status: 200` ```json { "data": { "type": "location", "id": "2", "attributes": { "name": "Box 1", "emoji": "📦", "parent_id": "1", "created_at": 1752537600, "updated_at": 1752537600 }, "links": { "self": "https://getkollek.com/api/locations/2" } } } ```