# Update a Saved Location

## Update (replace) a Saved Location

> Fully replace an existing Saved Location. This is a PUT (full replacement) — all fields should be provided, not just the ones being changed.\
> \
> To trigger a recalculation of the Predicted Impact Area, provide \`origin\_geojson\` without specifying \`geojson\`, the same as when creating a location.

````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":{"CreateSavedLocationRequest":{"description":"The request body for creating a new Saved Location. Provide location geometry via `origin_geojson` (recommended), `geojson`, or `place_ids`.","type":"object","properties":{"location_code":{"description":"An optional identifier for your location.\n\n\nThe intention here is to use your own identifier for the location if you have one. \nE.g., you might have stores/hotels/etc in your system with their own ID \n- use that ID here to make it easier to lookup the location later.","type":"string","title":"Location Code"},"name":{"description":"Name of the Saved Location.\n\nE.g. `My Location`","type":"string","title":"Name"},"description":{"description":"Description of the location.","type":"string","title":"Description"},"labels":{"description":"A list of labels to help you categorize your locations.\nYou can use these labels to search upon.\n\n\n**E.g.**\n  ```json\n    {\n      \"labels\": [\"label1\", \"label2\"]\n    }\n  ```","type":"array","items":{"type":"string"},"title":"Labels"},"geojson":{"description":"We recommend omitting this parameter and providing only the `origin_geojson` field instead.\nThis allows PredictHQ to automatically calculate and store a Predicted Impact Area for the location,\nwhich provides a more accurate representation of event impact than a manually specified area.\n\nOnly use `geojson` if you need to define a specific area.\nFor Point geometry types, a radius is required using the `radius` and `radius_unit` properties.\nThe radius must be an integer or a float up to 2 decimal places.\n\nNote: GeoJSON coordinates are ordered longitude then latitude.","$ref":"#/components/schemas/GeoJson-Input"},"place_ids":{"description":"You can define the geolocation of the Saved Location either by GeoJSON or Place IDs.\n\nThe Place IDs option is typically used when the location covers an entire city, county, state or country.\n\nUse our [Places API](https://docs.predicthq.com/api/places/search-places) to search for the correct Place ID.","type":"array","items":{"type":"integer"},"title":"Place Ids"},"formatted_address":{"description":"The street address of the location.","type":"string","title":"Formatted Address"},"industry":{"description":"The industry of your business. This is used to calculate the Impact Area for your location when you specify\nthe `origin_geojson` field.","$ref":"#/components/schemas/Industry"},"origin_geojson":{"description":"Defines the exact location of your business. This is different from `geojson`,\nwhich defines the area around your business used to scope event searches.\n\nWe recommend providing `origin_geojson` without specifying `geojson` or `place_ids`.\nPredictHQ will automatically calculate a Predicted Impact Area for the location and store it\nin the `geojson` field.\n\nNote: GeoJSON coordinates are ordered longitude then latitude.\nRefer to our [Predicted Impact Area](https://docs.predicthq.com/api/impact-area/get-impact-area)\ndocumentation for more details.","$ref":"#/components/schemas/OriginGeoJson"}},"title":"CreateSavedLocationRequest"},"GeoJson-Input":{"description":"A GeoJSON Feature representing the geographic area of a location. Supported geometry types are Point, Polygon, MultiPolygon, LineString, and MultiLineString.","type":"object","properties":{"type":{"description":"The GeoJSON object type. Always `Feature`.","type":"string","const":"Feature","title":"Type"},"properties":{"description":"Optional properties for the feature, such as radius and radius unit for Point geometries.","$ref":"#/components/schemas/Properties"},"geometry":{"description":"The geometry of the feature. Must be one of the supported geometry types.","discriminator":{"propertyName":"type","mapping":{"LineString":"#/components/schemas/LineString","MultiLineString":"#/components/schemas/MultiLineString","MultiPolygon":"#/components/schemas/MultiPolygon","Point":"#/components/schemas/Point","Polygon":"#/components/schemas/Polygon"}},"oneOf":[{"$ref":"#/components/schemas/Point"},{"$ref":"#/components/schemas/Polygon"},{"$ref":"#/components/schemas/MultiPolygon"},{"$ref":"#/components/schemas/LineString"},{"$ref":"#/components/schemas/MultiLineString"}],"title":"Geometry"}},"required":["type","geometry"],"title":"GeoJSON (Input)"},"Properties":{"description":"Custom properties for embedding the radius information","type":"object","properties":{"radius":{"description":"The radius around the Point geometry, defining the area of impact.","type":"number","title":"Radius"},"radius_unit":{"description":"The unit of measurement for the radius value.","$ref":"#/components/schemas/RadiusUnit"}},"title":"Properties"},"RadiusUnit":{"description":"The unit of the radius returned. This will be the unit specified in the radius_unit parameter in the call made.","type":"string","enum":["m","km","ft","mi"],"title":"RadiusUnit"},"Point":{"description":"A GeoJSON Point geometry. Coordinates are `[longitude, latitude]`.","type":"object","properties":{"type":{"description":"The geometry type. Always `Point`.","type":"string","default":"Point","const":"Point","title":"Type"},"coordinates":{"description":"The position as `[longitude, latitude]` or `[longitude, latitude, altitude]`.","anyOf":[{"prefixItems":[{"type":"number"},{"type":"number"}],"type":"array","maxItems":2,"minItems":2},{"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array","maxItems":3,"minItems":3}],"title":"Coordinates"}},"required":["coordinates"],"title":"Point"},"Polygon":{"description":"A GeoJSON Polygon geometry. The first ring is the outer boundary; subsequent rings are holes.","type":"object","properties":{"type":{"description":"The geometry type. Always `Polygon`.","type":"string","default":"Polygon","const":"Polygon","title":"Type"},"coordinates":{"description":"An array of linear rings. Each ring is an array of `[longitude, latitude]` positions where the first and last positions are identical.","type":"array","items":{"items":{"anyOf":[{"prefixItems":[{"type":"number"},{"type":"number"}],"type":"array","maxItems":2,"minItems":2},{"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array","maxItems":3,"minItems":3}]},"type":"array"},"title":"Coordinates"}},"required":["coordinates"],"title":"Polygon"},"MultiPolygon":{"description":"A GeoJSON MultiPolygon geometry containing multiple Polygon geometries.","type":"object","properties":{"type":{"description":"The geometry type. Always `MultiPolygon`.","type":"string","default":"MultiPolygon","const":"MultiPolygon","title":"Type"},"coordinates":{"description":"An array of Polygon coordinate arrays.","type":"array","items":{"items":{"items":{"anyOf":[{"prefixItems":[{"type":"number"},{"type":"number"}],"type":"array","maxItems":2,"minItems":2},{"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array","maxItems":3,"minItems":3}]},"type":"array"},"type":"array"},"title":"Coordinates"}},"required":["coordinates"],"title":"MultiPolygon"},"LineString":{"description":"A GeoJSON LineString geometry.","type":"object","properties":{"type":{"description":"The geometry type. Always `LineString`.","type":"string","default":"LineString","const":"LineString","title":"Type"},"coordinates":{"description":"An array of two or more positions.","type":"array","items":{"anyOf":[{"prefixItems":[{"type":"number"},{"type":"number"}],"type":"array","maxItems":2,"minItems":2},{"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array","maxItems":3,"minItems":3}]},"title":"Coordinates"}},"required":["coordinates"],"title":"LineString"},"MultiLineString":{"description":"A GeoJSON MultiLineString geometry containing multiple LineString geometries.","type":"object","properties":{"type":{"description":"The geometry type. Always `MultiLineString`.","type":"string","default":"MultiLineString","const":"MultiLineString","title":"Type"},"coordinates":{"description":"An array of LineString coordinate arrays.","type":"array","items":{"items":{"anyOf":[{"prefixItems":[{"type":"number"},{"type":"number"}],"type":"array","maxItems":2,"minItems":2},{"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array","maxItems":3,"minItems":3}]},"type":"array"},"title":"Coordinates"}},"required":["coordinates"],"title":"MultiLineString"},"Industry":{"description":"The industry classification of a business location.","type":"string","enum":["parking","restaurants","retail","accommodation","cpg","tourism","marketing","transportation","other"],"title":"Industry"},"OriginGeoJson":{"description":"A GeoJSON Feature with a Point geometry representing the exact origin location of a business.","type":"object","properties":{"type":{"description":"The GeoJSON object type. Always `Feature`.","type":"string","default":"Feature","const":"Feature","title":"Type"},"geometry":{"description":"A Point geometry defining the origin coordinates.","$ref":"#/components/schemas/Point"}},"additionalProperties":false,"required":["geometry"],"title":"OriginGeoJson"},"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}":{"put":{"operationId":"update_saved_location","summary":"Update (replace) a Saved Location","description":"Fully replace an existing Saved Location. This is a PUT (full replacement) — all fields should be provided, not just the ones being changed.\n\nTo trigger a recalculation of the Predicted Impact Area, provide `origin_geojson` without specifying `geojson`, the same as when creating a location.","parameters":[{"name":"location_id","in":"path","description":"An existing Saved Location ID.","required":true,"schema":{"type":"string","title":"Location Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSavedLocationRequest"}}}},"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

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

```bash
curl --location --request PUT 'https://api.predicthq.com/v1/saved-locations/5BcRstnNPjXl-fiB_0TQJg' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer TOKEN' \
--data '{
    "name": "S Las Vegas Blvd, Las Vegas (NV), US",
    "labels": [],
    "geojson": {
        "type": "Feature",
        "properties": {
            "radius": 1,
            "radius_unit": "mi"
        },
        "geometry": {
            "type": "Point",
            "coordinates": [
                -115.1728484,
                36.1147065
            ]
        }
    }
}'
```

{% endtab %}

{% tab title="python" %}

```python
import requests
import json

url = "https://api.predicthq.com/v1/saved-locations/5BcRstnNPjXl-fiB_0TQJg"

payload = json.dumps({
  "name": "S Las Vegas Blvd, Las Vegas (NV), US",
  "labels": [],
  "geojson": {
    "type": "Feature",
    "properties": {
      "radius": 1,
      "radius_unit": "mi"
    },
    "geometry": {
      "type": "Point",
      "coordinates": [
        -115.1728484,
        36.1147065
      ]
    }
  }
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer TOKEN'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}

## OpenAPI Spec

The OpenAPI spec for Saved Locations API can be [found here](https://api.predicthq.com/docs/?urls.primaryName=Saved+Locations+API).

## Guides

Below are some guides 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
