Start a browser session replay recording
curl --request POST \
--url https://api.onkernel.com/browsers/{id}/replays \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"framerate": 30,
"max_duration_in_seconds": 2,
"record_audio": false
}
'import requests
url = "https://api.onkernel.com/browsers/{id}/replays"
payload = {
"framerate": 30,
"max_duration_in_seconds": 2,
"record_audio": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({framerate: 30, max_duration_in_seconds: 2, record_audio: false})
};
fetch('https://api.onkernel.com/browsers/{id}/replays', 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://api.onkernel.com/browsers/{id}/replays",
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([
'framerate' => 30,
'max_duration_in_seconds' => 2,
'record_audio' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.onkernel.com/browsers/{id}/replays"
payload := strings.NewReader("{\n \"framerate\": 30,\n \"max_duration_in_seconds\": 2,\n \"record_audio\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.onkernel.com/browsers/{id}/replays")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"framerate\": 30,\n \"max_duration_in_seconds\": 2,\n \"record_audio\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onkernel.com/browsers/{id}/replays")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"framerate\": 30,\n \"max_duration_in_seconds\": 2,\n \"record_audio\": false\n}"
response = http.request(request)
puts response.read_body{
"replay_id": "<string>",
"finished_at": "2023-11-07T05:31:56Z",
"replay_view_url": "https://api.onkernel.com/browser/replays?jwt=eyJ0eXAi...&replay_id=7e2c1a9f-1234-4cde-9abc-ffeedd001122",
"started_at": "2023-11-07T05:31:56Z"
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}Browser Replays
Start a browser session replay recording
Start recording the browser session and return a replay ID.
POST
/
browsers
/
{id}
/
replays
Start a browser session replay recording
curl --request POST \
--url https://api.onkernel.com/browsers/{id}/replays \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"framerate": 30,
"max_duration_in_seconds": 2,
"record_audio": false
}
'import requests
url = "https://api.onkernel.com/browsers/{id}/replays"
payload = {
"framerate": 30,
"max_duration_in_seconds": 2,
"record_audio": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({framerate: 30, max_duration_in_seconds: 2, record_audio: false})
};
fetch('https://api.onkernel.com/browsers/{id}/replays', 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://api.onkernel.com/browsers/{id}/replays",
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([
'framerate' => 30,
'max_duration_in_seconds' => 2,
'record_audio' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.onkernel.com/browsers/{id}/replays"
payload := strings.NewReader("{\n \"framerate\": 30,\n \"max_duration_in_seconds\": 2,\n \"record_audio\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.onkernel.com/browsers/{id}/replays")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"framerate\": 30,\n \"max_duration_in_seconds\": 2,\n \"record_audio\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onkernel.com/browsers/{id}/replays")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"framerate\": 30,\n \"max_duration_in_seconds\": 2,\n \"record_audio\": false\n}"
response = http.request(request)
puts response.read_body{
"replay_id": "<string>",
"finished_at": "2023-11-07T05:31:56Z",
"replay_view_url": "https://api.onkernel.com/browser/replays?jwt=eyJ0eXAi...&replay_id=7e2c1a9f-1234-4cde-9abc-ffeedd001122",
"started_at": "2023-11-07T05:31:56Z"
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Browser session ID
Body
application/json
Recording framerate in fps. Values above 20 require GPU to be enabled on the browser session.
Required range:
1 <= x <= 60Maximum recording duration in seconds.
Required range:
x >= 1Record audio in addition to video. When false (the default), the recording is video-only.
Response
Recording started successfully.
Information about a browser replay recording.
Unique identifier for the replay recording.
Timestamp when replay finished
URL for viewing the replay recording.
Example:
"https://api.onkernel.com/browser/replays?jwt=eyJ0eXAi...&replay_id=7e2c1a9f-1234-4cde-9abc-ffeedd001122"
Timestamp when replay started
⌘I