Skip to main content

SessionReplay API

SessionReplay endpoints exposed by the Devotel CPaaS API Base path: /api/v1/session-replay Endpoint count: 7

title: “Errors worth branching on” description: “Per-endpoint failure templates matching the envelope — what actually fires, what to retry, what to surface to the operator.”

Errors worth branching on

These five failures cover the replay fetch (GET /api/v1/sessionreplay/), every screen-recording view from the dashboard. Each block below is a full { error, meta } envelope as the API returns it, and the matrix at the bottom answers retry vs surface for the same five classes. For the platform-wide decision table these branches plug into, see the error handling guide.

401 — Unauthorized

A 401 on this page is the bearer key failing before the route ran — it never means the resource is wrong. Rotate the key or re-mint the scoped token; retrying the same request changes nothing.

403 — Forbidden

A 403 means the key authenticated but the operation is gated by scope — check the key’s scopes on the developer page; a 403 is never a data-not-found shape.

422 — Schema

A 422 means the payload did not match the request schema — branch on error.details.field and resend with the tenant-scoped session id instead of blind-retrying the same body.

429 — Rate

The Retry-After header and error.details.retry_after are both set on every 429 — resend the SAME request after the lower of the two.

404 — Not found

Surface retention info to the operator — a retry cannot restore the asset.

60-second retry matrix

Violations behind the score

Weights used by the ranked list’s counts and the per-session timeline scoring: rage_click 3, error_click 3, dead_click 2, u_turn 2. A click reports at most one violation — a click that precedes a JS error counts as error_click (not dead_click), and a rage burst consumes its member clicks once. This is what makes the score comparable across sessions: it’s a count of distinct problems, not repeated counting of the same click. The daily triage loop that consumes these weights lives in High-friction sessions: read frustration signals.

List recent session-replay recordings

GET /api/v1/session-replay
Returns the most recent session-replay recordings captured across the tenant’s conversations as lightweight summaries (no event payloads). The inbox ‘Session replays’ panel lists these so an agent can pick one to play back.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Get a session-replay recording for playback

GET /api/v1/session-replay/{conversationId}
Returns the full rrweb event stream stamped on the conversation (metadata.session_replay), or null when no recording exists. The agent’s rrweb-player consumes session_replay.events to replay the customer’s web session.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Get a session replay’s frustration-signal timeline

GET /api/v1/session-replay/frustration/{conversationId}
Returns the chronological frustration-signal timeline for one recorded session — each signal carries its type (rage_click / dead_click / error_click / u_turn), the event timestamp, click coordinates where known, and a short detail. The replay player renders a marker per signal on the scrubber. The full recording is analysed end-to-end, so signals are captured even in long sessions.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

List high-friction session replays ranked by frustration

GET /api/v1/session-replay/frustration/sessions
Scans recent session-replay recordings, derives per-session frustration signals (rage clicks, dead clicks, error clicks, and rapid back-navigation u-turns) from the recorded events, and returns the sessions with any friction ordered by frustration score (highest first). The ranked list scores each recording quickly for triage; open a session to analyse the full recording and see its complete signal timeline.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Get the session-replay capture-time privacy policy

GET /api/v1/session-replay/privacy
Returns the tenant’s capture-side masking policy (mask_all_inputs, mask_text_selectors, block_selectors, mask_pii_default) that the rrweb capture client uses to redact PII in the visitor’s browser before upload. Returns the default-deny policy when none has been configured.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Update the session-replay capture-time privacy policy

PUT /api/v1/session-replay/privacy
Upserts the tenant’s capture-side masking policy. Inputs default-deny (mask_all_inputs defaults true); selectors round-trip verbatim. Stored on the widget config’s feature_flags; the change reaches new capture sessions via the next /widget/session bootstrap. Does not touch any existing recording or the GDPR purge path.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Delete a session-replay recording

DELETE /api/v1/session-replay/{conversationId}
Removes the session-replay recording from the conversation (metadata.session_replay), leaving the conversation + messages intact. Idempotent. Use for privacy / right-to-erasure requests.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.