SettingsSet the session-replay capture config

Set the session-replay capture config

Turn session replay on or off for a location and tune how it captures. Requires an agency key (ak_) and ?location_id=; viewer keys get 403 agency_required. Replay is opt-in — unset means off.

Keys are merged, not replaced. Send only what you are changing. This is deliberate rather than convenient: maskAllInputs and maskTextSelector are what keep personal data out of a recording, and a body that replaced the whole object would silently un-mask them the first time someone sent {"enabled": true} on its own. Send {"session_replay": null} to clear the configuration entirely.

Turning replay on requires a plan that includes it and returns 402 feature_not_in_plan otherwise. Turning it off, or lowering sampleRate, works on any plan — you can always reduce what you capture.

Changes reach browsers on their next config fetch, not retroactively: sessions already recording continue under the previous settings.

curl -X PUT "https://mythic-analytics.gulp.workers.dev/client/v1/settings/session-replay" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "session_replay": {
    "enabled": true,
    "sampleRate": 3.14,
    "minDurationMs": 3.14,
    "maskAllInputs": true,
    "maskTextSelector": "example_string",
    "blockSelector": "example_string",
    "captureConsole": true,
    "captureNetwork": true,
    "recordNetworkHeaders": true,
    "recordNetworkBody": true,
    "flushEventThreshold": 3.14,
    "flushIntervalMs": 3.14
  }
}'
{
  "success": true,
  "data": {
    "session_replay": {
      "enabled": true,
      "sampleRate": 3.14,
      "minDurationMs": 3.14,
      "maskAllInputs": true,
      "maskTextSelector": "example_string",
      "blockSelector": "example_string",
      "captureConsole": true,
      "captureNetwork": true,
      "recordNetworkHeaders": true,
      "recordNetworkBody": true,
      "flushEventThreshold": 3.14,
      "flushIntervalMs": 3.14
    },
    "effective": {
      "enabled": true
    },
    "valid_keys": [
      "example_string"
    ]
  }
}
PUT
/session-replay
PUT
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Builder/client key as a bearer token. Agency key for read-write (Bearer ak_...) or viewer key for read-only (Bearer sk_...). Scoped keys (mcp_) are accepted too and need settings:read or settings:write. See Using an mcp_ key over HTTP.

Builder/client key as a bearer token. Agency key for read-write (Bearer ak_...) or viewer key for read-only (Bearer sk_...). Scoped keys (mcp_) are accepted too and need settings:read or settings:write. See Using an mcp_ key over HTTP.
Content-Typestring
Required

The media type of the request body

Options: application/json
session_replaystring
Required

Keys to merge into the stored config, or null to clear it.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Builder/client key as a bearer token. Agency key for read-write (Bearer ak_...) or viewer key for read-only (Bearer sk_...). Scoped keys (mcp_) are accepted too and need settings:read or settings:write. See Using an mcp_ key over HTTP.

Body

application/json
session_replaystring
Required

Keys to merge into the stored config, or null to clear it.

Responses

successboolean
dataobject