Confirm a memory
curl --request POST \
--url https://api.tensorpro.ai/api/v1/memory/confirm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"record_id": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284"
}
'import requests
url = "https://api.tensorpro.ai/api/v1/memory/confirm"
payload = { "record_id": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({record_id: 'c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284'})
};
fetch('https://api.tensorpro.ai/api/v1/memory/confirm', 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/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'record_id' => 'c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tensorpro.ai/api/v1/memory/confirm"
payload := strings.NewReader("{\n \"record_id\": \"c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tensorpro.ai/api/v1/memory/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"record_id\": \"c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorpro.ai/api/v1/memory/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"record_id\": \"c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284\"\n}"
response = http.request(request)
puts response.read_body{
"record_id": "e7a3b9c1-2d4f-4a6b-8c0e-1f3a5b7d9e20",
"replaces": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284"
}
Save memory
Confirm a memory
Confirm an AI_INFERRED or AI_GENERATED memory when the user agrees with it. EDN saves it as a new USER_CONFIRMED memory, which SIPs use from then on, and the original leaves the memory list. Returns 409 for memories that don’t need confirming.
POST
/
api
/
v1
/
memory
/
confirm
Confirm a memory
curl --request POST \
--url https://api.tensorpro.ai/api/v1/memory/confirm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"record_id": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284"
}
'import requests
url = "https://api.tensorpro.ai/api/v1/memory/confirm"
payload = { "record_id": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({record_id: 'c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284'})
};
fetch('https://api.tensorpro.ai/api/v1/memory/confirm', 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/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'record_id' => 'c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tensorpro.ai/api/v1/memory/confirm"
payload := strings.NewReader("{\n \"record_id\": \"c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tensorpro.ai/api/v1/memory/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"record_id\": \"c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorpro.ai/api/v1/memory/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"record_id\": \"c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284\"\n}"
response = http.request(request)
puts response.read_body{
"record_id": "e7a3b9c1-2d4f-4a6b-8c0e-1f3a5b7d9e20",
"replaces": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284"
}
Use this endpoint when the user confirms something your assistant said, for
example by clicking a check mark next to it. It’s the last step of the confirm
flow.
It works on the two kinds of unconfirmed memory:
See Error handling.
AI_INFERRED, saved by Classify an assistant replyAI_GENERATED, saved by Save a generated statement
USER_CONFIRMED fact, and SIPs use it
from then on.
What EDN does
- Creates a new
USER_CONFIRMEDmemory with the same content. - Replaces the original, which no longer appears in memory lists or SIPs.
- Keeps the original in the memory’s history.
Required headers
| Header | Value | Description |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | Your EDN API key. Create keys in the Console. See Authentication |
Content-Type | application/json | The request body is JSON |
Request
| Field | Type | Required | Description |
|---|---|---|---|
record_id | string | Yes | Identifier for the AI_INFERRED or AI_GENERATED memory to confirm, as returned by Classify an assistant reply or Save a generated statement |
curl -X POST "https://api.tensorpro.ai/api/v1/memory/confirm" \
-H "Authorization: Bearer $EDN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"record_id": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284"
}'
import os
import requests
resp = requests.post(
"https://api.tensorpro.ai/api/v1/memory/confirm",
headers={"Authorization": f"Bearer {os.environ['EDN_API_KEY']}"},
json={
"record_id": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284"
},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.tensorpro.ai/api/v1/memory/confirm", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EDN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"record_id": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284"
}),
});
console.log(await resp.json());
Response
200 OK
{
"record_id": "e7a3b9c1-2d4f-4a6b-8c0e-1f3a5b7d9e20",
"replaces": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284"
}
| Field | Type | Description |
|---|---|---|
record_id | string | Identifier for the new USER_CONFIRMED memory. This is a new ID, not the one you sent |
replaces | string | Identifier for the memory you confirmed (the record_id you sent) |
Important behavior
-
Use the new
record_idfrom now on. Get a memory on the original returns it withstatus: replaced. -
Only unconfirmed AI memories can be confirmed. Other memories return
409. - Confirming doesn’t count toward your daily limit.
Errors
| Status | Code | When |
|---|---|---|
401 | UNAUTHORIZED | The API key is missing, invalid or revoked |
404 | NOT_FOUND | The memory doesn’t exist, was deleted, was already replaced, or isn’t yours |
409 | CONFLICT | The memory doesn’t need confirming, because it isn’t AI_INFERRED or AI_GENERATED |
422 | VALIDATION_ERROR | record_id is missing or empty |
429 | RATE_LIMITED | Per-minute limit reached. Retry after Retry-After seconds |
500 | INTERNAL_ERROR | Something failed on EDN’s side. Retry later |
{
"record_id": "e7a3b9c1-2d4f-4a6b-8c0e-1f3a5b7d9e20",
"replaces": "c2e9a7d4-3f1b-4e8a-b6d0-91a5f3c7e284"
}
Authorizations
Body
application/json
