> For the complete documentation index, see [llms.txt](https://docs.netmap.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.netmap.dev/using-netmap/locations.md).

# Locations

Locations are represented as sites and can be attached to devices.

API equivalents:

* `GET /api/v1/topology/sites`
* `POST /api/v1/topology/sites`
* `PATCH /api/v1/topology/sites/{site_id}`
* `DELETE /api/v1/topology/sites/{site_id}`

Write actions require `topology_write`.

## When To Use Locations

Use locations when the same NetMap instance tracks devices across multiple places or logical sites. Locations make topology and inventory easier to filter and understand.

Examples:

* home lab rack;
* branch office;
* data closet;
* cloud/VPN segment;
* customer site;
* floor or building.

## Workflow

1. Open Locations.
2. Create a site with a clear name.
3. Add optional metadata where the UI exposes it.
4. Assign devices to the site from device details, inventory, topology, or bulk actions.
5. Use the site context when reading topology and inventory.

## API Usage

```bash
API_URL="https://netmap.example.com"
API_KEY="<api-key>"

curl --fail-with-body \
  --url "${API_URL}/api/v1/topology/sites" \
  --header "X-API-Key: ${API_KEY}"
```

## Common Problems

| Symptom                        | Cause                    | Fix                            |
| ------------------------------ | ------------------------ | ------------------------------ |
| cannot create site             | missing `topology_write` | update role permissions        |
| site does not appear on device | device not assigned      | edit device or use bulk update |
| API returns `404` on update    | wrong site ID            | list sites and retry           |

## Related Pages

* [Topology](/using-netmap/topology.md)
* [Inventory](/using-netmap/inventory.md)
* [VLANs And Groups](/using-netmap/vlans.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.netmap.dev/using-netmap/locations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
