Skip to content

Locations API

Manage storage locations.

Get all locations with item counts.

GET /api/locations
{
"locations": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Office",
"description": "Main office area",
"_count": {
"items": 12
}
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"name": "Garage",
"description": "Storage area in garage",
"_count": {
"items": 25
}
}
]
}

Add a new location.

POST /api/locations
{
"name": "Garage Shelf A",
"description": "Top shelf in the garage"
}
Field Type Required Description
name string Yes Location name (unique)
description string No Additional details
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Garage Shelf A",
"description": "Top shelf in the garage"
}
Code Message
400 Location already exists

Modify an existing location.

PUT /api/locations/[id]
{
"name": "Garage - Shelf A",
"description": "Updated description"
}

Returns the updated location.


Remove a location.

DELETE /api/locations/[id]
{
"success": true
}

Note: Items Not Deleted Deleting a location does not delete its items. Items will have no assigned location.


Consider using hierarchical naming for complex storage:

Building > Room > Area > Specific Location
Name Description
Home > Garage > Shelf A Specific shelf
Office > Desk > Drawer 1 Office desk drawer
Storage Unit 42 External storage
Bedroom Closet Simple location