Sessions
Get Session
Returns detailed information about a specific session including all events and pageviews.
GET /api/sites/:site/sessions/:sessionIdReturns detailed information about a specific session including all events and pageviews.
Path Parameters
Prop
Type
Query Parameters
Prop
Type
Returns 404 when the session has no events (or none in the last minutes).
Response
Prop
Type
SessionDetails Object
Prop
Type
SessionMeta Object
Prop
Type
Event Object
Prop
Type
Pagination Object
Prop
Type
curl -X GET "https://app.rybbit.io/api/sites/123/sessions/sess_abc123?limit=50" \
-H "Authorization: Bearer your_api_key_here"const response = await fetch(
'https://app.rybbit.io/api/sites/123/sessions/sess_abc123?limit=50',
{
headers: {
'Authorization': 'Bearer your_api_key_here'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://app.rybbit.io/api/sites/123/sessions/sess_abc123',
params={'limit': 50},
headers={
'Authorization': 'Bearer your_api_key_here'
}
)
data = response.json()$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123/sessions/sess_abc123?limit=50');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer your_api_key_here'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);require 'net/http'
require 'json'
uri = URI('https://app.rybbit.io/api/sites/123/sessions/sess_abc123?limit=50')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://app.rybbit.io/api/sites/123/sessions/sess_abc123?limit=50", nil)
req.Header.Set("Authorization", "Bearer your_api_key_here")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)let client = reqwest::Client::new();
let res = client
.get("https://app.rybbit.io/api/sites/123/sessions/sess_abc123?limit=50")
.header("Authorization", "Bearer your_api_key_here")
.send()
.await?;
let data: serde_json::Value = res.json().await?;HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.rybbit.io/api/sites/123/sessions/sess_abc123?limit=50"))
.header("Authorization", "Bearer your_api_key_here")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
var response = await client.GetAsync("https://app.rybbit.io/api/sites/123/sessions/sess_abc123?limit=50");
var data = await response.Content.ReadAsStringAsync();{
"data": {
"session": {
"session_id": "sess_abc123",
"user_id": "dev_xyz789",
"country": "US",
"region": "US-CA",
"city": "San Francisco",
"language": "en-US",
"device_type": "Desktop",
"browser": "Chrome",
"browser_version": "120.0",
"operating_system": "macOS",
"operating_system_version": "14.2",
"screen_width": 1920,
"screen_height": 1080,
"referrer": "https://google.com",
"channel": "Organic Search",
"session_start": "2024-01-31 14:00:00",
"session_end": "2024-01-31 14:04:05",
"session_duration": 245,
"pageviews": 5,
"events": 7,
"entry_page": "/",
"exit_page": "/pricing",
"ip": null
},
"events": [
{
"timestamp": "2024-01-31 14:00:00.000",
"pathname": "/",
"hostname": "example.com",
"querystring": "",
"page_title": "Home",
"referrer": "https://google.com",
"type": "pageview",
"event_name": "",
"props": {},
"goals": []
},
{
"timestamp": "2024-01-31 14:01:30.412",
"pathname": "/",
"hostname": "example.com",
"querystring": "",
"page_title": "Home",
"referrer": "",
"type": "custom_event",
"event_name": "cta_click",
"props": { "button": "hero" },
"goals": [{ "id": 12, "name": "CTA click" }]
}
],
"pagination": {
"total": 7,
"limit": 50,
"offset": 0,
"hasMore": false
}
}
}