metrics

Embed
Preview of the card
<a href="https://hermeticor.com/docs/ref-metrics"><img src="https://hermeticor.com/docs/_api/public/orgs/5fcd8b3c-a27c-4688-972f-de710125592f/spaces/caf5dc05-15f7-4e0c-bdb8-ab29ede6211e/pages/ac1ea4df-e7e8-493d-a603-9a8b92226d65/social-card.svg?v=3e7ae33eec8b" alt="metrics" width="600" height="315"></a>
POSThttps://hermeticor.com/v1/metrics/aggregates

Aggregate a metric over time: measurement, interval, breakdown, filters, timezone

Request body

application/json
metricstringrequired
An event name, a custom metric id (a name alone is read as an event name), or mapped:<role>
measurementstring
count | unique | sum_value | avg_value | sum_property | avg_property = count
measurementPropertystring
intervalstring
hour | day | week | month = day
bystring
fromstringrequired
tostringrequired
timezonestring
= UTC
filterConditionsItem[]
= []
Show child parameters
propertystringrequired
opstring
eq | neq | gt | gte | lt | lte | contains | not_contains | starts_with | ends_with | exists | not_exists | in | not_in | between = eq
valuestring | number | boolean | string | number[]
topNinteger
= 10
{
  "metric": "string",
  "measurement": "count",
  "measurementProperty": "string",
  "interval": "day",
  "by": "string",
  "from": "2024-01-01T00:00:00Z",
  "to": "2024-01-01T00:00:00Z",
  "timezone": "UTC",
  "filter": [],
  "topN": 10
}

Code samples

cURL
curl -X POST "https://hermeticor.com/v1/metrics/aggregates" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"metric":"string","measurement":"count","measurementProperty":"string","interval":"day","by":"string","from":"2024-01-01T00:00:00Z","to":"2024-01-01T00:00:00Z","timezone":"UTC","filter":[],"topN":10}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "metric": "string",
  "measurement": "string",
  "interval": "string",
  "timezone": "string",
  "by": "string",
  "buckets": [
    "string"
  ],
  "series": [
    {
      "key": "string",
      "values": [
        0
      ],
      "total": 0
    }
  ],
  "total": 0
}
Schema
metricstringrequired
measurementstringrequired
intervalstringrequired
timezonestringrequired
bystringrequired
bucketsstring[]required
seriesobject[]required
Show child parameters
keystringrequired
valuesnumber[]required
totalnumberrequired
totalnumberrequired
4XX Default Response
Example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}
Schema
errorobjectrequired
Show child parameters
codestringrequired
messagestringrequired
detailsobject
5XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

GEThttps://hermeticor.com/v1/custom-metrics

Parameters

limitintegerquery
Page size; omitted returns the whole list
cursorstringquery
Opaque: the nextCursor of the previous page

Code samples

cURL
curl -X GET "https://hermeticor.com/v1/custom-metrics" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "items": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "definition": {
        "sources": [
          {
            "event": "string",
            "conditions": []
          }
        ],
        "valueProperty": null
      },
      "createdAt": "2024-01-01T00:00:00Z",
      "updatedAt": "2024-01-01T00:00:00Z"
    }
  ],
  "nextCursor": "string"
}
Schema
itemsItemsItem144[]required
Show child parameters
idstringrequired
namestringrequired
descriptionstringrequired
definitionobjectrequired
Show child parameters
sourcesSourcesItem[]required
valuePropertystringrequired
= null
createdAtstringrequired
updatedAtstringrequired
nextCursorstringrequired
4XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

5XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

POSThttps://hermeticor.com/v1/custom-metrics

Request body

application/json
namestringrequired
descriptionstring
= null
definitionobjectrequired
Show child parameters
sourcesSourcesItem2[]required
Show child parameters
eventstringrequired
conditionsConditionsItem[]
= []
valuePropertystring
= null
{
  "name": "string",
  "description": null,
  "definition": {
    "sources": [
      {
        "event": "string",
        "conditions": []
      }
    ],
    "valueProperty": null
  }
}

