Rybbit
API

Sites

Manage sites, configuration, private links, and exclusion settings

See the API Reference for authentication details.

Looking to create a new site? See the Create Site endpoint under Organizations.

Endpoints


Get Site

GET /api/sites/:siteId

Returns detailed information about a specific site including its configuration.

Path Parameters

Prop

Type

Response

Prop

Type

Request
curl -X GET "https://app.rybbit.io/api/sites/123" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://app.rybbit.io/api/sites/123',
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

const data = await response.json();
Request
import requests

response = requests.get(
    'https://app.rybbit.io/api/sites/123',
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123');
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);
Request
require 'net/http'
require 'json'

uri = URI('https://app.rybbit.io/api/sites/123')
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)
Request
req, _ := http.NewRequest("GET", "https://app.rybbit.io/api/sites/123", 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)
Request
let client = reqwest::Client::new();
let res = client
    .get("https://app.rybbit.io/api/sites/123")
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.rybbit.io/api/sites/123"))
    .header("Authorization", "Bearer your_api_key_here")
    .GET()
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Request
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");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "id": "site_abc123",
  "siteId": 123,
  "name": "My Website",
  "domain": "example.com",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-31T14:00:00.000Z",
  "createdBy": "user_xyz789",
  "organizationId": "org_def456",
  "public": false,
  "saltUserIds": false,
  "blockBots": true,
  "isOwner": true,
  "sessionReplay": true,
  "webVitals": true,
  "trackErrors": true,
  "trackOutbound": true,
  "trackUrlParams": false
}

Delete Site

DELETE /api/sites/:siteId

Permanently deletes a site and all its associated data. This action cannot be undone. Requires admin or owner role.

Path Parameters

Prop

Type

Response

Prop

Type

Request
curl -X DELETE "https://app.rybbit.io/api/sites/123" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://app.rybbit.io/api/sites/123',
  {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

const data = await response.json();
Request
import requests

response = requests.delete(
    'https://app.rybbit.io/api/sites/123',
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer your_api_key_here'
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
Request
require 'net/http'
require 'json'

uri = URI('https://app.rybbit.io/api/sites/123')
req = Net::HTTP::Delete.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)
Request
req, _ := http.NewRequest("DELETE", "https://app.rybbit.io/api/sites/123", 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)
Request
let client = reqwest::Client::new();
let res = client
    .delete("https://app.rybbit.io/api/sites/123")
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.rybbit.io/api/sites/123"))
    .header("Authorization", "Bearer your_api_key_here")
    .DELETE()
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Request
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");

var response = await client.DeleteAsync("https://app.rybbit.io/api/sites/123");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "success": true
}

Update Site Config

PUT /api/sites/:siteId/config

Updates site configuration settings. All fields are optional - only include the fields you want to update. Requires admin or owner role.

Path Parameters

Prop

Type

Request Body

Prop

Type

Response

Prop

Type

Request
curl -X PUT "https://app.rybbit.io/api/sites/123/config" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"public": true, "blockBots": true, "excludedCountries": ["CN", "RU"]}'
Request
const response = await fetch(
  'https://app.rybbit.io/api/sites/123/config',
  {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer your_api_key_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      public: true,
      blockBots: true,
      excludedCountries: ['CN', 'RU']
    })
  }
);

const data = await response.json();
Request
import requests

response = requests.put(
    'https://app.rybbit.io/api/sites/123/config',
    json={
        'public': True,
        'blockBots': True,
        'excludedCountries': ['CN', 'RU']
    },
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123/config');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'public' => true,
    'blockBots' => true,
    'excludedCountries' => ['CN', 'RU']
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer your_api_key_here',
    'Content-Type: application/json'
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
Request
require 'net/http'
require 'json'

uri = URI('https://app.rybbit.io/api/sites/123/config')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'
req['Content-Type'] = 'application/json'
req.body = { public: true, blockBots: true, excludedCountries: ['CN', 'RU'] }.to_json

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
Request
body := bytes.NewBuffer([]byte(`{"public": true, "blockBots": true, "excludedCountries": ["CN", "RU"]}`))
req, _ := http.NewRequest("PUT", "https://app.rybbit.io/api/sites/123/config", body)
req.Header.Set("Authorization", "Bearer your_api_key_here")
req.Header.Set("Content-Type", "application/json")

client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()

var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)
Request
let client = reqwest::Client::new();
let res = client
    .put("https://app.rybbit.io/api/sites/123/config")
    .header("Authorization", "Bearer your_api_key_here")
    .json(&serde_json::json!({
        "public": true,
        "blockBots": true,
        "excludedCountries": ["CN", "RU"]
    }))
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
String json = "{\"public\": true, \"blockBots\": true, \"excludedCountries\": [\"CN\", \"RU\"]}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.rybbit.io/api/sites/123/config"))
    .header("Authorization", "Bearer your_api_key_here")
    .header("Content-Type", "application/json")
    .PUT(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Request
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");

var content = new StringContent(
    "{\"public\": true, \"blockBots\": true, \"excludedCountries\": [\"CN\", \"RU\"]}",
    Encoding.UTF8,
    "application/json"
);

var response = await client.PutAsync("https://app.rybbit.io/api/sites/123/config", content);
var data = await response.Content.ReadAsStringAsync();
Response
{
  "success": true,
  "message": "Site configuration updated successfully",
  "config": {
    "public": true,
    "saltUserIds": false,
    "blockBots": true,
    "excludedIPs": [],
    "excludedCountries": ["CN", "RU"],
    "sessionReplay": true,
    "webVitals": true,
    "trackErrors": true,
    "trackOutbound": true,
    "trackUrlParams": false
  }
}

Get Excluded IPs

GET /api/sites/:siteId/excluded-ips

Returns the list of IP addresses and CIDR ranges that are excluded from tracking.

Path Parameters

Prop

Type

Response

Prop

Type

Request
curl -X GET "https://app.rybbit.io/api/sites/123/excluded-ips" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://app.rybbit.io/api/sites/123/excluded-ips',
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

const data = await response.json();
Request
import requests

response = requests.get(
    'https://app.rybbit.io/api/sites/123/excluded-ips',
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123/excluded-ips');
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);
Request
require 'net/http'
require 'json'

uri = URI('https://app.rybbit.io/api/sites/123/excluded-ips')
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)
Request
req, _ := http.NewRequest("GET", "https://app.rybbit.io/api/sites/123/excluded-ips", 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)
Request
let client = reqwest::Client::new();
let res = client
    .get("https://app.rybbit.io/api/sites/123/excluded-ips")
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.rybbit.io/api/sites/123/excluded-ips"))
    .header("Authorization", "Bearer your_api_key_here")
    .GET()
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Request
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/excluded-ips");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "success": true,
  "excludedIPs": [
    "192.168.1.1",
    "10.0.0.0/8",
    "172.16.0.0/12"
  ]
}

