Update an Analysis
Update (replace) an existing Analysis.
Update (replace) an existing Analysis.
This endpoint accepts the same request body fields as the Create an Analysis endpoint.
Remember this is a PUT endpoint which means you must provide all supported fields or you may lose data - you are effectively replacing the existing record with a new record containing all the fields you provide. We recommend first getting the existing record and pre-populating the request body with the current values, then change the fields you need to change.
If you wish to update a smaller number of fields please use the PATCH endpoint.
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
An existing Beam Analysis ID.
Name of an analysis.
My Location Analysis 1External identifier associated with the Analysis (optional, user-defined).
{"external_id":"abc123"}Comma-separated list of labels that can be used to search and filter analyses.
["label1","label2","label3"]Successful Response
Invalid request or Saved Location not found
Bearer token scope insufficient
Analysis not found
A data conflict has occurred due to the analysis being modified elsewhere. Please retry your call later.
Validation Error
No content
Examples
curl -X PUT "https://api.predicthq.com/v1/beam/analyses/$ANALYSIS_ID" \
-H "Accept: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @<(cat <<EOF
{
"name": "Analysis 2",
"location": {
"geopoint": {
"lat": "-36.849761",
"lon": "174.7628903"
},
"radius": 1.2,
"unit": "km"
},
"rank": {
"type": "phq"
}
}
EOF
)import requests
response = requests.put(
url="https://api.predicthq.com/v1/beam/analyses/$ANALYSIS_ID",
headers={
"Authorization": "Bearer $ACCESS_TOKEN",
"Accept": "application/json"
},
json={
"name": "Analysis 2",
"location": {
"geopoint": {
"lat": "-36.849761",
"lon": "174.7628903"
},
"radius": 1.2,
"unit": "km"
},
"rank": {
"type": "phq"
}
}
)
print(response.status_code)OpenAPI Spec
The OpenAPI spec for Beam API can be found here.
Guides
Below are some guides relevant to this API:
Last updated
Was this helpful?