Update an Analysis
Update (replace) an existing Analysis.
PUT https://api.predicthq.com/v1/beam/analyses/$analysis_id
Parameter | Description |
---|---|
analysis_id | An existing Beam Analysis ID. |
Header | Value |
---|---|
Content-Type | application/json |
This endpoint accepts the same request body fields as the Create an Analysis endpoint. Please refer to the Create an Analysis documentation for request body parameters.
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 successful, the HTTP response code will be
204 No Content
.curl
python
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"
},
"tz": "UTC"
}
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"
},
"tz": "UTC"
}
)
print(response.status_code)
Below are some guides relevant to this API:
Last modified 2mo ago