POST
/
metrics
curl --request POST \
  --url http://localhost/api/metrics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "suffix": "<string>",
  "calc_type": 0,
  "description": "<string>",
  "default_value": 123,
  "display_chart": true,
  "threshold": 30,
  "places": 123
}'
{
  "data": {
    "id": "<string>",
    "type": "metrics",
    "attributes": {
      "id": "<string>",
      "name": "<string>",
      "suffix": "<string>",
      "description": "<string>",
      "default_value": "<string>",
      "calc_type": "<string>",
      "display_chart": "<string>",
      "places": "<string>",
      "default_view": "<string>",
      "threshold": "<string>",
      "order": "<string>",
      "visible": "<string>",
      "created": {
        "human": "<string>",
        "string": "<string>"
      },
      "updated": {
        "human": "<string>",
        "string": "<string>"
      }
    },
    "relationships": {
      "points": {
        "data": [
          {
            "id": "<string>",
            "type": "metricPoints",
            "attributes": {
              "id": "<string>",
              "metric_id": "<string>",
              "calculated_value": "<string>",
              "value": "<string>",
              "counter": "<string>",
              "created": {
                "human": "<string>",
                "string": "<string>"
              },
              "updated": {
                "human": "<string>",
                "string": "<string>"
              }
            },
            "relationships": {
              "metric": {
                "data": {}
              }
            }
          }
        ]
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
`CreateMetricRequestData`
name
string
required
Maximum length: 255
suffix
string
required
Maximum length: 255
calc_type
enum<integer> | null
Available options:
0,
1
description
string | null
default_value
number | null
display_chart
boolean | null
threshold
integer | null
Required range: 0 <= x <= 60
places
integer | null

Response

200
application/json
`Metric`
data
object
required