For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update a Saved Location

Update (replace) an existing Saved Location.

Update (replace) a Saved Location

put

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.

Authorizations
AuthorizationstringRequired

Enter your PredictHQ API key. The Bearer prefix is added automatically.

When calling the API directly, send: Authorization: Bearer <YOUR_API_KEY> as documented at https://docs.predicthq.com/api/overview/authenticating

Path parameters
location_idstringRequired

An existing Saved Location ID.

Body

The request body for creating a new Saved Location. Provide location geometry via origin_geojson (recommended), geojson, or place_ids.

place_idsinteger[]Optional

You can define the geolocation of the Saved Location either by GeoJSON or Place IDs.

The Place IDs option is typically used when the location covers an entire city, county, state or country.

Use our Places API to search for the correct Place ID.

industrystring · enumOptional

The industry of your business. This is used to calculate the Impact Area for your location when you specify the origin_geojson field.

Possible values:
location_codestring · max: 200Optional

An optional identifier for your location.

The intention here is to use your own identifier for the location if you have one. E.g., you might have stores/hotels/etc in your system with their own ID

  • use that ID here to make it easier to lookup the location later.
namestring · max: 200Optional

Name of the Saved Location.

E.g. My Location

Example: My Location
descriptionstring · max: 500Optional

Description of the location.

labelsstring[] · max: 50Optional

A list of labels to help you categorize your locations. You can use these labels to search upon.

E.g.

  {
    "labels": ["label1", "label2"]
  }
Example: test
formatted_addressstring · max: 500Optional

The street address of the location.

Responses
204

Successful Response

No content

put/v1/saved-locations/{location_id}
PUT /v1/saved-locations/{location_id} HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 409

{
  "geojson": {
    "type": "Feature",
    "properties": {
      "radius": 3.17,
      "radius_unit": "mi"
    },
    "geometry": {
      "type": "Point",
      "coordinates": [
        -122.3816274,
        37.61911449999999
      ]
    }
  },
  "place_ids": [
    1
  ],
  "industry": "parking",
  "origin_geojson": {
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [
        -122.3816274,
        37.61911449999999
      ]
    }
  },
  "location_code": "text",
  "name": "My Location",
  "description": "text",
  "labels": "test",
  "formatted_address": "text"
}

No content

Examples

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
            ]
        }
    }
}'

OpenAPI Spec

The OpenAPI spec for Saved Locations API can be found here.

Guides

Below are some guides relevant to this API:

Last updated

Was this helpful?