Skip to content

Create a recording rule (at most 50 per application). Replay rules default to a 3 s minimum duration and a required interaction; error conditions bypass both. Publishes the SDK config.

POST
/rum/{app_id}/rules
curl --request POST \
--url https://api.siteqwality.com/rum/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rules \
--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

Rule created

Media type application/json

A recording rule.

object
id
required
string format: uuid
application_id
required
string format: uuid
name
required
string
capture
required

What a matching session records. Replay implies Analyze.

string
Allowed values: analyze replay
enabled
required
boolean
sample_rate
required

The configured rate, 0.00001 to 1. For an Auto rule, the most Auto may set.

number format: double
auto_sample
required

Auto: the rate follows the replay quota, recomputed hourly (Replay rules only).

boolean
effective_sample_rate

The rate the SDK uses when the sampling tick has set one: the Auto rate, or a lowered rate for an error rule when errored sessions alone would exhaust the replay quota.

number | null format: double
effective_rate_at
string | null format: date-time
conditions
required

All must hold. Empty means every session.

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
required

Sampled recordings upload only once the session is this old. Error conditions bypass it.

integer format: int32
require_interaction
required

Sampled recordings upload only after a user interaction. Error conditions bypass it.

boolean
position
required
integer format: int32
created_by_user_id
string | null format: uuid
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{
"capture": "analyze",
"conditions": [
{
"op": "contains",
"kind": "url"
}
]
}

Invalid rule

Missing or invalid authentication

Application not found

The application already has 50 rules

Internal server error

The SDK config could not be published; nothing was changed