Users
Delete User
Permanently deletes a user's analytics data on a site, for GDPR erasure requests. This cannot be undone.
DELETE /api/sites/:site/users/:userIdPermanently deletes a user's data on this site, for erasure requests. userId can be an identified user ID or an anonymous device ID. The following is removed:
- Events identified as this user
- Anonymous (never identified) events from this ID and from every device linked to it with
identify() - Session replay events and recordings for the same rows. On Rybbit Cloud, deleting the stored recording files is best effort: a failure there is logged, not reported, so the response can be
success: truewhile some recording payloads remain - The user's profile (traits) and device links
Events a linked device recorded while identified as a different user are kept, so a shared device doesn't erase someone else's history. This action cannot be undone.
Permissions: the editor role or above on the site. API keys need the users:write scope.
Path Parameters
Prop
Type
Response
Prop
Type
Error Responses
Errors use the standard body { error, code, message, resolution }.
Prop
Type
curl -X DELETE "https://app.rybbit.io/api/sites/123/users/user_8421" \
-H "Authorization: Bearer your_api_key_here"const response = await fetch(
'https://app.rybbit.io/api/sites/123/users/user_8421',
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer your_api_key_here'
}
}
);
const data = await response.json();import requests
response = requests.delete(
'https://app.rybbit.io/api/sites/123/users/user_8421',
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/users/user_8421');
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);require 'net/http'
require 'json'
uri = URI('https://app.rybbit.io/api/sites/123/users/user_8421')
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer your_api_key_here'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)req, _ := http.NewRequest("DELETE", "https://app.rybbit.io/api/sites/123/users/user_8421", 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
.delete("https://app.rybbit.io/api/sites/123/users/user_8421")
.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/users/user_8421"))
.header("Authorization", "Bearer your_api_key_here")
.DELETE()
.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.DeleteAsync("https://app.rybbit.io/api/sites/123/users/user_8421");
var data = await response.Content.ReadAsStringAsync();{
"success": true
}