curl --request POST \
--url https://batch-jobs-lucent.onrender.com/api/sdk/replay \
--header 'Content-Type: application/json' \
--header 'X-Lucent-Api-Key: <api-key>' \
--data '
{
"session": {
"id": "<string>",
"windowId": "<string>",
"startedAt": 123,
"lastActivityAt": 123,
"url": "<string>"
},
"user": {
"anonymousId": "<string>",
"id": "<string>",
"properties": {}
},
"page": {
"url": "<string>",
"referrer": "<string>",
"viewport": {
"width": 123,
"height": 123
}
},
"replay": {
"events": [
{
"timestamp": 123,
"type": 123,
"data": "<unknown>"
}
],
"sequence": 1
},
"metadata": {
"userAgent": "<string>",
"language": "<string>"
},
"flush": "normal"
}
'import requests
url = "https://batch-jobs-lucent.onrender.com/api/sdk/replay"
payload = {
"session": {
"id": "<string>",
"windowId": "<string>",
"startedAt": 123,
"lastActivityAt": 123,
"url": "<string>"
},
"user": {
"anonymousId": "<string>",
"id": "<string>",
"properties": {}
},
"page": {
"url": "<string>",
"referrer": "<string>",
"viewport": {
"width": 123,
"height": 123
}
},
"replay": {
"events": [
{
"timestamp": 123,
"type": 123,
"data": "<unknown>"
}
],
"sequence": 1
},
"metadata": {
"userAgent": "<string>",
"language": "<string>"
},
"flush": "normal"
}
headers = {
"X-Lucent-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Lucent-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
session: {
id: '<string>',
windowId: '<string>',
startedAt: 123,
lastActivityAt: 123,
url: '<string>'
},
user: {anonymousId: '<string>', id: '<string>', properties: {}},
page: {url: '<string>', referrer: '<string>', viewport: {width: 123, height: 123}},
replay: {events: [{timestamp: 123, type: 123, data: '<unknown>'}], sequence: 1},
metadata: {userAgent: '<string>', language: '<string>'},
flush: 'normal'
})
};
fetch('https://batch-jobs-lucent.onrender.com/api/sdk/replay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://batch-jobs-lucent.onrender.com/api/sdk/replay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'session' => [
'id' => '<string>',
'windowId' => '<string>',
'startedAt' => 123,
'lastActivityAt' => 123,
'url' => '<string>'
],
'user' => [
'anonymousId' => '<string>',
'id' => '<string>',
'properties' => [
]
],
'page' => [
'url' => '<string>',
'referrer' => '<string>',
'viewport' => [
'width' => 123,
'height' => 123
]
],
'replay' => [
'events' => [
[
'timestamp' => 123,
'type' => 123,
'data' => '<unknown>'
]
],
'sequence' => 1
],
'metadata' => [
'userAgent' => '<string>',
'language' => '<string>'
],
'flush' => 'normal'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Lucent-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://batch-jobs-lucent.onrender.com/api/sdk/replay"
payload := strings.NewReader("{\n \"session\": {\n \"id\": \"<string>\",\n \"windowId\": \"<string>\",\n \"startedAt\": 123,\n \"lastActivityAt\": 123,\n \"url\": \"<string>\"\n },\n \"user\": {\n \"anonymousId\": \"<string>\",\n \"id\": \"<string>\",\n \"properties\": {}\n },\n \"page\": {\n \"url\": \"<string>\",\n \"referrer\": \"<string>\",\n \"viewport\": {\n \"width\": 123,\n \"height\": 123\n }\n },\n \"replay\": {\n \"events\": [\n {\n \"timestamp\": 123,\n \"type\": 123,\n \"data\": \"<unknown>\"\n }\n ],\n \"sequence\": 1\n },\n \"metadata\": {\n \"userAgent\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"flush\": \"normal\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Lucent-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://batch-jobs-lucent.onrender.com/api/sdk/replay")
.header("X-Lucent-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session\": {\n \"id\": \"<string>\",\n \"windowId\": \"<string>\",\n \"startedAt\": 123,\n \"lastActivityAt\": 123,\n \"url\": \"<string>\"\n },\n \"user\": {\n \"anonymousId\": \"<string>\",\n \"id\": \"<string>\",\n \"properties\": {}\n },\n \"page\": {\n \"url\": \"<string>\",\n \"referrer\": \"<string>\",\n \"viewport\": {\n \"width\": 123,\n \"height\": 123\n }\n },\n \"replay\": {\n \"events\": [\n {\n \"timestamp\": 123,\n \"type\": 123,\n \"data\": \"<unknown>\"\n }\n ],\n \"sequence\": 1\n },\n \"metadata\": {\n \"userAgent\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"flush\": \"normal\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://batch-jobs-lucent.onrender.com/api/sdk/replay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Lucent-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"session\": {\n \"id\": \"<string>\",\n \"windowId\": \"<string>\",\n \"startedAt\": 123,\n \"lastActivityAt\": 123,\n \"url\": \"<string>\"\n },\n \"user\": {\n \"anonymousId\": \"<string>\",\n \"id\": \"<string>\",\n \"properties\": {}\n },\n \"page\": {\n \"url\": \"<string>\",\n \"referrer\": \"<string>\",\n \"viewport\": {\n \"width\": 123,\n \"height\": 123\n }\n },\n \"replay\": {\n \"events\": [\n {\n \"timestamp\": 123,\n \"type\": 123,\n \"data\": \"<unknown>\"\n }\n ],\n \"sequence\": 1\n },\n \"metadata\": {\n \"userAgent\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"flush\": \"normal\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true
}{
"error": "Invalid replay batch",
"details": [
{}
]
}{}{
"error": "<string>"
}{
"error": "<string>"
}Replay
Accepts a batch of rrweb events for a single session window. Batches are idempotent per (sessionId, sequence) — the same batch submitted twice is stored once. When flush is final, the server dispatches the session for processing immediately; otherwise the session is left in a receiving state until a scheduled finalizer picks it up.
curl --request POST \
--url https://batch-jobs-lucent.onrender.com/api/sdk/replay \
--header 'Content-Type: application/json' \
--header 'X-Lucent-Api-Key: <api-key>' \
--data '
{
"session": {
"id": "<string>",
"windowId": "<string>",
"startedAt": 123,
"lastActivityAt": 123,
"url": "<string>"
},
"user": {
"anonymousId": "<string>",
"id": "<string>",
"properties": {}
},
"page": {
"url": "<string>",
"referrer": "<string>",
"viewport": {
"width": 123,
"height": 123
}
},
"replay": {
"events": [
{
"timestamp": 123,
"type": 123,
"data": "<unknown>"
}
],
"sequence": 1
},
"metadata": {
"userAgent": "<string>",
"language": "<string>"
},
"flush": "normal"
}
'import requests
url = "https://batch-jobs-lucent.onrender.com/api/sdk/replay"
payload = {
"session": {
"id": "<string>",
"windowId": "<string>",
"startedAt": 123,
"lastActivityAt": 123,
"url": "<string>"
},
"user": {
"anonymousId": "<string>",
"id": "<string>",
"properties": {}
},
"page": {
"url": "<string>",
"referrer": "<string>",
"viewport": {
"width": 123,
"height": 123
}
},
"replay": {
"events": [
{
"timestamp": 123,
"type": 123,
"data": "<unknown>"
}
],
"sequence": 1
},
"metadata": {
"userAgent": "<string>",
"language": "<string>"
},
"flush": "normal"
}
headers = {
"X-Lucent-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Lucent-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
session: {
id: '<string>',
windowId: '<string>',
startedAt: 123,
lastActivityAt: 123,
url: '<string>'
},
user: {anonymousId: '<string>', id: '<string>', properties: {}},
page: {url: '<string>', referrer: '<string>', viewport: {width: 123, height: 123}},
replay: {events: [{timestamp: 123, type: 123, data: '<unknown>'}], sequence: 1},
metadata: {userAgent: '<string>', language: '<string>'},
flush: 'normal'
})
};
fetch('https://batch-jobs-lucent.onrender.com/api/sdk/replay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://batch-jobs-lucent.onrender.com/api/sdk/replay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'session' => [
'id' => '<string>',
'windowId' => '<string>',
'startedAt' => 123,
'lastActivityAt' => 123,
'url' => '<string>'
],
'user' => [
'anonymousId' => '<string>',
'id' => '<string>',
'properties' => [
]
],
'page' => [
'url' => '<string>',
'referrer' => '<string>',
'viewport' => [
'width' => 123,
'height' => 123
]
],
'replay' => [
'events' => [
[
'timestamp' => 123,
'type' => 123,
'data' => '<unknown>'
]
],
'sequence' => 1
],
'metadata' => [
'userAgent' => '<string>',
'language' => '<string>'
],
'flush' => 'normal'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Lucent-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://batch-jobs-lucent.onrender.com/api/sdk/replay"
payload := strings.NewReader("{\n \"session\": {\n \"id\": \"<string>\",\n \"windowId\": \"<string>\",\n \"startedAt\": 123,\n \"lastActivityAt\": 123,\n \"url\": \"<string>\"\n },\n \"user\": {\n \"anonymousId\": \"<string>\",\n \"id\": \"<string>\",\n \"properties\": {}\n },\n \"page\": {\n \"url\": \"<string>\",\n \"referrer\": \"<string>\",\n \"viewport\": {\n \"width\": 123,\n \"height\": 123\n }\n },\n \"replay\": {\n \"events\": [\n {\n \"timestamp\": 123,\n \"type\": 123,\n \"data\": \"<unknown>\"\n }\n ],\n \"sequence\": 1\n },\n \"metadata\": {\n \"userAgent\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"flush\": \"normal\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Lucent-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://batch-jobs-lucent.onrender.com/api/sdk/replay")
.header("X-Lucent-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session\": {\n \"id\": \"<string>\",\n \"windowId\": \"<string>\",\n \"startedAt\": 123,\n \"lastActivityAt\": 123,\n \"url\": \"<string>\"\n },\n \"user\": {\n \"anonymousId\": \"<string>\",\n \"id\": \"<string>\",\n \"properties\": {}\n },\n \"page\": {\n \"url\": \"<string>\",\n \"referrer\": \"<string>\",\n \"viewport\": {\n \"width\": 123,\n \"height\": 123\n }\n },\n \"replay\": {\n \"events\": [\n {\n \"timestamp\": 123,\n \"type\": 123,\n \"data\": \"<unknown>\"\n }\n ],\n \"sequence\": 1\n },\n \"metadata\": {\n \"userAgent\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"flush\": \"normal\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://batch-jobs-lucent.onrender.com/api/sdk/replay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Lucent-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"session\": {\n \"id\": \"<string>\",\n \"windowId\": \"<string>\",\n \"startedAt\": 123,\n \"lastActivityAt\": 123,\n \"url\": \"<string>\"\n },\n \"user\": {\n \"anonymousId\": \"<string>\",\n \"id\": \"<string>\",\n \"properties\": {}\n },\n \"page\": {\n \"url\": \"<string>\",\n \"referrer\": \"<string>\",\n \"viewport\": {\n \"width\": 123,\n \"height\": 123\n }\n },\n \"replay\": {\n \"events\": [\n {\n \"timestamp\": 123,\n \"type\": 123,\n \"data\": \"<unknown>\"\n }\n ],\n \"sequence\": 1\n },\n \"metadata\": {\n \"userAgent\": \"<string>\",\n \"language\": \"<string>\"\n },\n \"flush\": \"normal\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true
}{
"error": "Invalid replay batch",
"details": [
{}
]
}{}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Public key prefixed with luc_pk_. Safe to expose in client-side code. For navigator.sendBeacon callers that cannot set headers, the key may also be passed as the api_key query parameter.
Body
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
final tells the server this is the last batch for the session — typically sent from a beforeunload handler. final batches trigger immediate session processing.
normal, final Response
Batch accepted.