> For the complete documentation index, see [llms.txt](https://docs.predicthq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.predicthq.com/api/saved-locations/delete-a-saved-location.md).

# Delete a Saved Location

Delete an existing Saved Location.

## Delete a Saved Location

> Permanently delete a saved location by ID. This action is irreversible — the location and all associated insights data will be removed.

```json
{"openapi":"3.1.0","info":{"title":"PredictHQ Saved Locations API","version":"1.0.0"},"tags":[{"name":"Saved Locations API"}],"servers":[{"url":"https://api.predicthq.com"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"$API_KEY","description":"Enter your PredictHQ API key. The Bearer prefix is added automatically.\n\nWhen calling the API directly, send: `Authorization: Bearer <YOUR_API_KEY>` as documented at [https://docs.predicthq.com/api/overview/authenticating](https://docs.predicthq.com/api/overview/authenticating)\n"}},"schemas":{"HTTPValidationError":{"description":"A validation error response containing field-level error details.","type":"object","properties":{"error":{"description":"A summary error message.","type":"string"},"details":{"description":"A list of field-level validation errors.","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}},"title":"HTTPValidationError"},"ValidationError":{"description":"A single field-level validation error.","type":"object","properties":{"field":{"description":"The field path that caused the error.","type":"string"},"msg":{"description":"A human-readable error message.","type":"string","title":"Message"},"type":{"description":"The type of validation error.","type":"string","title":"Error Type"}},"title":"ValidationError"},"ErrorResponse":{"description":"An error response containing a human-readable error message.","type":"object","properties":{"error":{"description":"Error message","type":"string","title":"Error"}},"required":["error"],"title":"ErrorResponse"}}},"paths":{"/v1/saved-locations/{location_id}":{"delete":{"operationId":"delete_saved_location","summary":"Delete a Saved Location","description":"Permanently delete a saved location by ID. This action is irreversible — the location and all associated insights data will be removed.","parameters":[{"name":"location_id","in":"path","description":"An existing Saved Location ID.","required":true,"schema":{"type":"string","title":"Location Id"}}],"responses":{"204":{"description":"Successful Response"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Saved Locations API"]}}}}
```

## Examples

The following examples delete a Saved Location by its ID:

{% tabs %}
{% tab title="curl" %}

```bash
curl -X DELETE "https://api.predicthq.com/v1/saved-locations/$LOCATION_ID" \
     -H "Authorization: Bearer $API_TOKEN"
```

{% endtab %}

{% tab title="python" %}

```python
import requests

response = requests.delete(
    url="https://api.predicthq.com/v1/saved-locations/$LOCATION_ID",
    headers={
      "Authorization": "Bearer $API_TOKEN"
    }
)

print(response.status_code)
```

{% endtab %}
{% endtabs %}

## OpenAPI spec

See the [OpenAPI spec for the Saved Locations API](https://api.predicthq.com/docs/?urls.primaryName=Saved+Locations+API).

## Guides

These guides are relevant to this API:

* [Working with location-based subscriptions](/getting-started/guides/geolocation-guides/searching-by-location/working-with-location-based-subscriptions.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.predicthq.com/api/saved-locations/delete-a-saved-location.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
