## Create a location `POST https://getkollek.com/api/locations` Create a location, optionally nested under another one. **Permissions:** Owners and editors. Viewers get a 404 response. ### Body parameters - `name` (string, required): The name of the location. Maximum 255 characters. - `parent_id` (integer, optional): The ID of the parent location, for nesting. Must belong to your account. - `emoji` (string, optional): The emoji shown next to the location name. One of 📦, 🏠, 🚪, 🛋️, 🗄️, 📚, 🧰, 🏢, 🚗, 🗃️, 🖼️ or 🎁. **Returns:** The created location object. ### Example request ```bash curl https://getkollek.com/api/locations \ -X POST \ -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: 201` ```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" } } } ```