v1

latestOpenAPI 3.1.02026-08-06360288.3 KB
Metrics

Update Metric Data

Update custom metric data with day, week, and month averages and values. Metrics must be created in the Dashboard before they can be updated via the API.

post/metric/update

Headers

x-api-idstring required
x-api-keystring required

Request body

statuspage_idstring required

ID of the status page

metric_idstring required

ID of the metric

day_avgstring required

Average value for past 24 hours

day_startstring required

UNIX timestamp for start of metric timeframe

day_datesstring[] required

An array of timestamps for the past 24 hours

day_valuesstring[] required

An array of values matching the timestamps. Must contain exactly 24 values.

week_avgstring required

Average value for past 7 days

week_startstring required

UNIX timestamp for start of metric timeframe

week_datesstring[] required

An array of timestamps for the past 7 days

week_valuesstring[] required

An array of values matching the timestamps. Must contain exactly 7 values.

month_avgstring required

Average value for past 30 days

month_startstring required

UNIX timestamp for start of metric timeframe

month_datesstring[] required

An array of timestamps for the past 30 days

month_valuesstring[] required

An array of values matching the timestamps. Must contain exactly 30 values.

Example request

{
  "day_avg": "22.58",
  "day_dates": [
    "2014-03-28T05:43:00+00:00",
    "2014-03-28T06:43:00+00:00",
    "2014-03-28T07:43:00+00:00",
    "2014-03-28T08:43:00+00:00",
    "2014-03-28T09:43:00+00:00",
    "2014-03-28T10:43:00+00:00",
    "2014-03-28T11:43:00+00:00",
    "2014-03-28T12:43:00+00:00",
    "2014-03-28T13:43:00+00:00",
    "2014-03-28T14:43:00+00:00",
    "2014-03-28T15:43:00+00:00",
    "2014-03-28T16:43:00+00:00",
    "2014-03-28T17:43:00+00:00",
    "2014-03-28T18:43:00+00:00",
    "2014-03-28T19:43:00+00:00",
    "2014-03-28T20:43:00+00:00",
    "2014-03-28T21:43:00+00:00",
    "2014-03-28T22:43:00+00:00",
    "2014-03-28T23:43:00+00:00",
    "2014-03-29T00:43:00+00:00",
    "2014-03-29T01:43:00+00:00",
    "2014-03-29T02:43:00+00:00",
    "2014-03-29T03:43:00+00:00"
  ],
  "day_start": "1395981878000",
  "day_values": [
    "20.70",
    "20.00",
    "19.20",
    "19.80",
    "19.90",
    "20.10",
    "21.40",
    "23.00",
    "27.40",
    "28.70",
    "27.50",
    "29.30",
    "28.50",
    "27.20",
    "28.60",
    "28.70",
    "25.90",
    "23.40",
    "22.40",
    "21.40",
    "19.80",
    "19.50",
    "20.00"
  ],
  "metric_id": "52e5e0e0893548542400000b",
  "month_avg": "10.63",
  "month_dates": [
    "2014-02-28T04:43:00+00:00",
    "2014-03-01T04:43:00+00:00",
    "2014-03-02T04:43:00+00:00",
    "2014-03-03T04:43:00+00:00",
    "2014-03-04T04:43:00+00:00",
    "2014-03-05T04:43:00+00:00",
    "2014-03-06T04:43:00+00:00",
    "2014-03-07T04:43:00+00:00",
    "2014-03-08T04:43:00+00:00",
    "2014-03-09T04:43:00+00:00",
    "2014-03-10T04:43:00+00:00",
    "2014-03-11T04:43:00+00:00",
    "2014-03-12T04:43:00+00:00",
    "2014-03-13T04:43:00+00:00",
    "2014-03-14T04:43:00+00:00",
    "2014-03-15T04:43:00+00:00",
    "2014-03-16T04:43:00+00:00",
    "2014-03-17T04:43:00+00:00",
    "2014-03-18T04:43:00+00:00",
    "2014-03-19T04:43:00+00:00",
    "2014-03-20T04:43:00+00:00",
    "2014-03-21T04:43:00+00:00",
    "2014-03-22T04:43:00+00:00",
    "2014-03-23T04:43:00+00:00",
    "2014-03-24T04:43:00+00:00",
    "2014-03-25T04:43:00+00:00",
    "2014-03-26T04:43:00+00:00",
    "2014-03-27T04:43:00+00:00",
    "2014-03-28T04:43:00+00:00"
  ],
  "month_start": "1393476280000",
  "month_values": [
    "0.00",
    "0.00",
    "0.00",
    "0.00",
    "0.00",
    "0.00",
    "0.00",
    "0.00",
    "0.00",
    "0.00",
    "0.00",
    "0.00",
    "18.50",
    "18.60",
    "18.40",
    "16.60",
    "16.80",
    "17.90",
    "19.90",
    "21.30",
    "22.80",
    "20.00",
    "17.30",
    "19.10",
    "21.50",
    "22.40",
    "22.50",
    "22.00",
    "21.80"
  ],
  "statuspage_id": "52e5e0e0893548543700000b",
  "week_avg": "20.07",
  "week_dates": [
    "2014-03-22T04:43:00+00:00",
    "2014-03-23T04:43:00+00:00",
    "2014-03-24T04:43:00+00:00",
    "2014-03-25T04:43:00+00:00",
    "2014-03-26T04:43:00+00:00",
    "2014-03-27T04:43:00+00:00",
    "2014-03-28T04:43:00+00:00"
  ],
  "week_start": "1395463478000",
  "week_values": [
    "23.10",
    "22.10",
    "22.20",
    "22.30",
    "22.10",
    "18.70",
    "17.00"
  ]
}

Response

OK

resultboolean

Example response

{
  "result": true,
  "status": {
    "error": "no",
    "message": "Updated metric successfully"
  }
}