> For the complete documentation index, see [llms.txt](https://developers.bead.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.bead.xyz/entity-management/location-management/delete-location.md).

# Delete Location

Permanently removes a location and its metadata from Bead. Deletion succeeds only when the location has no terminals.

#### Endpoint

`DELETE /Locations/{id}`

#### Path parameters

| Name | Type   | Required | Description                           |
| ---- | ------ | -------- | ------------------------------------- |
| `id` | string | Yes      | The `locationId` you intend to delete |

#### Request headers

| Header      | Value              |
| ----------- | ------------------ |
| `X-Api-Key` | `{adminApiKey}`    |
| `Accept`    | `application/json` |

#### Example request

```bash
curl -X DELETE "https://api.test.devs.beadpay.io/Locations/{locationId}" \
     -H "X-Api-Key: {adminApiKey}"
```

#### Successful response

`204 No Content` — no response body is returned.

#### Before you delete

Before deleting a location, disable it with `PUT /Locations/{id}/enabled` to stop new payment activity while preserving history. Delete only once you have confirmed no active terminals remain.

If you may need the location again later, disabling is the better option — the record and its history cannot be retrieved after deletion.

#### Error responses

| Code | Condition                                                                                                             |
| ---- | --------------------------------------------------------------------------------------------------------------------- |
| 400  | Invalid request or business rule violation — common cause is attempting to delete a location that still has terminals |
| 401  | Missing or invalid API key                                                                                            |
| 403  | Not permitted to delete this location                                                                                 |
| 404  | Location `{id}` does not exist or is not visible to your key                                                          |

#### Best practices

* Disable every terminal under the location before attempting deletion.
* Use `GET /Locations/{id}` to confirm the `terminals` array is empty before calling delete.
* Archive the location details in your own system first — the record cannot be retrieved after deletion.
* Perform deletes during low-traffic windows to reduce the risk of concurrent provisioning.

#### Related pages

* [Update Location](/entity-management/location-management/update-location.md)
* [Get Location](/entity-management/location-management/get-location.md)
* [Delete Terminal](/entity-management/terminal-management/delete-terminal.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://developers.bead.xyz/entity-management/location-management/delete-location.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.
