Update a recording rule: fields left out keep their value, the result is validated whole, and the SDK config is published.
const url = 'https://api.siteqwality.com/rum/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rules/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.siteqwality.com/rum/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rules/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --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 }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”RUM application identifier
Recording rule identifier
Request Body required
Section titled “Request Body required ”Body of PUT /rum/{app_id}/rules/{rule_id}. Every field is optional: one left out keeps
its stored value, and the result is validated as a whole.
object
Replaces the whole list when given.
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
A custom event (addAction) with this name.
object
A non-ignored error, optionally narrowed by type, message fragment or handling.
object
A failed request of this class, optionally to a URL containing url_contains.
object
A frustration signal.
object
A final vital above gt (milliseconds for LCP and INP, unitless for CLS).
object
setUser was called with an id. A struct variant so unknown fields are refused.
object
A global attribute or user trait equals value.
object
The device class at init.
object
The release passed at init.
object
The environment passed at init.
object
Responses
Section titled “ Responses ”Rule updated
A recording rule.
object
What a matching session records. Replay implies Analyze.
The configured rate, 0.00001 to 1. For an Auto rule, the most Auto may set.
Auto: the rate follows the replay quota, recomputed hourly (Replay rules only).
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.
All must hold. Empty means every session.
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
A custom event (addAction) with this name.
object
A non-ignored error, optionally narrowed by type, message fragment or handling.
object
A failed request of this class, optionally to a URL containing url_contains.
object
A frustration signal.
object
A final vital above gt (milliseconds for LCP and INP, unitless for CLS).
object
setUser was called with an id. A struct variant so unknown fields are refused.
object
A global attribute or user trait equals value.
object
The device class at init.
object
The release passed at init.
object
The environment passed at init.
object
Sampled recordings upload only once the session is this old. Error conditions bypass it.
Sampled recordings upload only after a user interaction. Error conditions bypass it.
Example
{ "capture": "analyze", "conditions": [ { "op": "contains", "kind": "url" } ]}Invalid rule
Missing or invalid authentication
Application or rule not found
Internal server error
The SDK config could not be published; nothing was changed