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
}
}'
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/settings/session-replay"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
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
}
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/settings/session-replay", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"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
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"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
}
}`)
req, err := http.NewRequest("PUT", "https://mythic-analytics.gulp.workers.dev/client/v1/settings/session-replay", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/client/v1/settings/session-replay')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"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
}
}'
response = http.request(request)
puts response.body
{
"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"
]
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Error",
"message": "`feature_not_in_plan` — enabling replay needs a plan that includes it.",
"code": 402
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
/session-replay
Target server for requests. Edit to use your own host.
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.
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.The media type of the request body
Keys to merge into the stored config, or null to clear it.
Request Preview
Response
Response will appear here after sending the request
Authentication
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
Keys to merge into the stored config, or null to clear it.