Skip to Content
Analytics boards

Partially update an analysis insight

Permissionboards:updateAuthentication
PATCH
/analysis/insights/{id}

Replaces only supplied fields, then validates the complete merged definition. Updating an archived board's insight returns 409. A semantic no-op retains the current ETag. Use If-Match for optimistic concurrency.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Path Parameters

id*string
Formatuuid

Header Parameters

If-Match?string

Optional strong ETag (or *) from a prior response. A stale tag returns 412 without changing the resource.

Request Body

application/json
  1. body

A true partial update. The server merges supplied fields into the saved definition, validates the complete result, and returns the normalized insight.

Properties1 <= properties
name?string
Length1 <= length <= 120
chart_type?AnalysisChartType

How the insight renders. Several types constrain the query shape and are rejected at write time when the config cannot draw them: pie and donut need a categorical group_by; scatter needs exactly two queries; heatmap needs a secondary group-by; number and number_delta need group_by=none; area_percent needs at least two series. The machine readable form of these rules is constraints.chart_rules on GET /v1/analysis/schema.

Value in"bar""line""area""area_percent""pie""donut""scatter""heatmap""table""number""number_delta"
time_range?AnalysisTimeRange

The window the insight reads. custom takes its bounds from config.range_from and config.range_to.

Value in"24h""7d""30d""90d""all""custom"
bucket?AnalysisBucket

Time-axis granularity. hour is available only for the 24h, 7d, and custom ranges; a coarser bucket is required for longer windows.

Value in"hour""day""week""month"
group_by?AnalysisGroupBy
Value in"none""time""agent""value"
config?

Query configuration. formula is a closed arithmetic expression over query names using numbers, +, -, *, /, and parentheses. group_by_2 requires one query, a primary grouping dimension other than none, and a different secondary dimension. formula and group_by_2 cannot be combined.

position?integer
Range0 <= value <= 10000
layout?

Placement on the board's 12-column grid. A row unit is 40px in the dashboard. All four fields are supplied together; x + w must not exceed 12 columns.

Response Body

Updated normalized insight definition. The containing board's ETag also changes unless this was a no-op.

application/json
  1. response

A normalized saved analysis insight.

id*string
Formatuuid
board_id*string
Formatuuid
name*string
Length1 <= length <= 120
chart_type*AnalysisChartType

How the insight renders. Several types constrain the query shape and are rejected at write time when the config cannot draw them: pie and donut need a categorical group_by; scatter needs exactly two queries; heatmap needs a secondary group-by; number and number_delta need group_by=none; area_percent needs at least two series. The machine readable form of these rules is constraints.chart_rules on GET /v1/analysis/schema.

Value in"bar""line""area""area_percent""pie""donut""scatter""heatmap""table""number""number_delta"
time_range*AnalysisTimeRange

The window the insight reads. custom takes its bounds from config.range_from and config.range_to.

Value in"24h""7d""30d""90d""all""custom"
bucket*AnalysisBucket

Time-axis granularity. hour is available only for the 24h, 7d, and custom ranges; a coarser bucket is required for longer windows.

Value in"hour""day""week""month"
group_by*AnalysisGroupBy
Value in"none""time""agent""value"
config*

Normalized query configuration returned for a saved insight.

position*integer
Range0 <= value <= 10000
layout*

Placement on the board's 12-column grid. A row unit is 40px in the dashboard. All four fields are supplied together; x + w must not exceed 12 columns.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X PATCH 'https://api.kejue.co/v1/analysis/insights/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "board_id": "75e8c400-2dbc-43a3-9af4-ff9e6c099385",  "name": "string",  "chart_type": "bar",  "time_range": "24h",  "bucket": "hour",  "group_by": "none",  "config": {    "queries": [      {        "name": "string",        "group_by": {          "source": "call",          "column": "string"        },        "extraction_object_id": "dd58f28a-20cf-4d0e-af7a-6fd115475937",        "column": "string",        "operation": "count",        "filters": [          {            "source": "call",            "column": "string",            "value": "string",            "op": "is_null"          }        ],        "agent_ids": [          "06fc211d-6a87-43c8-9a41-e3b40320420d"        ],        "source": "extraction"      }    ],    "formula": "string",    "group_by_2": "time",    "range_from": "2019-08-24T14:15:22Z",    "range_to": "2019-08-24T14:15:22Z",    "display": {      "series_colors": {        "property1": "string",        "property2": "string"      },      "legend": true,      "value_format": "number",      "stack_mode": "none",      "orientation": "vertical",      "goal": 0,      "lower_is_better": true    }  },  "position": 0,  "layout": {    "x": 0,    "y": 0,    "w": 1,    "h": 1  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}