Aprovar uma proposta
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/agent-memory/proposals/{proposal_id}/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "<string>",
"tags": [
"<string>"
],
"title": "<string>"
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/agent-memory/proposals/{proposal_id}/approve"
payload = {
"body": "<string>",
"tags": ["<string>"],
"title": "<string>"
}
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({body: JSON.stringify('<string>'), tags: ['<string>'], title: '<string>'})
};
fetch('https://{space}.{region}.api.niadra.com/v1/agent-memory/proposals/{proposal_id}/approve', 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/proposals/{proposal_id}/approve",
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>',
'tags' => [
'<string>'
],
'title' => '<string>'
]),
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/proposals/{proposal_id}/approve"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\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/proposals/{proposal_id}/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/agent-memory/proposals/{proposal_id}/approve")
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 \"tags\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Memória do agente
Aprovar uma proposta
Cria a nota, com ou sem edição. Só administradores.
POST
/
v1
/
agent-memory
/
proposals
/
{proposal_id}
/
approve
Aprovar uma proposta
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/agent-memory/proposals/{proposal_id}/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "<string>",
"tags": [
"<string>"
],
"title": "<string>"
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/agent-memory/proposals/{proposal_id}/approve"
payload = {
"body": "<string>",
"tags": ["<string>"],
"title": "<string>"
}
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({body: JSON.stringify('<string>'), tags: ['<string>'], title: '<string>'})
};
fetch('https://{space}.{region}.api.niadra.com/v1/agent-memory/proposals/{proposal_id}/approve', 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/proposals/{proposal_id}/approve",
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>',
'tags' => [
'<string>'
],
'title' => '<string>'
]),
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/proposals/{proposal_id}/approve"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\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/proposals/{proposal_id}/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/agent-memory/proposals/{proposal_id}/approve")
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 \"tags\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Autorizações
sourceKeypersonToken
nia_sk_...
Parâmetros de caminho
Corpo
application/json
Uma pessoa pode editar a proposta antes de aprovar; a edição passa de novo pelo redator de dado pessoal.
Required string length:
1 - 2000Opções disponíveis:
procedure, tool_note, process_note, pitfall Maximum array length:
8Pattern:
^[a-z0-9][a-z0-9_.:-]{0,63}$Required string length:
1 - 120Opções disponíveis:
source, vendor, space Resposta
A nota criada.
source:<id> ou user:<id>.
Opções disponíveis:
procedure, tool_note, process_note, pitfall Opções disponíveis:
agent, human, distilled O agente dono da nota.
Opções disponíveis:
active, retired Intervalo obrigatório:
x >= 1Opções disponíveis:
source, vendor, space De onde a nota veio: só o id, nunca o texto da conversa ou da tarefa.
Show child attributes
Show child attributes
A versão que esta substituiu; aquela fica retired.
Depois deste momento a nota sai do bloco e da busca.

