Search turns
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/turns/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": "<string>",
"conversation_id": "<string>",
"cursor": "<string>",
"flags": [],
"limit": 50,
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/turns/search"
payload = {
"agent": "<string>",
"conversation_id": "<string>",
"cursor": "<string>",
"flags": [],
"limit": 50,
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z"
}
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({
agent: '<string>',
conversation_id: '<string>',
cursor: '<string>',
flags: [],
limit: 50,
since: '2023-11-07T05:31:56Z',
until: '2023-11-07T05:31:56Z'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/turns/search', 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/turns/search",
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([
'agent' => '<string>',
'conversation_id' => '<string>',
'cursor' => '<string>',
'flags' => [
],
'limit' => 50,
'since' => '2023-11-07T05:31:56Z',
'until' => '2023-11-07T05:31:56Z'
]),
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/turns/search"
payload := strings.NewReader("{\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"cursor\": \"<string>\",\n \"flags\": [],\n \"limit\": 50,\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\"\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/turns/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"cursor\": \"<string>\",\n \"flags\": [],\n \"limit\": 50,\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/turns/search")
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 \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"cursor\": \"<string>\",\n \"flags\": [],\n \"limit\": 50,\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"agent": "<string>",
"completeness": "complete",
"fidelity": "bronze",
"kind": "message",
"replayable": true,
"started_at": "2023-11-07T05:31:56Z",
"tier": "short",
"turn_id": "<string>",
"flags": [
"error"
]
}
],
"next_cursor": "<string>"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Turn records and replay
Search turns
The kept tier, newest first, by conversation, agent, time and flags; the conversation id travels in the body.
POST
/
v1
/
turns
/
search
Search turns
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/turns/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": "<string>",
"conversation_id": "<string>",
"cursor": "<string>",
"flags": [],
"limit": 50,
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/turns/search"
payload = {
"agent": "<string>",
"conversation_id": "<string>",
"cursor": "<string>",
"flags": [],
"limit": 50,
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z"
}
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({
agent: '<string>',
conversation_id: '<string>',
cursor: '<string>',
flags: [],
limit: 50,
since: '2023-11-07T05:31:56Z',
until: '2023-11-07T05:31:56Z'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/turns/search', 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/turns/search",
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([
'agent' => '<string>',
'conversation_id' => '<string>',
'cursor' => '<string>',
'flags' => [
],
'limit' => 50,
'since' => '2023-11-07T05:31:56Z',
'until' => '2023-11-07T05:31:56Z'
]),
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/turns/search"
payload := strings.NewReader("{\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"cursor\": \"<string>\",\n \"flags\": [],\n \"limit\": 50,\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\"\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/turns/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"cursor\": \"<string>\",\n \"flags\": [],\n \"limit\": 50,\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/turns/search")
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 \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"cursor\": \"<string>\",\n \"flags\": [],\n \"limit\": 50,\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"agent": "<string>",
"completeness": "complete",
"fidelity": "bronze",
"kind": "message",
"replayable": true,
"started_at": "2023-11-07T05:31:56Z",
"tier": "short",
"turn_id": "<string>",
"flags": [
"error"
]
}
],
"next_cursor": "<string>"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Authorizations
sourceKeypersonToken
nia_sk_...
Body
application/json
A search over the kept tier. The conversation id travels in the body, never in the URL.
Required string length:
1 - 256Required string length:
1 - 512Maximum string length:
200Maximum array length:
20Available options:
error, guard_acted, guard_budget_exceeded, handoff, assertion_failed, synthetic, incomplete, negative_feedback, truncated Required range:
1 <= x <= 200
