Skip to content

Estimate a rule's sessions per month and quota share from the last 7 days. Read-only; a condition stored sessions cannot answer counts as true and is listed in `not_evaluated`.

POST
/rum/{app_id}/rules/preview
curl --request POST \
--url https://api.siteqwality.com/rum/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rules/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "capture": "analyze", "enabled": true, "sample_rate": 1, "auto_sample": true, "conditions": [ { "op": "contains", "value": "example", "kind": "url" } ], "min_duration_ms": 1, "require_interaction": true, "position": 1 }'
app_id
required
string format: uuid

RUM application identifier

Media type application/json

Body of POST /rum/{app_id}/rules and of a preview.

object
name

1 to 255 characters. Optional for a preview.

string | null
capture
required

What a matching session records. Replay implies Analyze.

string
Allowed values: analyze replay
enabled
boolean
sample_rate

Default 1.

number format: double
auto_sample
boolean
conditions
Array
One of:

The page URL, checked on each view. regex values use the common subset of the Rust and JavaScript syntaxes, at most 256 characters, with no nested quantifiers.

object
op
required
string
Allowed values: contains starts_with regex
value
required
string
kind
required
string
Allowed values: url
min_duration_ms

Default 3000 for Replay rules, 0 for Analyze rules.

integer | null format: int32
require_interaction

Default true for Replay rules, false for Analyze rules.

boolean | null
position

Default: after the last rule.

integer | null format: int32

Estimate

Media type application/json

What a rule would record, from the last 7 days of sessions (POST .../rules/preview).

object
window_days
required
integer format: int32
sessions_in_window
required

Sessions the application had in the window.

integer format: int64
matching_sessions_in_window
required

Of those, sessions the conditions and gates would match, before sampling.

integer format: int64
sample_rate
required

The sample rate applied: the configured rate, or the current Auto rate.

number format: double
estimated_sessions_per_month
required

Matching sessions scaled to a 30-day month, after sampling.

integer format: int64
quota_product
required

session_replay for Replay rules, rum_analyze for Analyze rules.

string
monthly_quota
required

The account’s monthly quota for that product.

integer format: int64
quota_share

estimated_sessions_per_month / monthly_quota; null when there is no quota.

number | null format: double
approximate
required

True when part of the rule could not be evaluated exactly from stored sessions; the estimate is then an upper bound.

boolean
not_evaluated
required

Condition kinds and gates counted as always true.

Array<string>
Example generated
{
"window_days": 1,
"sessions_in_window": 1,
"matching_sessions_in_window": 1,
"sample_rate": 1,
"estimated_sessions_per_month": 1,
"quota_product": "example",
"monthly_quota": 1,
"quota_share": 1,
"approximate": true,
"not_evaluated": [
"example"
]
}

Invalid rule

Missing or invalid authentication

Application not found

Internal server error