Rybbit
Sites

Update Site Config

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

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
  }
}