v47

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-08-011562132.1 KB
computation

Query facets analytics

Group data by facet values with optional ranging, sorting and limits.

Facet requests are limited to 3 dimensions in the by clause.

Sorting and ranging always apply to the last given facet.

post/environments/{envId}/analytics/facets

Path parameters

envIdstring required

The unique ID of your environment

Request body

byFacetName[] required

List of facet names to group by (applies to all metrics)

limitinteger

Maximum number of buckets to return (applies to all metrics)

Example request

{
  "timeRange": {
    "from": "2025-01-01T00:00:00Z",
    "to": "2025-01-31T23:59:59Z"
  },
  "by": [
    "API",
    "APPLICATION"
  ],
  "limit": 2,
  "metrics": [
    {
      "name": "HTTP_REQUESTS",
      "measures": [
        "COUNT"
      ],
      "sort": [
        {
          "measure": "COUNT",
          "order": "DESC"
        }
      ]
    }
  ]
}

Response

Facets analytics response

Example response

{
  "metrics": [
    {
      "name": "HTTP_REQUESTS",
      "unit": "NUMBER",
      "buckets": [
        {
          "key": "49ddd7db-35d6-497e-b497-2dc16af0cdcc",
          "name": "api-1",
          "type": "GROUP",
          "buckets": [
            {
              "key": "e65289b0-35b2-40e7-8d41-711fba7fdc96",
              "name": "app-1",
              "type": "LEAF",
              "measures": [
                {
                  "name": "COUNT",
                  "value": 45
                }
              ]
            },
            {
              "key": "4c65d87a-008a-4a4c-b11a-a38b7a662fcc",
              "name": "app-2",
              "type": "LEAF",
              "measures": [
                {
                  "name": "COUNT",
                  "value": 34
                }
              ]
            },
            {
              "key": "71091fd9-a6a9-4c7f-afdb-d837ea28058c",
              "name": "app-3",
              "type": "LEAF",
              "measures": [
                {
                  "name": "COUNT",
                  "value": 989
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}