Sites

Update Site Config

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

PUT /api/sites/:siteId/config

Updates site configuration settings. All fields are optional - only include the fields you want to update. Requires the editor role or above on the site (the sites:configure permission).

Fields you omit keep their current values. The excluded* lists and tags replace the stored list as a whole, so send the full list each time.

Path Parameters

Prop

Type

Request Body

Prop

Type

Response

Prop

Type

Errors

StatusWhen
400The body fails validation (details lists the problems), an IP pattern is invalid, the domain does not fit the site type, sessionReplay or webVitals is true on a mobile site, or the body has no fields
403Rybbit Cloud only: turning on sessionReplay without a plan that includes replay, or turning on webVitals, trackErrors, trackButtonClicks, trackCopy, or trackFormInteractions without an active or trialing subscription. Turning these off is always allowed. The other features are checked only when the update turns them on, but sessionReplay: true is checked every time it is sent, even if replay is already on.
404Malformed site ID or unknown text site identifier (a site that doesn't exist or that you can't access gets 403)
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": {
    "id": "a1b2c3d4e5f6",
    "siteId": 123,
    "type": "web",
    "domain": "example.com",
    "public": true,
    "embedEnabled": false,
    "saltUserIds": false,
    "blockBots": true,
    "firstPartyProxy": false,
    "excludedIPs": [],
    "excludedCountries": ["CN", "RU"],
    "excludedPaths": [],
    "excludedHostnames": [],
    "excludedUserAgents": [],
    "excludedASNs": [],
    "excludedQueryParams": [],
    "privateLinkKey": null,
    "claimExpiresAt": null,
    "sessionReplay": true,
    "webVitals": true,
    "trackErrors": true,
    "trackOutbound": true,
    "trackUrlParams": false,
    "trackUrlFragments": false,
    "trackInitialPageView": true,
    "trackSpaNavigation": true,
    "trackIp": false,
    "trackButtonClicks": false,
    "trackCopy": false,
    "trackFormInteractions": false,
    "tags": []
  }
}