Delete a memory
curl --request DELETE \
--url https://api.tensorpro.ai/api/v1/memory/records/{record_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorpro.ai/api/v1/memory/records/{record_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tensorpro.ai/api/v1/memory/records/{record_id}', 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.tensorpro.ai/api/v1/memory/records/{record_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tensorpro.ai/api/v1/memory/records/{record_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tensorpro.ai/api/v1/memory/records/{record_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorpro.ai/api/v1/memory/records/{record_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "<string>",
"detail": "<string>"
}Manage memory
Delete a memory
Delete a memory. EDN stops using it in SIPs and search, and it no longer appears in lists.
DELETE
/
api
/
v1
/
memory
/
records
/
{record_id}
Delete a memory
curl --request DELETE \
--url https://api.tensorpro.ai/api/v1/memory/records/{record_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorpro.ai/api/v1/memory/records/{record_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tensorpro.ai/api/v1/memory/records/{record_id}', 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.tensorpro.ai/api/v1/memory/records/{record_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tensorpro.ai/api/v1/memory/records/{record_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tensorpro.ai/api/v1/memory/records/{record_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorpro.ai/api/v1/memory/records/{record_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "<string>",
"detail": "<string>"
}Use this endpoint when a user asks EDN to forget something.
See Error handling.
What EDN does
- Stops using the memory in SIPs and search.
- Removes it from memory lists.
- Keeps it in the memory’s history, marked
deleted.
Required headers
| Header | Value | Description |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | Your EDN API key. Create keys in the Console. See Authentication |
Request
| Parameter | Type | Description |
|---|---|---|
record_id | string | Identifier for the memory to delete |
curl -X DELETE "https://api.tensorpro.ai/api/v1/memory/records/8f0d2c61-5b7e-4a39-9c1e-2d4f6a8b0e17" \
-H "Authorization: Bearer $EDN_API_KEY"
import os
import requests
resp = requests.delete(
"https://api.tensorpro.ai/api/v1/memory/records/8f0d2c61-5b7e-4a39-9c1e-2d4f6a8b0e17",
headers={"Authorization": f"Bearer {os.environ['EDN_API_KEY']}"},
)
resp.raise_for_status()
print(resp.status_code)
const resp = await fetch("https://api.tensorpro.ai/api/v1/memory/records/8f0d2c61-5b7e-4a39-9c1e-2d4f6a8b0e17", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.EDN_API_KEY}`,
},
});
console.log(resp.status);
Response
Returns204 No Content with no body when the request succeeds.
Important behavior
- Deleting can’t be undone through the API. Get a memory on a deleted memory returns
404.
Errors
| Status | Code | When |
|---|---|---|
401 | UNAUTHORIZED | The API key is missing, invalid or revoked |
404 | NOT_FOUND | The memory doesn’t exist, was already deleted, or isn’t yours |
429 | RATE_LIMITED | Per-minute limit reached. Retry after Retry-After seconds |
500 | INTERNAL_ERROR | Something failed on EDN’s side. Retry later |
