Python
# Needs the agent_memory:write scope; a note with personal data comes back refused
saved = niadra.remember(
"pitfall",
"Scheduling API",
"Dates without a time zone are refused; send the offset the customer's region uses.",
tags=["scheduling"],
)
if saved.error == "personal_data_in_agent_memory":
... # rewrite the note without the customer's data// Needs the agent_memory:write scope; a note with personal data comes back refused
const { data, error } = await niadra.remember({
kind: "pitfall",
title: "Scheduling API",
body: "Dates without a time zone are refused; send the offset the customer's region uses.",
tags: ["scheduling"],
});
if (error?.code === "personal_data_in_agent_memory") {
// rewrite the note without the customer's data
}curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/agent-memory/notes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "<string>",
"title": "<string>",
"evidence": {
"conversation_id": "<string>",
"task_id": "<string>"
},
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": [
"<string>"
],
"valid_until": "2023-11-07T05:31:56Z",
"visibility": "source"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
body: JSON.stringify('<string>'),
title: '<string>',
evidence: {conversation_id: '<string>', task_id: '<string>'},
source_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tags: ['<string>'],
valid_until: '2023-11-07T05:31:56Z',
visibility: 'source'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/agent-memory/notes', 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://{space}.{region}.api.niadra.com/v1/agent-memory/notes",
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([
'body' => '<string>',
'title' => '<string>',
'evidence' => [
'conversation_id' => '<string>',
'task_id' => '<string>'
],
'source_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tags' => [
'<string>'
],
'valid_until' => '2023-11-07T05:31:56Z',
'visibility' => 'source'
]),
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://{space}.{region}.api.niadra.com/v1/agent-memory/notes"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": {\n \"conversation_id\": \"<string>\",\n \"task_id\": \"<string>\"\n },\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"visibility\": \"source\"\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://{space}.{region}.api.niadra.com/v1/agent-memory/notes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": {\n \"conversation_id\": \"<string>\",\n \"task_id\": \"<string>\"\n },\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"visibility\": \"source\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/agent-memory/notes")
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 \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": {\n \"conversation_id\": \"<string>\",\n \"task_id\": \"<string>\"\n },\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"visibility\": \"source\"\n}"
response = http.request(request)
puts response.read_body{
"note": {
"body": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"kind": "procedure",
"note_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"origin": "agent",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"title": "<string>",
"version": 2,
"visibility": "source",
"evidence": {
"conversation_id": "<string>",
"task_id": "<string>"
},
"supersedes_note_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": [
"<string>"
],
"valid_until": "2023-11-07T05:31:56Z"
},
"proposal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Agent memory
Save a note
A procedure, a tool or process note, or a pitfall. Personal data is refused with 422.
POST
/
v1
/
agent-memory
/
notes
Python
# Needs the agent_memory:write scope; a note with personal data comes back refused
saved = niadra.remember(
"pitfall",
"Scheduling API",
"Dates without a time zone are refused; send the offset the customer's region uses.",
tags=["scheduling"],
)
if saved.error == "personal_data_in_agent_memory":
... # rewrite the note without the customer's data// Needs the agent_memory:write scope; a note with personal data comes back refused
const { data, error } = await niadra.remember({
kind: "pitfall",
title: "Scheduling API",
body: "Dates without a time zone are refused; send the offset the customer's region uses.",
tags: ["scheduling"],
});
if (error?.code === "personal_data_in_agent_memory") {
// rewrite the note without the customer's data
}curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/agent-memory/notes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "<string>",
"title": "<string>",
"evidence": {
"conversation_id": "<string>",
"task_id": "<string>"
},
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": [
"<string>"
],
"valid_until": "2023-11-07T05:31:56Z",
"visibility": "source"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
body: JSON.stringify('<string>'),
title: '<string>',
evidence: {conversation_id: '<string>', task_id: '<string>'},
source_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tags: ['<string>'],
valid_until: '2023-11-07T05:31:56Z',
visibility: 'source'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/agent-memory/notes', 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://{space}.{region}.api.niadra.com/v1/agent-memory/notes",
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([
'body' => '<string>',
'title' => '<string>',
'evidence' => [
'conversation_id' => '<string>',
'task_id' => '<string>'
],
'source_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tags' => [
'<string>'
],
'valid_until' => '2023-11-07T05:31:56Z',
'visibility' => 'source'
]),
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://{space}.{region}.api.niadra.com/v1/agent-memory/notes"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": {\n \"conversation_id\": \"<string>\",\n \"task_id\": \"<string>\"\n },\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"visibility\": \"source\"\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://{space}.{region}.api.niadra.com/v1/agent-memory/notes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": {\n \"conversation_id\": \"<string>\",\n \"task_id\": \"<string>\"\n },\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"visibility\": \"source\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/agent-memory/notes")
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 \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": {\n \"conversation_id\": \"<string>\",\n \"task_id\": \"<string>\"\n },\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"visibility\": \"source\"\n}"
response = http.request(request)
puts response.read_body{
"note": {
"body": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"kind": "procedure",
"note_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"origin": "agent",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"title": "<string>",
"version": 2,
"visibility": "source",
"evidence": {
"conversation_id": "<string>",
"task_id": "<string>"
},
"supersedes_note_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": [
"<string>"
],
"valid_until": "2023-11-07T05:31:56Z"
},
"proposal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Authorizations
sourceKeypersonToken
nia_sk_...
Body
application/json
Required string length:
1 - 2000Available options:
procedure, tool_note, process_note, pitfall Required string length:
1 - 120Where the note came from: an id only, never the text of the conversation or task.
Show child attributes
Show child attributes
The owning agent. A source key writes its own notes and may omit it; a person names it.
Maximum array length:
8Pattern:
^[a-z0-9][a-z0-9_.:-]{0,63}$Available options:
source, vendor, space Response
The note, or the proposal_id of the proposal waiting for a person.

