Erase End-User Data
curl --request DELETE \
--url https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"external_user_id": "end-user-123",
"result": {
"mode": "detach",
"questions": 4,
"rejected_questions": 1,
"conversations": 1,
"searches": 2,
"profile": 1,
"question_text_retained": true,
"memories_cleared": true,
"files": {
"files": 3,
"cached_image_descriptions": 1,
"log_extractions": 1
},
"notice": "Identifiers were removed but the question text was kept as guru analytics. Use mode=purge to delete the questions themselves. The stored profile, search history and any uploaded files were deleted in either mode."
}
}
{
"msg": "mode must be one of detach, purge"
}
{
"msg": "Guru type my-guru not found"
}
Endpoints
Erase End-User Data
Erase everything a Guru holds about one end user
DELETE
/
{guru_slug}
/
end-users
/
{external_user_id}
/
data
/
Erase End-User Data
curl --request DELETE \
--url https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gurubase.io/api/v1/{guru_slug}/end-users/{external_user_id}/data/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"external_user_id": "end-user-123",
"result": {
"mode": "detach",
"questions": 4,
"rejected_questions": 1,
"conversations": 1,
"searches": 2,
"profile": 1,
"question_text_retained": true,
"memories_cleared": true,
"files": {
"files": 3,
"cached_image_descriptions": 1,
"log_extractions": 1
},
"notice": "Identifiers were removed but the question text was kept as guru analytics. Use mode=purge to delete the questions themselves. The stored profile, search history and any uploaded files were deleted in either mode."
}
}
{
"msg": "mode must be one of detach, purge"
}
{
"msg": "Guru type my-guru not found"
}
People who reach your Guru through a widget, a chat bot or the API do not have a
Gurubase account, so they cannot use the account tools to see or delete their data.
This endpoint is how the team running the Guru answers their access (GDPR Art. 15)
and erasure (Art. 17) requests. Which party is the controller for that data
depends on your deployment and your agreement with us; see the
privacy policy and your DPA rather than
treating this page as the answer.
Everything is scoped to the Guru in the path, so a key cannot reach another Guru’s
data even for the same end-user id.
Choose the mode with the
Stored memories, the stored profile, the semantic search history and any files
the person uploaded are deleted in both modes.
Uploaded files means the stored object itself, not only the row pointing at it:
the images, log files and documents attached to their questions are removed from
storage, along with the cached description of each image and the debugging record
of each log file.
Path Parameters
string
required
The Guru the end user interacted with
string
required
The identifier your integration supplied when the questions were asked
Headers
string
required
Your API key. You can obtain one from the Gurubase dashboard.
mode query parameter.
string
default:"detach"
detach removes the identifiers from their questions, their rejected questions
and their conversations, keeping the question text as your Guru’s analytics
history. purge deletes those questions, rejected questions and conversations
outright.detach is the default because it cannot destroy content you did not mean to
lose, but it leaves the person’s own words in your Guru. To answer a genuine
erasure request in full, use mode=purge.The mode only decides what happens to the question text, which is your Guru’s
analytics history. A profile is not your content: it is a record built about the
person, holding whatever they told the Guru about themselves. Neither is a file
they attached, which is their own document. There is no mode that keeps either.
Deleting a file cannot be undone or rolled back, so it happens before the
database work. If the request then fails, retry it: the second attempt finds the
files already gone and finishes the rest.
{
"external_user_id": "end-user-123",
"result": {
"mode": "detach",
"questions": 4,
"rejected_questions": 1,
"conversations": 1,
"searches": 2,
"profile": 1,
"question_text_retained": true,
"memories_cleared": true,
"files": {
"files": 3,
"cached_image_descriptions": 1,
"log_extractions": 1
},
"notice": "Identifiers were removed but the question text was kept as guru analytics. Use mode=purge to delete the questions themselves. The stored profile, search history and any uploaded files were deleted in either mode."
}
}
{
"msg": "mode must be one of detach, purge"
}
{
"msg": "Guru type my-guru not found"
}
memories_cleared is reported separately: if the memory store was unreachable the
rows are still gone but the memories are not, and you should retry rather than
record the request as complete.
To read the same person’s data before erasing it, see
Get End-User Data.Was this page helpful?