Get Excluded Countries

GET /api/sites/:siteId/excluded-countries

Returns the list of country codes that are excluded from tracking.

Path Parameters

Prop

Type

Response

Prop

Type

Request
curl -X GET "https://app.rybbit.io/api/sites/123/excluded-countries" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://app.rybbit.io/api/sites/123/excluded-countries',
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

const data = await response.json();
Request
import requests

response = requests.get(
    'https://app.rybbit.io/api/sites/123/excluded-countries',
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123/excluded-countries');
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);
Request
require 'net/http'
require 'json'

uri = URI('https://app.rybbit.io/api/sites/123/excluded-countries')
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)
Request
req, _ := http.NewRequest("GET", "https://app.rybbit.io/api/sites/123/excluded-countries", 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)
Request
let client = reqwest::Client::new();
let res = client
    .get("https://app.rybbit.io/api/sites/123/excluded-countries")
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.rybbit.io/api/sites/123/excluded-countries"))
    .header("Authorization", "Bearer your_api_key_here")
    .GET()
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Request
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/excluded-countries");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "success": true,
  "excludedCountries": [
    "CN",
    "RU",
    "KP"
  ]
}

GET /api/sites/:siteId/private-link-config

Returns the private link key configuration. Private links allow sharing analytics with a secret key without requiring authentication.

Path Parameters

Prop

Type

Response

Prop

Type

Data Object

Prop

Type

Request
curl -X GET "https://app.rybbit.io/api/sites/123/private-link-config" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://app.rybbit.io/api/sites/123/private-link-config',
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

const data = await response.json();
Request
import requests

response = requests.get(
    'https://app.rybbit.io/api/sites/123/private-link-config',
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123/private-link-config');
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);
Request
require 'net/http'
require 'json'

uri = URI('https://app.rybbit.io/api/sites/123/private-link-config')
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)
Request
req, _ := http.NewRequest("GET", "https://app.rybbit.io/api/sites/123/private-link-config", 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)
Request
let client = reqwest::Client::new();
let res = client
    .get("https://app.rybbit.io/api/sites/123/private-link-config")
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.rybbit.io/api/sites/123/private-link-config"))
    .header("Authorization", "Bearer your_api_key_here")
    .GET()
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Request
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/private-link-config");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "success": true,
  "data": {
    "privateLinkKey": "a1b2c3d4e5f6"
  }
}

POST /api/sites/:siteId/private-link-config

Generates or revokes a private link key for sharing analytics without authentication. Requires admin or owner role.

Path Parameters

Prop

Type

Request Body

Prop

Type

Response

Prop

Type

Data Object

Prop

Type

Request
curl -X POST "https://app.rybbit.io/api/sites/123/private-link-config" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"action": "generate_private_link_key"}'
Request
const response = await fetch(
  'https://app.rybbit.io/api/sites/123/private-link-config',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer your_api_key_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      action: 'generate_private_link_key'
    })
  }
);

const data = await response.json();
Request
import requests

response = requests.post(
    'https://app.rybbit.io/api/sites/123/private-link-config',
    json={
        'action': 'generate_private_link_key'
    },
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123/private-link-config');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'action' => 'generate_private_link_key'
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer your_api_key_here',
    'Content-Type: application/json'
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
Request
require 'net/http'
require 'json'

uri = URI('https://app.rybbit.io/api/sites/123/private-link-config')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'
req['Content-Type'] = 'application/json'
req.body = { action: 'generate_private_link_key' }.to_json

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
Request
body := bytes.NewBuffer([]byte(`{"action": "generate_private_link_key"}`))
req, _ := http.NewRequest("POST", "https://app.rybbit.io/api/sites/123/private-link-config", body)
req.Header.Set("Authorization", "Bearer your_api_key_here")
req.Header.Set("Content-Type", "application/json")

client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()

var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)
Request
let client = reqwest::Client::new();
let res = client
    .post("https://app.rybbit.io/api/sites/123/private-link-config")
    .header("Authorization", "Bearer your_api_key_here")
    .json(&serde_json::json!({
        "action": "generate_private_link_key"
    }))
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
String json = "{\"action\": \"generate_private_link_key\"}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.rybbit.io/api/sites/123/private-link-config"))
    .header("Authorization", "Bearer your_api_key_here")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Request
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");

var content = new StringContent(
    "{\"action\": \"generate_private_link_key\"}",
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync("https://app.rybbit.io/api/sites/123/private-link-config", content);
var data = await response.Content.ReadAsStringAsync();
Response
{
  "success": true,
  "data": {
    "privateLinkKey": "f6e5d4c3b2a1"
  }
}