Skip to main content
POST
/
rum
/
facet
/
count
Count facet value distribution
curl --request POST \
  --url 'https://api.flashcat.cloud/rum/facet/count?app_key=' \
  --header 'Content-Type: application/json' \
  --data '
{
  "scope": "error",
  "facet_key": "error.type",
  "start_time": 1712620800000,
  "end_time": 1712707200000,
  "limit": 10
}
'
{
  "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
  "data": {
    "items": [
      {
        "facet_value": "TypeError",
        "count": 1523
      },
      {
        "facet_value": "ReferenceError",
        "count": 342
      },
      {
        "facet_value": "SyntaxError",
        "count": 89
      }
    ]
  }
}

Restrictions

AspectValue
Rate limits1,000 requests/minute; 50 requests/second per account
PermissionsNone — any valid app_key can call this operation

Usage

  • Use POST /rum/facet/list to discover available facet_key values for each scope.
  • The scope must be one of: session, view, action, error, resource, long_task, vital, issue, sourcemap.
  • Pass dql to further filter events before counting. DQL syntax follows the RUM query language.
  • Pass sql with a WHERE-clause only (no SELECT) for SQL-style filtering.
  • Default limit is 100; maximum is 100.
  • Time range is required (start_time / end_time in Unix epoch milliseconds). Maximum span is 31 days.

Authorizations

app_key
string
query
required

App key issued from the Flashduty console under Account → APP Keys. Required on every public API call. Keep it secret — it grants the same access as the owning account.

Body

application/json

Parameters for counting facet value distribution.

scope
enum<string>
required

RUM data scope to query.

Available options:
session,
view,
action,
error,
resource,
long_task,
vital,
issue,
sourcemap
facet_key
string
required

The field key to count value distribution for.

start_time
integer<int64>
required

Start of the time range, Unix epoch milliseconds.

Example:

1712620800000

end_time
integer<int64>
required

End of the time range, Unix epoch milliseconds. Maximum 31-day span.

Example:

1712707200000

facet_value
any

When set, filter events where facet_key equals this value before counting. Accepts string, number, or boolean.

dql
string

RUM DQL filter expression applied before counting.

sql
string

SQL WHERE clause (no SELECT) for additional filtering.

limit
integer
default:100

Maximum number of top values to return. Default 100, maximum 100.

Required range: x <= 100

Response

Success

Success response envelope. On every 2xx response, request_id identifies the call (also mirrored in the Flashcat-Request-Id header) and data holds the endpoint-specific payload. Failure responses use a different shape — see ErrorResponse.

request_id
string
required

Unique ID for this request. Mirrored in the Flashcat-Request-Id response header. Include it when reporting issues.

Example:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

data
object
required

Top N facet values sorted by count descending.