Update an Analysis Group

Update (replace) an existing Analysis Group.

Update an Analysis Group

put

Update (replace) an existing Analysis Group.

This endpoint accepts the same request body fields as the Create an Analysis Group endpoint.

Remember this is a PUT endpoint which means you must provide all supported fields - 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.

Authorizations
Path parameters
group_idstringRequired

An Analysis Group ID. Analyses that belong to this group will be returned.

Example: 3ED1zxXqAY
Body
namestring · min: 1Required

Name of an analysis group.

Example: My Analysis Group 1
analysis_idsstring[]Required

The list of existing analysis IDs to include in the group.

Analyses can belong to multiple groups. Analyses must have the same demand type (the interval must match and, for weekly analyses, week_start_day must also be consistent). Every analysis in the group must have the same industry, if set.

Example: ["zRa_kk7MlAA","3aR-gbJp98I","JBb08XsZqAo","q9iX2XqFBxM"]
Responses
202

Successful Response

No content

put
/v1/beam/analysis-groups/{group_id}
PUT /v1/beam/analysis-groups/{group_id} HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 148

{
  "name": "My Analysis Group 1",
  "analysis_ids": [
    "zRa_kk7MlAA",
    "3aR-gbJp98I",
    "JBb08XsZqAo",
    "q9iX2XqFBxM"
  ],
  "demand_type": {
    "unit_descriptor": "bookings"
  }
}

No content

Examples

curl -X PUT "https://api.predicthq.com/v1/beam/analysis-groups/$GROUP_ID" \
     -H "Accept: application/json" \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     --data @<(cat <<EOF
    {
        "name": "Analysis Group 2",
        "analysis_ids": [
            "zRa_kk7MlAA",
            "Wfjj1_PCArw"
        ]
    }
    EOF
    )

OpenAPI Spec

The OpenAPI spec for Beam API can be found here.

Last updated

Was this helpful?