Skip to main content
POST
Count facet value distribution

Time range alignment and caching

So that repeated queries can reuse cached results, the start is rounded down and the end rounded up to max(1 minute, range ÷ 1226 rounded up to the next standard interval step), for example 24h aligns to 2 minutes, 7d to 10 minutes, and 30d to 1 hour. Ranges shorter than 100 grid steps are neither aligned nor cached. At most one grid step of extra data is included at the start; the end rounds into the future, which holds no data. Results may be up to 60 seconds stale for the most recent data.

Restrictions

Usage

  • Use POST /rum/field/list with is_facet: true to discover facet_key values for each scope.
  • facet_key must be a facet field (is_facet: true) of the requested scope with show_type: list and a non-array value_type; otherwise the call returns InvalidParameter.
  • Events where facet_key is null are not counted. Pass facet_value to count only events equal to that value; its JSON type must match the field’s value_type.
  • Pass dql to filter events before counting. Pass sql as a bare WHERE condition; the word SELECT anywhere in it (case-insensitive) is rejected.
  • Events of private applications the caller cannot access are not counted, as in POST /rum/data/query.
  • limit defaults to 100; maximum is 100.
  • start_time / end_time are required Unix epoch milliseconds, at most 31 days apart.
  • For scope: sourcemap, type and kind choose which symbol store is counted.

Authorizations

app_key
string
query
required

APP Key created in the Flashduty console under My → APP Key. Send it as the app_key query parameter or in the Fd-App-Key request header. Its effective access is the intersection of the key's permission scope and the creator's current role permissions. Keep it secret.

Body

application/json

Parameters for counting facet value distribution.

end_time
integer<int64>
required

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

Example:

1712707200000

facet_key
string
required

Field key whose value distribution to count, such as error_type. Must be a facet field of the given scope with show_type: list and a non-array value_type. List candidates with POST /rum/field/list.

scope
enum<string>
required

RUM data scope to query. One of:

Available options:
session,
view,
action,
error,
resource,
long_task,
vital,
issue,
sourcemap
start_time
integer<int64>
required

Start of the time range, Unix epoch milliseconds.

Example:

1712620800000

dql
string

RUM DQL filter expression applied before counting. Fields in it are validated against the scope. A value list in a filter (field:(a OR b ...)) may hold at most 100 values.

facet_value
any

When set, count only events whose facet_key equals this value. The JSON type must match the field's value_type (string, number or boolean); a mismatch returns InvalidParameter. When omitted, events with a null value are excluded.

kind
enum<string>

Symbol kind, used only when scope is sourcemap and only meaningful for android/harmony: mapping (default) selects ProGuard/R8 mappings or ArkTS sourcemaps, native selects native .so symbols.

Available options:
mapping,
native
limit
integer
default:100

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

Required range: x <= 100
sql
string

Bare SQL WHERE condition (without the WHERE keyword) for extra filtering, such as env = 'prod'. Any occurrence of SELECT is rejected. A value list in a filter (field IN (...)) may hold at most 100 values.

type
enum<string>

Symbol-store platform, used only when scope is sourcemap. Defaults to browser when omitted; web and javascript are accepted aliases of browser.

Available options:
browser,
web,
javascript,
android,
ios,
miniprogram,
harmony,
flutter,
electron,
react-native

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

Top N facet values sorted by count descending.