Update an Analysis

Update (replace) an existing Analysis.

Update an Analysis

put

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.

Authorizations
Path parameters
analysis_idstringRequired

An existing Beam Analysis ID.

Body
namestring · min: 1Required

Name of an analysis.

Example: My Location Analysis 1
external_idstring · min: 1Optional

External identifier associated with the Analysis (optional, user-defined).

Example: {"external_id":"abc123"}
labelstring[] · min: 1Optional

Comma-separated list of labels that can be used to search and filter analyses.

Example: ["label1","label2","label3"]
Responses
204

Successful Response

No content

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: 358

{
  "name": "My Location Analysis 1",
  "location": {
    "saved_location_id": "8gZ2rn8BRcTjM_3SWdjP"
  },
  "demand_type": {
    "demand_type": {
      "industry": "restaurants",
      "currency_code": "USD",
      "unit_currency_multiplier": 1,
      "unit_descriptor": "Sales"
    }
  },
  "external_id": {
    "external_id": "abc123"
  },
  "label": [
    "label1",
    "label2",
    "label3"
  ],
  "rank": {
    "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 $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
    )

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?