Update an Analysis
Update (replace) an existing Analysis.
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
analysis_idstringRequired
An existing Beam Analysis ID.
Body
namestring · min: 1 · max: 256RequiredExample:
Name of an analysis.
My Location Analysis 1external_idstring · min: 1 · max: 256OptionalExample:
External identifier associated with the Analysis (optional, user-defined).
abc123labelstring[] · min: 1 · max: 100OptionalExample:
Comma-separated list of labels that can be used to search and filter analyses.
["label1","label2","label3"]Responses
204
Successful Response
No content
400
Bad Request
application/json
401
Unauthorized
application/json
403
Bearer token scope insufficient
application/json
404
Analysis not found
application/json
409
Data conflict
application/json
put/v1/beam/analyses/{analysis_id}
PUT /v1/beam/analyses/{analysis_id} HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 317
{
"name": "My Location Analysis 1",
"location": {
"saved_location_id": "8gZ2rn8BRcTjM_3SWdjP"
},
"demand_type": {
"industry": "restaurants",
"currency_code": "USD",
"unit_currency_multiplier": 1,
"unit_descriptor": "Sales"
},
"external_id": "abc123",
"label": [
"label1",
"label2",
"label3"
],
"rank": {
"type": "phq",
"levels": {
"phq": {
"min": 51
}
}
}
}No content
Examples
curl -X PUT "https://api.predicthq.com/v1/beam/analyses/$ANALYSIS_ID" \
-H "Accept: application/json" \
-H "Authorization: Bearer $API_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 $API_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
Guides
Last updated
Was this helpful?