Code samples

cURL
curl -X POST "https://hermeticor.com/v1/custom-metrics" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":null,"definition":{"sources":[{"event":"string","conditions":[]}],"valueProperty":null}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201 Default Response
Example
{
  "id": "string",
  "name": "string",
  "description": "string",
  "definition": {
    "sources": [
      {
        "event": "string",
        "conditions": []
      }
    ],
    "valueProperty": null
  },
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}
Schema
idstringrequired
namestringrequired
descriptionstringrequired
definitionobjectrequired
Show child parameters
sourcesSourcesItem[]required
Show child parameters
eventstringrequired
conditionsConditionsItem2[]required
= []
valuePropertystringrequired
= null
createdAtstringrequired
updatedAtstringrequired
4XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

5XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

GEThttps://hermeticor.com/v1/custom-metrics/{id}

Parameters

idstringpathrequired

Code samples

cURL
curl -X GET "https://hermeticor.com/v1/custom-metrics/{id}" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 201 · POST /v1/custom-metrics

4XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

5XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

DELETEhttps://hermeticor.com/v1/custom-metrics/{id}

Parameters

idstringpathrequired

Code samples

cURL
curl -X DELETE "https://hermeticor.com/v1/custom-metrics/{id}" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "ok": true
}
Schema
okbooleanrequired
true
4XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

5XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

PATCHhttps://hermeticor.com/v1/custom-metrics/{id}

Parameters

idstringpathrequired

Request body

application/json
namestring
descriptionstring
definitionobject
Show child parameters
sourcesSourcesItem2[]required
Show child parameters
eventstringrequired
conditionsConditionsItem[]
= []
valuePropertystring
= null
{
  "name": "string",
  "description": "string",
  "definition": {
    "sources": [
      {
        "event": "string",
        "conditions": []
      }
    ],
    "valueProperty": null
  }
}

Code samples

cURL
curl -X PATCH "https://hermeticor.com/v1/custom-metrics/{id}" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":"string","definition":{"sources":[{"event":"string","conditions":[]}],"valueProperty":null}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 201 · POST /v1/custom-metrics

4XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

5XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

GEThttps://hermeticor.com/v1/mapped-metrics

Parameters

limitintegerquery
Page size; omitted returns the whole list
cursorstringquery
Opaque: the nextCursor of the previous page

Code samples

cURL
curl -X GET "https://hermeticor.com/v1/mapped-metrics" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "items": [
    {
      "role": "placed_order",
      "metricName": "string",
      "configured": true
    }
  ],
  "nextCursor": "string"
}
Schema
itemsItemsItem145[]required
Show child parameters
rolestringrequired
placed_order | viewed_product | started_checkout | added_to_cart | submitted_form
metricNamestringrequired
configuredbooleanrequired
nextCursorstringrequired
4XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

5XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

GEThttps://hermeticor.com/v1/mapped-metrics/{role}

Parameters

rolestringpathrequired
placed_order | viewed_product | started_checkout | added_to_cart | submitted_form

Code samples

cURL
curl -X GET "https://hermeticor.com/v1/mapped-metrics/{role}" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "role": "placed_order",
  "metricName": "string",
  "configured": true
}
Schema
rolestringrequired
placed_order | viewed_product | started_checkout | added_to_cart | submitted_form
metricNamestringrequired
configuredbooleanrequired
4XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

5XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

PUThttps://hermeticor.com/v1/mapped-metrics/{role}

Parameters

rolestringpathrequired
placed_order | viewed_product | started_checkout | added_to_cart | submitted_form

Request body

application/json
metricNamestringrequired
{
  "metricName": "string"
}

Code samples

cURL
curl -X PUT "https://hermeticor.com/v1/mapped-metrics/{role}" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"metricName":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 200 · GET /v1/mapped-metrics/{role}

4XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

5XX Default Response

Same as 4XX · POST /v1/metrics/aggregates

Updated