Python
# Inside a conversation, one turn from the customer's message to the agent's answer.
# The record leaves in the background, in the space's content mode; nothing here waits for Niadra.
@Niadra.tool("search_products", provenance=lambda r: [{"ref": f"product:store:{r['sku']}", "fields": r["prices"]}])
def search_products(sku: str) -> dict: ...
with niadra.conversation("wa-8812", subject=customer, agent_id="store") as conversation:
conversation.customer(text)
with conversation.turn(build=Niadra.build(prompts={"store": "v3"}, model="gpt-4.1-mini")):
context = conversation.context(include=["constraints"])
product = search_products("PX-4471") # recorded in the turn, with the objects it showed
reply = model(prompt_with(context, product))
conversation.agent(reply)// Inside a conversation, one turn from the customer's message to the agent's answer.
// The record leaves in the background, in the space's content mode; nothing here waits for Niadra.
const searchProducts = Niadra.tool("search_products", async (sku: string) => catalog.find(sku), {
provenance: (r) => [{ ref: `product:store:${r.sku}`, fields: r.prices }],
});
convo.customer(text, { idempotency_key: inbound.id });
await convo.turn({ build: Niadra.build({ prompts: { store: "v3" }, model: "gpt-4.1-mini" }) }, async () => {
const ctx = await convo.context({ include: ["constraints"] });
const product = await searchProducts("PX-4471"); // recorded in the turn, with the objects it showed
convo.agent(await model(promptWith(ctx, product)));
});curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/turns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"turns": [
{
"agent": {
"name": "<string>",
"parent_turn_id": "<string>",
"role": "<string>"
},
"started_at": "2023-11-07T05:31:56Z",
"turn_id": "<string>",
"blobs": {},
"build": {
"adapter": "<string>",
"pins": {
"assembler": "<string>",
"corpus_digest": "<string>",
"model": "<string>",
"niadra": {
"compiler": "<string>",
"pack_hash": "<string>"
},
"prompts": {},
"tool_schemas": {}
},
"sdk": "<string>"
},
"calls": [
{
"call_id": "<string>",
"applied": {
"constraints": "<string>",
"results_checked": 1,
"unverifiable": 1,
"violations": 1,
"hard_sent": [
"<string>"
]
},
"args": "<string>",
"args_hash": "<string>",
"attempt": 1,
"cache_hit": false,
"cost_units": {},
"effect_key": "<string>",
"latency_ms": 1,
"name": "<string>",
"observations": [
{
"fields": {},
"ref": "<string>",
"provenance": {
"source_observed_at": "2023-11-07T05:31:56Z",
"scope": "global"
}
}
],
"parent_call_id": "<string>",
"result_model": "<string>",
"result_ui": "<string>",
"status": "ok",
"synthetic": false,
"tokens": {
"in": 1,
"out": 1,
"cached": 0
},
"truncated": false
}
],
"claims": [
{
"category": "<string>",
"span": [
123,
123
],
"evidence": {
"anchor": "<string>",
"call_id": "<string>",
"document": "<string>",
"field": "<string>",
"ref": "<string>",
"score": 0.5
},
"role": "<string>",
"value": {
"amount": "<string>",
"date": "<string>",
"date_from": "<string>",
"date_to": "<string>",
"max": "<string>",
"min": "<string>",
"unit": "<string>"
}
}
],
"completeness": "complete",
"conversation_id": "<string>",
"coordination": [
{
"decision_id": "<string>"
}
],
"cost": {
"usd": 1
},
"effects": [
{
"key": "<string>"
}
],
"ended_at": "2023-11-07T05:31:56Z",
"fidelity": "gold",
"flags": [],
"interactions": [
{
"delivered_at": "2023-11-07T05:31:56Z",
"exposure_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"pos": 5000,
"ref": "<string>",
"shown": {}
}
],
"kind": "presented",
"list_id": "<string>",
"for": "self",
"list_kind": "results",
"method": "bridge",
"offset": 0,
"page": 1,
"parent_list_id": "<string>",
"visible_k": 50
}
],
"kind": "message",
"latency_ms": 1,
"output": {
"document": "<string>",
"event_keys": [
"<string>"
],
"handoff_id": "<string>",
"ui": "<string>"
},
"reads": [
{
"blob": "<string>",
"etag": "<string>",
"receipt_id": "<string>",
"version": "<string>"
}
],
"spec": "turn-record.v0",
"task_id": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
turns: [
{
agent: {name: '<string>', parent_turn_id: '<string>', role: '<string>'},
started_at: '2023-11-07T05:31:56Z',
turn_id: '<string>',
blobs: {},
build: {
adapter: '<string>',
pins: {
assembler: '<string>',
corpus_digest: '<string>',
model: '<string>',
niadra: {compiler: '<string>', pack_hash: '<string>'},
prompts: {},
tool_schemas: {}
},
sdk: '<string>'
},
calls: [
{
call_id: '<string>',
applied: {
constraints: '<string>',
results_checked: 1,
unverifiable: 1,
violations: 1,
hard_sent: ['<string>']
},
args: '<string>',
args_hash: '<string>',
attempt: 1,
cache_hit: false,
cost_units: {},
effect_key: '<string>',
latency_ms: 1,
name: '<string>',
observations: [
{
fields: {},
ref: '<string>',
provenance: {source_observed_at: '2023-11-07T05:31:56Z', scope: 'global'}
}
],
parent_call_id: '<string>',
result_model: '<string>',
result_ui: '<string>',
status: 'ok',
synthetic: false,
tokens: {in: 1, out: 1, cached: 0},
truncated: false
}
],
claims: [
{
category: '<string>',
span: [123, 123],
evidence: {
anchor: '<string>',
call_id: '<string>',
document: '<string>',
field: '<string>',
ref: '<string>',
score: 0.5
},
role: '<string>',
value: {
amount: '<string>',
date: '<string>',
date_from: '<string>',
date_to: '<string>',
max: '<string>',
min: '<string>',
unit: '<string>'
}
}
],
completeness: 'complete',
conversation_id: '<string>',
coordination: [{decision_id: '<string>'}],
cost: {usd: 1},
effects: [{key: '<string>'}],
ended_at: '2023-11-07T05:31:56Z',
fidelity: 'gold',
flags: [],
interactions: [
{
delivered_at: '2023-11-07T05:31:56Z',
exposure_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
items: [{pos: 5000, ref: '<string>', shown: {}}],
kind: 'presented',
list_id: '<string>',
for: 'self',
list_kind: 'results',
method: 'bridge',
offset: 0,
page: 1,
parent_list_id: '<string>',
visible_k: 50
}
],
kind: 'message',
latency_ms: 1,
output: {
document: '<string>',
event_keys: ['<string>'],
handoff_id: '<string>',
ui: '<string>'
},
reads: [
{
blob: '<string>',
etag: '<string>',
receipt_id: '<string>',
version: '<string>'
}
],
spec: 'turn-record.v0',
task_id: '<string>'
}
]
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/turns', 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",
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([
'turns' => [
[
'agent' => [
'name' => '<string>',
'parent_turn_id' => '<string>',
'role' => '<string>'
],
'started_at' => '2023-11-07T05:31:56Z',
'turn_id' => '<string>',
'blobs' => [
],
'build' => [
'adapter' => '<string>',
'pins' => [
'assembler' => '<string>',
'corpus_digest' => '<string>',
'model' => '<string>',
'niadra' => [
'compiler' => '<string>',
'pack_hash' => '<string>'
],
'prompts' => [
],
'tool_schemas' => [
]
],
'sdk' => '<string>'
],
'calls' => [
[
'call_id' => '<string>',
'applied' => [
'constraints' => '<string>',
'results_checked' => 1,
'unverifiable' => 1,
'violations' => 1,
'hard_sent' => [
'<string>'
]
],
'args' => '<string>',
'args_hash' => '<string>',
'attempt' => 1,
'cache_hit' => false,
'cost_units' => [
],
'effect_key' => '<string>',
'latency_ms' => 1,
'name' => '<string>',
'observations' => [
[
'fields' => [
],
'ref' => '<string>',
'provenance' => [
'source_observed_at' => '2023-11-07T05:31:56Z',
'scope' => 'global'
]
]
],
'parent_call_id' => '<string>',
'result_model' => '<string>',
'result_ui' => '<string>',
'status' => 'ok',
'synthetic' => false,
'tokens' => [
'in' => 1,
'out' => 1,
'cached' => 0
],
'truncated' => false
]
],
'claims' => [
[
'category' => '<string>',
'span' => [
123,
123
],
'evidence' => [
'anchor' => '<string>',
'call_id' => '<string>',
'document' => '<string>',
'field' => '<string>',
'ref' => '<string>',
'score' => 0.5
],
'role' => '<string>',
'value' => [
'amount' => '<string>',
'date' => '<string>',
'date_from' => '<string>',
'date_to' => '<string>',
'max' => '<string>',
'min' => '<string>',
'unit' => '<string>'
]
]
],
'completeness' => 'complete',
'conversation_id' => '<string>',
'coordination' => [
[
'decision_id' => '<string>'
]
],
'cost' => [
'usd' => 1
],
'effects' => [
[
'key' => '<string>'
]
],
'ended_at' => '2023-11-07T05:31:56Z',
'fidelity' => 'gold',
'flags' => [
],
'interactions' => [
[
'delivered_at' => '2023-11-07T05:31:56Z',
'exposure_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'items' => [
[
'pos' => 5000,
'ref' => '<string>',
'shown' => [
]
]
],
'kind' => 'presented',
'list_id' => '<string>',
'for' => 'self',
'list_kind' => 'results',
'method' => 'bridge',
'offset' => 0,
'page' => 1,
'parent_list_id' => '<string>',
'visible_k' => 50
]
],
'kind' => 'message',
'latency_ms' => 1,
'output' => [
'document' => '<string>',
'event_keys' => [
'<string>'
],
'handoff_id' => '<string>',
'ui' => '<string>'
],
'reads' => [
[
'blob' => '<string>',
'etag' => '<string>',
'receipt_id' => '<string>',
'version' => '<string>'
]
],
'spec' => 'turn-record.v0',
'task_id' => '<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/turns"
payload := strings.NewReader("{\n \"turns\": [\n {\n \"agent\": {\n \"name\": \"<string>\",\n \"parent_turn_id\": \"<string>\",\n \"role\": \"<string>\"\n },\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"turn_id\": \"<string>\",\n \"blobs\": {},\n \"build\": {\n \"adapter\": \"<string>\",\n \"pins\": {\n \"assembler\": \"<string>\",\n \"corpus_digest\": \"<string>\",\n \"model\": \"<string>\",\n \"niadra\": {\n \"compiler\": \"<string>\",\n \"pack_hash\": \"<string>\"\n },\n \"prompts\": {},\n \"tool_schemas\": {}\n },\n \"sdk\": \"<string>\"\n },\n \"calls\": [\n {\n \"call_id\": \"<string>\",\n \"applied\": {\n \"constraints\": \"<string>\",\n \"results_checked\": 1,\n \"unverifiable\": 1,\n \"violations\": 1,\n \"hard_sent\": [\n \"<string>\"\n ]\n },\n \"args\": \"<string>\",\n \"args_hash\": \"<string>\",\n \"attempt\": 1,\n \"cache_hit\": false,\n \"cost_units\": {},\n \"effect_key\": \"<string>\",\n \"latency_ms\": 1,\n \"name\": \"<string>\",\n \"observations\": [\n {\n \"fields\": {},\n \"ref\": \"<string>\",\n \"provenance\": {\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"scope\": \"global\"\n }\n }\n ],\n \"parent_call_id\": \"<string>\",\n \"result_model\": \"<string>\",\n \"result_ui\": \"<string>\",\n \"status\": \"ok\",\n \"synthetic\": false,\n \"tokens\": {\n \"in\": 1,\n \"out\": 1,\n \"cached\": 0\n },\n \"truncated\": false\n }\n ],\n \"claims\": [\n {\n \"category\": \"<string>\",\n \"span\": [\n 123,\n 123\n ],\n \"evidence\": {\n \"anchor\": \"<string>\",\n \"call_id\": \"<string>\",\n \"document\": \"<string>\",\n \"field\": \"<string>\",\n \"ref\": \"<string>\",\n \"score\": 0.5\n },\n \"role\": \"<string>\",\n \"value\": {\n \"amount\": \"<string>\",\n \"date\": \"<string>\",\n \"date_from\": \"<string>\",\n \"date_to\": \"<string>\",\n \"max\": \"<string>\",\n \"min\": \"<string>\",\n \"unit\": \"<string>\"\n }\n }\n ],\n \"completeness\": \"complete\",\n \"conversation_id\": \"<string>\",\n \"coordination\": [\n {\n \"decision_id\": \"<string>\"\n }\n ],\n \"cost\": {\n \"usd\": 1\n },\n \"effects\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"fidelity\": \"gold\",\n \"flags\": [],\n \"interactions\": [\n {\n \"delivered_at\": \"2023-11-07T05:31:56Z\",\n \"exposure_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"pos\": 5000,\n \"ref\": \"<string>\",\n \"shown\": {}\n }\n ],\n \"kind\": \"presented\",\n \"list_id\": \"<string>\",\n \"for\": \"self\",\n \"list_kind\": \"results\",\n \"method\": \"bridge\",\n \"offset\": 0,\n \"page\": 1,\n \"parent_list_id\": \"<string>\",\n \"visible_k\": 50\n }\n ],\n \"kind\": \"message\",\n \"latency_ms\": 1,\n \"output\": {\n \"document\": \"<string>\",\n \"event_keys\": [\n \"<string>\"\n ],\n \"handoff_id\": \"<string>\",\n \"ui\": \"<string>\"\n },\n \"reads\": [\n {\n \"blob\": \"<string>\",\n \"etag\": \"<string>\",\n \"receipt_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"spec\": \"turn-record.v0\",\n \"task_id\": \"<string>\"\n }\n ]\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"turns\": [\n {\n \"agent\": {\n \"name\": \"<string>\",\n \"parent_turn_id\": \"<string>\",\n \"role\": \"<string>\"\n },\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"turn_id\": \"<string>\",\n \"blobs\": {},\n \"build\": {\n \"adapter\": \"<string>\",\n \"pins\": {\n \"assembler\": \"<string>\",\n \"corpus_digest\": \"<string>\",\n \"model\": \"<string>\",\n \"niadra\": {\n \"compiler\": \"<string>\",\n \"pack_hash\": \"<string>\"\n },\n \"prompts\": {},\n \"tool_schemas\": {}\n },\n \"sdk\": \"<string>\"\n },\n \"calls\": [\n {\n \"call_id\": \"<string>\",\n \"applied\": {\n \"constraints\": \"<string>\",\n \"results_checked\": 1,\n \"unverifiable\": 1,\n \"violations\": 1,\n \"hard_sent\": [\n \"<string>\"\n ]\n },\n \"args\": \"<string>\",\n \"args_hash\": \"<string>\",\n \"attempt\": 1,\n \"cache_hit\": false,\n \"cost_units\": {},\n \"effect_key\": \"<string>\",\n \"latency_ms\": 1,\n \"name\": \"<string>\",\n \"observations\": [\n {\n \"fields\": {},\n \"ref\": \"<string>\",\n \"provenance\": {\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"scope\": \"global\"\n }\n }\n ],\n \"parent_call_id\": \"<string>\",\n \"result_model\": \"<string>\",\n \"result_ui\": \"<string>\",\n \"status\": \"ok\",\n \"synthetic\": false,\n \"tokens\": {\n \"in\": 1,\n \"out\": 1,\n \"cached\": 0\n },\n \"truncated\": false\n }\n ],\n \"claims\": [\n {\n \"category\": \"<string>\",\n \"span\": [\n 123,\n 123\n ],\n \"evidence\": {\n \"anchor\": \"<string>\",\n \"call_id\": \"<string>\",\n \"document\": \"<string>\",\n \"field\": \"<string>\",\n \"ref\": \"<string>\",\n \"score\": 0.5\n },\n \"role\": \"<string>\",\n \"value\": {\n \"amount\": \"<string>\",\n \"date\": \"<string>\",\n \"date_from\": \"<string>\",\n \"date_to\": \"<string>\",\n \"max\": \"<string>\",\n \"min\": \"<string>\",\n \"unit\": \"<string>\"\n }\n }\n ],\n \"completeness\": \"complete\",\n \"conversation_id\": \"<string>\",\n \"coordination\": [\n {\n \"decision_id\": \"<string>\"\n }\n ],\n \"cost\": {\n \"usd\": 1\n },\n \"effects\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"fidelity\": \"gold\",\n \"flags\": [],\n \"interactions\": [\n {\n \"delivered_at\": \"2023-11-07T05:31:56Z\",\n \"exposure_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"pos\": 5000,\n \"ref\": \"<string>\",\n \"shown\": {}\n }\n ],\n \"kind\": \"presented\",\n \"list_id\": \"<string>\",\n \"for\": \"self\",\n \"list_kind\": \"results\",\n \"method\": \"bridge\",\n \"offset\": 0,\n \"page\": 1,\n \"parent_list_id\": \"<string>\",\n \"visible_k\": 50\n }\n ],\n \"kind\": \"message\",\n \"latency_ms\": 1,\n \"output\": {\n \"document\": \"<string>\",\n \"event_keys\": [\n \"<string>\"\n ],\n \"handoff_id\": \"<string>\",\n \"ui\": \"<string>\"\n },\n \"reads\": [\n {\n \"blob\": \"<string>\",\n \"etag\": \"<string>\",\n \"receipt_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"spec\": \"turn-record.v0\",\n \"task_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/turns")
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 \"turns\": [\n {\n \"agent\": {\n \"name\": \"<string>\",\n \"parent_turn_id\": \"<string>\",\n \"role\": \"<string>\"\n },\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"turn_id\": \"<string>\",\n \"blobs\": {},\n \"build\": {\n \"adapter\": \"<string>\",\n \"pins\": {\n \"assembler\": \"<string>\",\n \"corpus_digest\": \"<string>\",\n \"model\": \"<string>\",\n \"niadra\": {\n \"compiler\": \"<string>\",\n \"pack_hash\": \"<string>\"\n },\n \"prompts\": {},\n \"tool_schemas\": {}\n },\n \"sdk\": \"<string>\"\n },\n \"calls\": [\n {\n \"call_id\": \"<string>\",\n \"applied\": {\n \"constraints\": \"<string>\",\n \"results_checked\": 1,\n \"unverifiable\": 1,\n \"violations\": 1,\n \"hard_sent\": [\n \"<string>\"\n ]\n },\n \"args\": \"<string>\",\n \"args_hash\": \"<string>\",\n \"attempt\": 1,\n \"cache_hit\": false,\n \"cost_units\": {},\n \"effect_key\": \"<string>\",\n \"latency_ms\": 1,\n \"name\": \"<string>\",\n \"observations\": [\n {\n \"fields\": {},\n \"ref\": \"<string>\",\n \"provenance\": {\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"scope\": \"global\"\n }\n }\n ],\n \"parent_call_id\": \"<string>\",\n \"result_model\": \"<string>\",\n \"result_ui\": \"<string>\",\n \"status\": \"ok\",\n \"synthetic\": false,\n \"tokens\": {\n \"in\": 1,\n \"out\": 1,\n \"cached\": 0\n },\n \"truncated\": false\n }\n ],\n \"claims\": [\n {\n \"category\": \"<string>\",\n \"span\": [\n 123,\n 123\n ],\n \"evidence\": {\n \"anchor\": \"<string>\",\n \"call_id\": \"<string>\",\n \"document\": \"<string>\",\n \"field\": \"<string>\",\n \"ref\": \"<string>\",\n \"score\": 0.5\n },\n \"role\": \"<string>\",\n \"value\": {\n \"amount\": \"<string>\",\n \"date\": \"<string>\",\n \"date_from\": \"<string>\",\n \"date_to\": \"<string>\",\n \"max\": \"<string>\",\n \"min\": \"<string>\",\n \"unit\": \"<string>\"\n }\n }\n ],\n \"completeness\": \"complete\",\n \"conversation_id\": \"<string>\",\n \"coordination\": [\n {\n \"decision_id\": \"<string>\"\n }\n ],\n \"cost\": {\n \"usd\": 1\n },\n \"effects\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"fidelity\": \"gold\",\n \"flags\": [],\n \"interactions\": [\n {\n \"delivered_at\": \"2023-11-07T05:31:56Z\",\n \"exposure_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"pos\": 5000,\n \"ref\": \"<string>\",\n \"shown\": {}\n }\n ],\n \"kind\": \"presented\",\n \"list_id\": \"<string>\",\n \"for\": \"self\",\n \"list_kind\": \"results\",\n \"method\": \"bridge\",\n \"offset\": 0,\n \"page\": 1,\n \"parent_list_id\": \"<string>\",\n \"visible_k\": 50\n }\n ],\n \"kind\": \"message\",\n \"latency_ms\": 1,\n \"output\": {\n \"document\": \"<string>\",\n \"event_keys\": [\n \"<string>\"\n ],\n \"handoff_id\": \"<string>\",\n \"ui\": \"<string>\"\n },\n \"reads\": [\n {\n \"blob\": \"<string>\",\n \"etag\": \"<string>\",\n \"receipt_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"spec\": \"turn-record.v0\",\n \"task_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": 123,
"duplicates": 123,
"errors": [
{
"code": "<string>",
"index": 123,
"detail": "<string>"
}
]
}{
"accepted": 123,
"duplicates": 123,
"errors": [
{
"code": "<string>",
"index": 123,
"detail": "<string>"
}
]
}Turn records and replay
Record turns
Up to 50 turn records per call, in zstd, gzip or plain JSON; the same turn sent twice is one turn. The turns feature.
POST
/
v1
/
turns
Python
# Inside a conversation, one turn from the customer's message to the agent's answer.
# The record leaves in the background, in the space's content mode; nothing here waits for Niadra.
@Niadra.tool("search_products", provenance=lambda r: [{"ref": f"product:store:{r['sku']}", "fields": r["prices"]}])
def search_products(sku: str) -> dict: ...
with niadra.conversation("wa-8812", subject=customer, agent_id="store") as conversation:
conversation.customer(text)
with conversation.turn(build=Niadra.build(prompts={"store": "v3"}, model="gpt-4.1-mini")):
context = conversation.context(include=["constraints"])
product = search_products("PX-4471") # recorded in the turn, with the objects it showed
reply = model(prompt_with(context, product))
conversation.agent(reply)// Inside a conversation, one turn from the customer's message to the agent's answer.
// The record leaves in the background, in the space's content mode; nothing here waits for Niadra.
const searchProducts = Niadra.tool("search_products", async (sku: string) => catalog.find(sku), {
provenance: (r) => [{ ref: `product:store:${r.sku}`, fields: r.prices }],
});
convo.customer(text, { idempotency_key: inbound.id });
await convo.turn({ build: Niadra.build({ prompts: { store: "v3" }, model: "gpt-4.1-mini" }) }, async () => {
const ctx = await convo.context({ include: ["constraints"] });
const product = await searchProducts("PX-4471"); // recorded in the turn, with the objects it showed
convo.agent(await model(promptWith(ctx, product)));
});curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/turns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"turns": [
{
"agent": {
"name": "<string>",
"parent_turn_id": "<string>",
"role": "<string>"
},
"started_at": "2023-11-07T05:31:56Z",
"turn_id": "<string>",
"blobs": {},
"build": {
"adapter": "<string>",
"pins": {
"assembler": "<string>",
"corpus_digest": "<string>",
"model": "<string>",
"niadra": {
"compiler": "<string>",
"pack_hash": "<string>"
},
"prompts": {},
"tool_schemas": {}
},
"sdk": "<string>"
},
"calls": [
{
"call_id": "<string>",
"applied": {
"constraints": "<string>",
"results_checked": 1,
"unverifiable": 1,
"violations": 1,
"hard_sent": [
"<string>"
]
},
"args": "<string>",
"args_hash": "<string>",
"attempt": 1,
"cache_hit": false,
"cost_units": {},
"effect_key": "<string>",
"latency_ms": 1,
"name": "<string>",
"observations": [
{
"fields": {},
"ref": "<string>",
"provenance": {
"source_observed_at": "2023-11-07T05:31:56Z",
"scope": "global"
}
}
],
"parent_call_id": "<string>",
"result_model": "<string>",
"result_ui": "<string>",
"status": "ok",
"synthetic": false,
"tokens": {
"in": 1,
"out": 1,
"cached": 0
},
"truncated": false
}
],
"claims": [
{
"category": "<string>",
"span": [
123,
123
],
"evidence": {
"anchor": "<string>",
"call_id": "<string>",
"document": "<string>",
"field": "<string>",
"ref": "<string>",
"score": 0.5
},
"role": "<string>",
"value": {
"amount": "<string>",
"date": "<string>",
"date_from": "<string>",
"date_to": "<string>",
"max": "<string>",
"min": "<string>",
"unit": "<string>"
}
}
],
"completeness": "complete",
"conversation_id": "<string>",
"coordination": [
{
"decision_id": "<string>"
}
],
"cost": {
"usd": 1
},
"effects": [
{
"key": "<string>"
}
],
"ended_at": "2023-11-07T05:31:56Z",
"fidelity": "gold",
"flags": [],
"interactions": [
{
"delivered_at": "2023-11-07T05:31:56Z",
"exposure_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"pos": 5000,
"ref": "<string>",
"shown": {}
}
],
"kind": "presented",
"list_id": "<string>",
"for": "self",
"list_kind": "results",
"method": "bridge",
"offset": 0,
"page": 1,
"parent_list_id": "<string>",
"visible_k": 50
}
],
"kind": "message",
"latency_ms": 1,
"output": {
"document": "<string>",
"event_keys": [
"<string>"
],
"handoff_id": "<string>",
"ui": "<string>"
},
"reads": [
{
"blob": "<string>",
"etag": "<string>",
"receipt_id": "<string>",
"version": "<string>"
}
],
"spec": "turn-record.v0",
"task_id": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
turns: [
{
agent: {name: '<string>', parent_turn_id: '<string>', role: '<string>'},
started_at: '2023-11-07T05:31:56Z',
turn_id: '<string>',
blobs: {},
build: {
adapter: '<string>',
pins: {
assembler: '<string>',
corpus_digest: '<string>',
model: '<string>',
niadra: {compiler: '<string>', pack_hash: '<string>'},
prompts: {},
tool_schemas: {}
},
sdk: '<string>'
},
calls: [
{
call_id: '<string>',
applied: {
constraints: '<string>',
results_checked: 1,
unverifiable: 1,
violations: 1,
hard_sent: ['<string>']
},
args: '<string>',
args_hash: '<string>',
attempt: 1,
cache_hit: false,
cost_units: {},
effect_key: '<string>',
latency_ms: 1,
name: '<string>',
observations: [
{
fields: {},
ref: '<string>',
provenance: {source_observed_at: '2023-11-07T05:31:56Z', scope: 'global'}
}
],
parent_call_id: '<string>',
result_model: '<string>',
result_ui: '<string>',
status: 'ok',
synthetic: false,
tokens: {in: 1, out: 1, cached: 0},
truncated: false
}
],
claims: [
{
category: '<string>',
span: [123, 123],
evidence: {
anchor: '<string>',
call_id: '<string>',
document: '<string>',
field: '<string>',
ref: '<string>',
score: 0.5
},
role: '<string>',
value: {
amount: '<string>',
date: '<string>',
date_from: '<string>',
date_to: '<string>',
max: '<string>',
min: '<string>',
unit: '<string>'
}
}
],
completeness: 'complete',
conversation_id: '<string>',
coordination: [{decision_id: '<string>'}],
cost: {usd: 1},
effects: [{key: '<string>'}],
ended_at: '2023-11-07T05:31:56Z',
fidelity: 'gold',
flags: [],
interactions: [
{
delivered_at: '2023-11-07T05:31:56Z',
exposure_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
items: [{pos: 5000, ref: '<string>', shown: {}}],
kind: 'presented',
list_id: '<string>',
for: 'self',
list_kind: 'results',
method: 'bridge',
offset: 0,
page: 1,
parent_list_id: '<string>',
visible_k: 50
}
],
kind: 'message',
latency_ms: 1,
output: {
document: '<string>',
event_keys: ['<string>'],
handoff_id: '<string>',
ui: '<string>'
},
reads: [
{
blob: '<string>',
etag: '<string>',
receipt_id: '<string>',
version: '<string>'
}
],
spec: 'turn-record.v0',
task_id: '<string>'
}
]
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/turns', 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",
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([
'turns' => [
[
'agent' => [
'name' => '<string>',
'parent_turn_id' => '<string>',
'role' => '<string>'
],
'started_at' => '2023-11-07T05:31:56Z',
'turn_id' => '<string>',
'blobs' => [
],
'build' => [
'adapter' => '<string>',
'pins' => [
'assembler' => '<string>',
'corpus_digest' => '<string>',
'model' => '<string>',
'niadra' => [
'compiler' => '<string>',
'pack_hash' => '<string>'
],
'prompts' => [
],
'tool_schemas' => [
]
],
'sdk' => '<string>'
],
'calls' => [
[
'call_id' => '<string>',
'applied' => [
'constraints' => '<string>',
'results_checked' => 1,
'unverifiable' => 1,
'violations' => 1,
'hard_sent' => [
'<string>'
]
],
'args' => '<string>',
'args_hash' => '<string>',
'attempt' => 1,
'cache_hit' => false,
'cost_units' => [
],
'effect_key' => '<string>',
'latency_ms' => 1,
'name' => '<string>',
'observations' => [
[
'fields' => [
],
'ref' => '<string>',
'provenance' => [
'source_observed_at' => '2023-11-07T05:31:56Z',
'scope' => 'global'
]
]
],
'parent_call_id' => '<string>',
'result_model' => '<string>',
'result_ui' => '<string>',
'status' => 'ok',
'synthetic' => false,
'tokens' => [
'in' => 1,
'out' => 1,
'cached' => 0
],
'truncated' => false
]
],
'claims' => [
[
'category' => '<string>',
'span' => [
123,
123
],
'evidence' => [
'anchor' => '<string>',
'call_id' => '<string>',
'document' => '<string>',
'field' => '<string>',
'ref' => '<string>',
'score' => 0.5
],
'role' => '<string>',
'value' => [
'amount' => '<string>',
'date' => '<string>',
'date_from' => '<string>',
'date_to' => '<string>',
'max' => '<string>',
'min' => '<string>',
'unit' => '<string>'
]
]
],
'completeness' => 'complete',
'conversation_id' => '<string>',
'coordination' => [
[
'decision_id' => '<string>'
]
],
'cost' => [
'usd' => 1
],
'effects' => [
[
'key' => '<string>'
]
],
'ended_at' => '2023-11-07T05:31:56Z',
'fidelity' => 'gold',
'flags' => [
],
'interactions' => [
[
'delivered_at' => '2023-11-07T05:31:56Z',
'exposure_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'items' => [
[
'pos' => 5000,
'ref' => '<string>',
'shown' => [
]
]
],
'kind' => 'presented',
'list_id' => '<string>',
'for' => 'self',
'list_kind' => 'results',
'method' => 'bridge',
'offset' => 0,
'page' => 1,
'parent_list_id' => '<string>',
'visible_k' => 50
]
],
'kind' => 'message',
'latency_ms' => 1,
'output' => [
'document' => '<string>',
'event_keys' => [
'<string>'
],
'handoff_id' => '<string>',
'ui' => '<string>'
],
'reads' => [
[
'blob' => '<string>',
'etag' => '<string>',
'receipt_id' => '<string>',
'version' => '<string>'
]
],
'spec' => 'turn-record.v0',
'task_id' => '<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/turns"
payload := strings.NewReader("{\n \"turns\": [\n {\n \"agent\": {\n \"name\": \"<string>\",\n \"parent_turn_id\": \"<string>\",\n \"role\": \"<string>\"\n },\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"turn_id\": \"<string>\",\n \"blobs\": {},\n \"build\": {\n \"adapter\": \"<string>\",\n \"pins\": {\n \"assembler\": \"<string>\",\n \"corpus_digest\": \"<string>\",\n \"model\": \"<string>\",\n \"niadra\": {\n \"compiler\": \"<string>\",\n \"pack_hash\": \"<string>\"\n },\n \"prompts\": {},\n \"tool_schemas\": {}\n },\n \"sdk\": \"<string>\"\n },\n \"calls\": [\n {\n \"call_id\": \"<string>\",\n \"applied\": {\n \"constraints\": \"<string>\",\n \"results_checked\": 1,\n \"unverifiable\": 1,\n \"violations\": 1,\n \"hard_sent\": [\n \"<string>\"\n ]\n },\n \"args\": \"<string>\",\n \"args_hash\": \"<string>\",\n \"attempt\": 1,\n \"cache_hit\": false,\n \"cost_units\": {},\n \"effect_key\": \"<string>\",\n \"latency_ms\": 1,\n \"name\": \"<string>\",\n \"observations\": [\n {\n \"fields\": {},\n \"ref\": \"<string>\",\n \"provenance\": {\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"scope\": \"global\"\n }\n }\n ],\n \"parent_call_id\": \"<string>\",\n \"result_model\": \"<string>\",\n \"result_ui\": \"<string>\",\n \"status\": \"ok\",\n \"synthetic\": false,\n \"tokens\": {\n \"in\": 1,\n \"out\": 1,\n \"cached\": 0\n },\n \"truncated\": false\n }\n ],\n \"claims\": [\n {\n \"category\": \"<string>\",\n \"span\": [\n 123,\n 123\n ],\n \"evidence\": {\n \"anchor\": \"<string>\",\n \"call_id\": \"<string>\",\n \"document\": \"<string>\",\n \"field\": \"<string>\",\n \"ref\": \"<string>\",\n \"score\": 0.5\n },\n \"role\": \"<string>\",\n \"value\": {\n \"amount\": \"<string>\",\n \"date\": \"<string>\",\n \"date_from\": \"<string>\",\n \"date_to\": \"<string>\",\n \"max\": \"<string>\",\n \"min\": \"<string>\",\n \"unit\": \"<string>\"\n }\n }\n ],\n \"completeness\": \"complete\",\n \"conversation_id\": \"<string>\",\n \"coordination\": [\n {\n \"decision_id\": \"<string>\"\n }\n ],\n \"cost\": {\n \"usd\": 1\n },\n \"effects\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"fidelity\": \"gold\",\n \"flags\": [],\n \"interactions\": [\n {\n \"delivered_at\": \"2023-11-07T05:31:56Z\",\n \"exposure_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"pos\": 5000,\n \"ref\": \"<string>\",\n \"shown\": {}\n }\n ],\n \"kind\": \"presented\",\n \"list_id\": \"<string>\",\n \"for\": \"self\",\n \"list_kind\": \"results\",\n \"method\": \"bridge\",\n \"offset\": 0,\n \"page\": 1,\n \"parent_list_id\": \"<string>\",\n \"visible_k\": 50\n }\n ],\n \"kind\": \"message\",\n \"latency_ms\": 1,\n \"output\": {\n \"document\": \"<string>\",\n \"event_keys\": [\n \"<string>\"\n ],\n \"handoff_id\": \"<string>\",\n \"ui\": \"<string>\"\n },\n \"reads\": [\n {\n \"blob\": \"<string>\",\n \"etag\": \"<string>\",\n \"receipt_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"spec\": \"turn-record.v0\",\n \"task_id\": \"<string>\"\n }\n ]\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"turns\": [\n {\n \"agent\": {\n \"name\": \"<string>\",\n \"parent_turn_id\": \"<string>\",\n \"role\": \"<string>\"\n },\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"turn_id\": \"<string>\",\n \"blobs\": {},\n \"build\": {\n \"adapter\": \"<string>\",\n \"pins\": {\n \"assembler\": \"<string>\",\n \"corpus_digest\": \"<string>\",\n \"model\": \"<string>\",\n \"niadra\": {\n \"compiler\": \"<string>\",\n \"pack_hash\": \"<string>\"\n },\n \"prompts\": {},\n \"tool_schemas\": {}\n },\n \"sdk\": \"<string>\"\n },\n \"calls\": [\n {\n \"call_id\": \"<string>\",\n \"applied\": {\n \"constraints\": \"<string>\",\n \"results_checked\": 1,\n \"unverifiable\": 1,\n \"violations\": 1,\n \"hard_sent\": [\n \"<string>\"\n ]\n },\n \"args\": \"<string>\",\n \"args_hash\": \"<string>\",\n \"attempt\": 1,\n \"cache_hit\": false,\n \"cost_units\": {},\n \"effect_key\": \"<string>\",\n \"latency_ms\": 1,\n \"name\": \"<string>\",\n \"observations\": [\n {\n \"fields\": {},\n \"ref\": \"<string>\",\n \"provenance\": {\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"scope\": \"global\"\n }\n }\n ],\n \"parent_call_id\": \"<string>\",\n \"result_model\": \"<string>\",\n \"result_ui\": \"<string>\",\n \"status\": \"ok\",\n \"synthetic\": false,\n \"tokens\": {\n \"in\": 1,\n \"out\": 1,\n \"cached\": 0\n },\n \"truncated\": false\n }\n ],\n \"claims\": [\n {\n \"category\": \"<string>\",\n \"span\": [\n 123,\n 123\n ],\n \"evidence\": {\n \"anchor\": \"<string>\",\n \"call_id\": \"<string>\",\n \"document\": \"<string>\",\n \"field\": \"<string>\",\n \"ref\": \"<string>\",\n \"score\": 0.5\n },\n \"role\": \"<string>\",\n \"value\": {\n \"amount\": \"<string>\",\n \"date\": \"<string>\",\n \"date_from\": \"<string>\",\n \"date_to\": \"<string>\",\n \"max\": \"<string>\",\n \"min\": \"<string>\",\n \"unit\": \"<string>\"\n }\n }\n ],\n \"completeness\": \"complete\",\n \"conversation_id\": \"<string>\",\n \"coordination\": [\n {\n \"decision_id\": \"<string>\"\n }\n ],\n \"cost\": {\n \"usd\": 1\n },\n \"effects\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"fidelity\": \"gold\",\n \"flags\": [],\n \"interactions\": [\n {\n \"delivered_at\": \"2023-11-07T05:31:56Z\",\n \"exposure_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"pos\": 5000,\n \"ref\": \"<string>\",\n \"shown\": {}\n }\n ],\n \"kind\": \"presented\",\n \"list_id\": \"<string>\",\n \"for\": \"self\",\n \"list_kind\": \"results\",\n \"method\": \"bridge\",\n \"offset\": 0,\n \"page\": 1,\n \"parent_list_id\": \"<string>\",\n \"visible_k\": 50\n }\n ],\n \"kind\": \"message\",\n \"latency_ms\": 1,\n \"output\": {\n \"document\": \"<string>\",\n \"event_keys\": [\n \"<string>\"\n ],\n \"handoff_id\": \"<string>\",\n \"ui\": \"<string>\"\n },\n \"reads\": [\n {\n \"blob\": \"<string>\",\n \"etag\": \"<string>\",\n \"receipt_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"spec\": \"turn-record.v0\",\n \"task_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/turns")
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 \"turns\": [\n {\n \"agent\": {\n \"name\": \"<string>\",\n \"parent_turn_id\": \"<string>\",\n \"role\": \"<string>\"\n },\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"turn_id\": \"<string>\",\n \"blobs\": {},\n \"build\": {\n \"adapter\": \"<string>\",\n \"pins\": {\n \"assembler\": \"<string>\",\n \"corpus_digest\": \"<string>\",\n \"model\": \"<string>\",\n \"niadra\": {\n \"compiler\": \"<string>\",\n \"pack_hash\": \"<string>\"\n },\n \"prompts\": {},\n \"tool_schemas\": {}\n },\n \"sdk\": \"<string>\"\n },\n \"calls\": [\n {\n \"call_id\": \"<string>\",\n \"applied\": {\n \"constraints\": \"<string>\",\n \"results_checked\": 1,\n \"unverifiable\": 1,\n \"violations\": 1,\n \"hard_sent\": [\n \"<string>\"\n ]\n },\n \"args\": \"<string>\",\n \"args_hash\": \"<string>\",\n \"attempt\": 1,\n \"cache_hit\": false,\n \"cost_units\": {},\n \"effect_key\": \"<string>\",\n \"latency_ms\": 1,\n \"name\": \"<string>\",\n \"observations\": [\n {\n \"fields\": {},\n \"ref\": \"<string>\",\n \"provenance\": {\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"scope\": \"global\"\n }\n }\n ],\n \"parent_call_id\": \"<string>\",\n \"result_model\": \"<string>\",\n \"result_ui\": \"<string>\",\n \"status\": \"ok\",\n \"synthetic\": false,\n \"tokens\": {\n \"in\": 1,\n \"out\": 1,\n \"cached\": 0\n },\n \"truncated\": false\n }\n ],\n \"claims\": [\n {\n \"category\": \"<string>\",\n \"span\": [\n 123,\n 123\n ],\n \"evidence\": {\n \"anchor\": \"<string>\",\n \"call_id\": \"<string>\",\n \"document\": \"<string>\",\n \"field\": \"<string>\",\n \"ref\": \"<string>\",\n \"score\": 0.5\n },\n \"role\": \"<string>\",\n \"value\": {\n \"amount\": \"<string>\",\n \"date\": \"<string>\",\n \"date_from\": \"<string>\",\n \"date_to\": \"<string>\",\n \"max\": \"<string>\",\n \"min\": \"<string>\",\n \"unit\": \"<string>\"\n }\n }\n ],\n \"completeness\": \"complete\",\n \"conversation_id\": \"<string>\",\n \"coordination\": [\n {\n \"decision_id\": \"<string>\"\n }\n ],\n \"cost\": {\n \"usd\": 1\n },\n \"effects\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"fidelity\": \"gold\",\n \"flags\": [],\n \"interactions\": [\n {\n \"delivered_at\": \"2023-11-07T05:31:56Z\",\n \"exposure_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"pos\": 5000,\n \"ref\": \"<string>\",\n \"shown\": {}\n }\n ],\n \"kind\": \"presented\",\n \"list_id\": \"<string>\",\n \"for\": \"self\",\n \"list_kind\": \"results\",\n \"method\": \"bridge\",\n \"offset\": 0,\n \"page\": 1,\n \"parent_list_id\": \"<string>\",\n \"visible_k\": 50\n }\n ],\n \"kind\": \"message\",\n \"latency_ms\": 1,\n \"output\": {\n \"document\": \"<string>\",\n \"event_keys\": [\n \"<string>\"\n ],\n \"handoff_id\": \"<string>\",\n \"ui\": \"<string>\"\n },\n \"reads\": [\n {\n \"blob\": \"<string>\",\n \"etag\": \"<string>\",\n \"receipt_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"spec\": \"turn-record.v0\",\n \"task_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": 123,
"duplicates": 123,
"errors": [
{
"code": "<string>",
"index": 123,
"detail": "<string>"
}
]
}{
"accepted": 123,
"duplicates": 123,
"errors": [
{
"code": "<string>",
"index": 123,
"detail": "<string>"
}
]
}Authorizations
nia_sk_...
Body
application/json
Required array length:
1 - 50 elementsShow child attributes
Show child attributes

