Events
Check Multiple Events
POST
/
api
/
events
cURL
curl --request POST \
--url https://eu.whitecircle.com/api/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'whitecircle-version: <whitecircle-version>' \
--data '
{
"environment_id": "<string>",
"events": [
{
"role": "<string>",
"content": "<unknown>",
"delta": "<unknown>",
"arguments": "<unknown>",
"output": "<unknown>",
"definition": "<unknown>",
"input": "<unknown>",
"instructions": "<unknown>",
"state": "<unknown>",
"event_id": "<string>",
"run_id": "<string>",
"external_session_id": "<string>",
"parent_event_id": "<string>",
"links": [
{
"event_id": "<string>",
"run_id": "<string>"
}
],
"external_artifact_id": "<string>",
"name": "<string>",
"call_id": "<string>",
"stream_id": "<string>",
"sequence": 123,
"format": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"metadata": "<unknown>"
}
],
"run_id": "<string>",
"external_session_id": "<string>",
"role": "<string>"
}
'import requests
url = "https://eu.whitecircle.com/api/events"
payload = {
"environment_id": "<string>",
"events": [
{
"role": "<string>",
"content": "<unknown>",
"delta": "<unknown>",
"arguments": "<unknown>",
"output": "<unknown>",
"definition": "<unknown>",
"input": "<unknown>",
"instructions": "<unknown>",
"state": "<unknown>",
"event_id": "<string>",
"run_id": "<string>",
"external_session_id": "<string>",
"parent_event_id": "<string>",
"links": [
{
"event_id": "<string>",
"run_id": "<string>"
}
],
"external_artifact_id": "<string>",
"name": "<string>",
"call_id": "<string>",
"stream_id": "<string>",
"sequence": 123,
"format": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"metadata": "<unknown>"
}
],
"run_id": "<string>",
"external_session_id": "<string>",
"role": "<string>"
}
headers = {
"whitecircle-version": "<whitecircle-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'whitecircle-version': '<whitecircle-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
environment_id: '<string>',
events: [
{
role: '<string>',
content: '<unknown>',
delta: '<unknown>',
arguments: '<unknown>',
output: '<unknown>',
definition: '<unknown>',
input: '<unknown>',
instructions: '<unknown>',
state: '<unknown>',
event_id: '<string>',
run_id: '<string>',
external_session_id: '<string>',
parent_event_id: '<string>',
links: [{event_id: '<string>', run_id: '<string>'}],
external_artifact_id: '<string>',
name: '<string>',
call_id: '<string>',
stream_id: '<string>',
sequence: 123,
format: '<string>',
timestamp: '2023-11-07T05:31:56Z',
metadata: '<unknown>'
}
],
run_id: '<string>',
external_session_id: '<string>',
role: '<string>'
})
};
fetch('https://eu.whitecircle.com/api/events', 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://eu.whitecircle.com/api/events",
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([
'environment_id' => '<string>',
'events' => [
[
'role' => '<string>',
'content' => '<unknown>',
'delta' => '<unknown>',
'arguments' => '<unknown>',
'output' => '<unknown>',
'definition' => '<unknown>',
'input' => '<unknown>',
'instructions' => '<unknown>',
'state' => '<unknown>',
'event_id' => '<string>',
'run_id' => '<string>',
'external_session_id' => '<string>',
'parent_event_id' => '<string>',
'links' => [
[
'event_id' => '<string>',
'run_id' => '<string>'
]
],
'external_artifact_id' => '<string>',
'name' => '<string>',
'call_id' => '<string>',
'stream_id' => '<string>',
'sequence' => 123,
'format' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z',
'metadata' => '<unknown>'
]
],
'run_id' => '<string>',
'external_session_id' => '<string>',
'role' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"whitecircle-version: <whitecircle-version>"
],
]);
$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://eu.whitecircle.com/api/events"
payload := strings.NewReader("{\n \"environment_id\": \"<string>\",\n \"events\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\",\n \"delta\": \"<unknown>\",\n \"arguments\": \"<unknown>\",\n \"output\": \"<unknown>\",\n \"definition\": \"<unknown>\",\n \"input\": \"<unknown>\",\n \"instructions\": \"<unknown>\",\n \"state\": \"<unknown>\",\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"parent_event_id\": \"<string>\",\n \"links\": [\n {\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\"\n }\n ],\n \"external_artifact_id\": \"<string>\",\n \"name\": \"<string>\",\n \"call_id\": \"<string>\",\n \"stream_id\": \"<string>\",\n \"sequence\": 123,\n \"format\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"metadata\": \"<unknown>\"\n }\n ],\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"role\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("whitecircle-version", "<whitecircle-version>")
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://eu.whitecircle.com/api/events")
.header("whitecircle-version", "<whitecircle-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"environment_id\": \"<string>\",\n \"events\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\",\n \"delta\": \"<unknown>\",\n \"arguments\": \"<unknown>\",\n \"output\": \"<unknown>\",\n \"definition\": \"<unknown>\",\n \"input\": \"<unknown>\",\n \"instructions\": \"<unknown>\",\n \"state\": \"<unknown>\",\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"parent_event_id\": \"<string>\",\n \"links\": [\n {\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\"\n }\n ],\n \"external_artifact_id\": \"<string>\",\n \"name\": \"<string>\",\n \"call_id\": \"<string>\",\n \"stream_id\": \"<string>\",\n \"sequence\": 123,\n \"format\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"metadata\": \"<unknown>\"\n }\n ],\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"role\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.whitecircle.com/api/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["whitecircle-version"] = '<whitecircle-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"environment_id\": \"<string>\",\n \"events\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\",\n \"delta\": \"<unknown>\",\n \"arguments\": \"<unknown>\",\n \"output\": \"<unknown>\",\n \"definition\": \"<unknown>\",\n \"input\": \"<unknown>\",\n \"instructions\": \"<unknown>\",\n \"state\": \"<unknown>\",\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"parent_event_id\": \"<string>\",\n \"links\": [\n {\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\"\n }\n ],\n \"external_artifact_id\": \"<string>\",\n \"name\": \"<string>\",\n \"call_id\": \"<string>\",\n \"stream_id\": \"<string>\",\n \"sequence\": 123,\n \"format\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"metadata\": \"<unknown>\"\n }\n ],\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"role\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"flagged": false,
"agents": [],
"artifacts": [],
"functions": [],
"messages": [
{
"event_id": "evt_user_001",
"flagged": false,
"internal_event_id": "11111111-1111-4111-8111-111111111111",
"policies": {},
"status": "completed",
"type": "message"
}
],
"reasoning": [],
"run_id": "run_refund_123",
"tools": [
{
"event_id": "evt_tool_output_001",
"flagged": false,
"internal_event_id": "22222222-2222-4222-8222-222222222222",
"policies": {},
"status": "completed",
"type": "tool"
}
]
}Check up to 50 Events in one request. Use this endpoint when you want to submit several related pieces of an interaction together, such as a user message, a tool result, and an assistant response.
Each Event payload uses the same shape as Check One Event.
Selected Metrics run asynchronously and are not included in the synchronous typed result buckets.
See Conditions for routing behavior.
Each result includes
The second Event returns
How It Works
- You submit an
eventsarray containing 1 to 50 Event payloads - Conditions select the applicable Policies and Metrics for each Event
- White Circle evaluates Policies synchronously and queues Metrics asynchronously
- You receive one response with Policy results grouped by Event type
Batch requests preserve result order within each typed bucket, but results are grouped by type:
messages, artifacts, tools, functions, agents, and reasoning.List Events in the order they happened. Each Event is checked against the Events listed before it. See Event Context.
Example Request
curl -X POST "https://eu.whitecircle.com/api/events" \
-H "Authorization: Bearer wc-your-api-key" \
-H "Content-Type: application/json" \
-H "whitecircle-version: 2026-06-01" \
-d '{
"environment_id": "environment_123",
"run_id": "run_refund_123",
"external_session_id": "conversation_456",
"events": [
{
"type": "message",
"role": "user",
"content": "Can you refund my order?",
"event_id": "evt_user_001"
},
{
"type": "tool",
"name": "lookup_order",
"output": {
"order_id": "ord_123",
"refund_eligible": true
},
"event_id": "evt_tool_output_001"
},
{
"type": "message",
"role": "assistant",
"content": "Your order is eligible for a refund.",
"event_id": "evt_assistant_001"
}
]
}'
Request Overview
| Field | Type | Required | Description |
|---|---|---|---|
environment_id | string | ✓ | Environment to use. Required for every request. |
run_id | string | Your ID for this group of Events. Reusing it supplies context when no external_session_id is sent. Generated if omitted. Each Event can override it. | |
external_session_id | string | Your conversation or session tracking ID. Reusing it checks these Events against the previous Events of that conversation. See Event Context. Each Event can override it. | |
role | string | Role applied to message and artifact Events that do not set their own. | |
events | array | ✓ | Between 1 and 50 Event payloads. Empty arrays are rejected. |
Conditions in a Batch
Conditions are evaluated separately for each Event. Put metadata on every Event that needs metadata-based Policy selection; metadata from one Event does not apply to another Event in the same batch.{
"environment_id": "environment_123",
"events": [
{
"type": "message",
"role": "user",
"content": "Can you refund my order?",
"metadata": { "user": { "region": "eu" } }
},
{
"type": "tool",
"name": "lookup_order",
"output": { "refund_eligible": true },
"metadata": { "workflow": { "stage": "refund_review" } }
}
]
}
If no active Condition matches an Event, no Policies are evaluated and no Metrics are queued for that Event, even if another Event in the batch matched a Condition.
Response Overview
| Field | Description |
|---|---|
flagged | true if any completed Event result was flagged. |
messages | Results for message Events. |
artifacts | Results for artifact Events. |
tools | Results for tool Events. |
functions | Results for function Events. |
agents | Results for agent Events. |
reasoning | Results for reasoning Events. |
run_id | Group ID used for the batch. |
type, status, event_id, and internal_event_id, plus flagged, policies, and note when applicable. Each Policy result can include enabled_by_conditions with the Conditions that selected it.
A batch reports each verdict on its own result, because one request checks many Events. The single-Event response instead reports the verdict once at the top level. See Check One Event.
Same-Batch References
A reference-only Event can point to another Event with content in the same batch. White Circle resolves same-batch references before looking up previous results.{
"events": [
{
"type": "agent",
"state": {
"phase": "reviewing_refund"
},
"event_id": "evt_agent_state"
},
{
"type": "agent",
"event_id": "evt_agent_state"
}
],
"environment_id": "environment_123",
"run_id": "run_batch_ref"
}
referenced if the first Event completes successfully.
Referencing Existing Events
If a reference-only Event does not match an Event with content in the same batch, White Circle looks up the latest result with the samerun_id and event_id.
The reference returns:
| Status | Meaning |
|---|---|
referenced | A matching result exists and has the same Event type. |
not_found | No matching Event exists, or the latest matching Event has a different type. |
Repeated Event IDs
You can submit multiple Events with content using the sameevent_id. White Circle checks and saves each one, and each completed check receives a different internal_event_id.
Use different
event_id values when each Event should have its own application ID.Partial Failures
Some per-Event validation failures return a failed result while the rest of the batch continues. For example, an invalid inline artifact can returnstatus: "failed" while other Events are checked.
Request-level shape and relationship errors return 400 and reject the whole batch. This includes more than 50 Events, self-parenting, direct mutual parents involving a previously saved Event, and parent cycles declared within the batch.Authorizations
API Key required. Format: Bearer wc-your-api-key
Headers
API Version
Body
application/json
Required array length:
1 - 50 elementsHide child attributes
Hide child attributes
Available options:
message, artifact, tool, function, agent, reasoning Response
Success
Hide child attributes
Hide child attributes
Available options:
message, artifact, tool, function, agent, reasoning Available options:
completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Available options:
message, artifact, tool, function, agent, reasoning Available options:
completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Available options:
message, artifact, tool, function, agent, reasoning Available options:
completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Available options:
message, artifact, tool, function, agent, reasoning Available options:
completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Available options:
message, artifact, tool, function, agent, reasoning Available options:
completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Available options:
message, artifact, tool, function, agent, reasoning Available options:
completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
⌘I
cURL
curl --request POST \
--url https://eu.whitecircle.com/api/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'whitecircle-version: <whitecircle-version>' \
--data '
{
"environment_id": "<string>",
"events": [
{
"role": "<string>",
"content": "<unknown>",
"delta": "<unknown>",
"arguments": "<unknown>",
"output": "<unknown>",
"definition": "<unknown>",
"input": "<unknown>",
"instructions": "<unknown>",
"state": "<unknown>",
"event_id": "<string>",
"run_id": "<string>",
"external_session_id": "<string>",
"parent_event_id": "<string>",
"links": [
{
"event_id": "<string>",
"run_id": "<string>"
}
],
"external_artifact_id": "<string>",
"name": "<string>",
"call_id": "<string>",
"stream_id": "<string>",
"sequence": 123,
"format": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"metadata": "<unknown>"
}
],
"run_id": "<string>",
"external_session_id": "<string>",
"role": "<string>"
}
'import requests
url = "https://eu.whitecircle.com/api/events"
payload = {
"environment_id": "<string>",
"events": [
{
"role": "<string>",
"content": "<unknown>",
"delta": "<unknown>",
"arguments": "<unknown>",
"output": "<unknown>",
"definition": "<unknown>",
"input": "<unknown>",
"instructions": "<unknown>",
"state": "<unknown>",
"event_id": "<string>",
"run_id": "<string>",
"external_session_id": "<string>",
"parent_event_id": "<string>",
"links": [
{
"event_id": "<string>",
"run_id": "<string>"
}
],
"external_artifact_id": "<string>",
"name": "<string>",
"call_id": "<string>",
"stream_id": "<string>",
"sequence": 123,
"format": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"metadata": "<unknown>"
}
],
"run_id": "<string>",
"external_session_id": "<string>",
"role": "<string>"
}
headers = {
"whitecircle-version": "<whitecircle-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'whitecircle-version': '<whitecircle-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
environment_id: '<string>',
events: [
{
role: '<string>',
content: '<unknown>',
delta: '<unknown>',
arguments: '<unknown>',
output: '<unknown>',
definition: '<unknown>',
input: '<unknown>',
instructions: '<unknown>',
state: '<unknown>',
event_id: '<string>',
run_id: '<string>',
external_session_id: '<string>',
parent_event_id: '<string>',
links: [{event_id: '<string>', run_id: '<string>'}],
external_artifact_id: '<string>',
name: '<string>',
call_id: '<string>',
stream_id: '<string>',
sequence: 123,
format: '<string>',
timestamp: '2023-11-07T05:31:56Z',
metadata: '<unknown>'
}
],
run_id: '<string>',
external_session_id: '<string>',
role: '<string>'
})
};
fetch('https://eu.whitecircle.com/api/events', 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://eu.whitecircle.com/api/events",
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([
'environment_id' => '<string>',
'events' => [
[
'role' => '<string>',
'content' => '<unknown>',
'delta' => '<unknown>',
'arguments' => '<unknown>',
'output' => '<unknown>',
'definition' => '<unknown>',
'input' => '<unknown>',
'instructions' => '<unknown>',
'state' => '<unknown>',
'event_id' => '<string>',
'run_id' => '<string>',
'external_session_id' => '<string>',
'parent_event_id' => '<string>',
'links' => [
[
'event_id' => '<string>',
'run_id' => '<string>'
]
],
'external_artifact_id' => '<string>',
'name' => '<string>',
'call_id' => '<string>',
'stream_id' => '<string>',
'sequence' => 123,
'format' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z',
'metadata' => '<unknown>'
]
],
'run_id' => '<string>',
'external_session_id' => '<string>',
'role' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"whitecircle-version: <whitecircle-version>"
],
]);
$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://eu.whitecircle.com/api/events"
payload := strings.NewReader("{\n \"environment_id\": \"<string>\",\n \"events\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\",\n \"delta\": \"<unknown>\",\n \"arguments\": \"<unknown>\",\n \"output\": \"<unknown>\",\n \"definition\": \"<unknown>\",\n \"input\": \"<unknown>\",\n \"instructions\": \"<unknown>\",\n \"state\": \"<unknown>\",\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"parent_event_id\": \"<string>\",\n \"links\": [\n {\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\"\n }\n ],\n \"external_artifact_id\": \"<string>\",\n \"name\": \"<string>\",\n \"call_id\": \"<string>\",\n \"stream_id\": \"<string>\",\n \"sequence\": 123,\n \"format\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"metadata\": \"<unknown>\"\n }\n ],\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"role\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("whitecircle-version", "<whitecircle-version>")
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://eu.whitecircle.com/api/events")
.header("whitecircle-version", "<whitecircle-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"environment_id\": \"<string>\",\n \"events\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\",\n \"delta\": \"<unknown>\",\n \"arguments\": \"<unknown>\",\n \"output\": \"<unknown>\",\n \"definition\": \"<unknown>\",\n \"input\": \"<unknown>\",\n \"instructions\": \"<unknown>\",\n \"state\": \"<unknown>\",\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"parent_event_id\": \"<string>\",\n \"links\": [\n {\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\"\n }\n ],\n \"external_artifact_id\": \"<string>\",\n \"name\": \"<string>\",\n \"call_id\": \"<string>\",\n \"stream_id\": \"<string>\",\n \"sequence\": 123,\n \"format\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"metadata\": \"<unknown>\"\n }\n ],\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"role\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.whitecircle.com/api/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["whitecircle-version"] = '<whitecircle-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"environment_id\": \"<string>\",\n \"events\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\",\n \"delta\": \"<unknown>\",\n \"arguments\": \"<unknown>\",\n \"output\": \"<unknown>\",\n \"definition\": \"<unknown>\",\n \"input\": \"<unknown>\",\n \"instructions\": \"<unknown>\",\n \"state\": \"<unknown>\",\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"parent_event_id\": \"<string>\",\n \"links\": [\n {\n \"event_id\": \"<string>\",\n \"run_id\": \"<string>\"\n }\n ],\n \"external_artifact_id\": \"<string>\",\n \"name\": \"<string>\",\n \"call_id\": \"<string>\",\n \"stream_id\": \"<string>\",\n \"sequence\": 123,\n \"format\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"metadata\": \"<unknown>\"\n }\n ],\n \"run_id\": \"<string>\",\n \"external_session_id\": \"<string>\",\n \"role\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"flagged": false,
"agents": [],
"artifacts": [],
"functions": [],
"messages": [
{
"event_id": "evt_user_001",
"flagged": false,
"internal_event_id": "11111111-1111-4111-8111-111111111111",
"policies": {},
"status": "completed",
"type": "message"
}
],
"reasoning": [],
"run_id": "run_refund_123",
"tools": [
{
"event_id": "evt_tool_output_001",
"flagged": false,
"internal_event_id": "22222222-2222-4222-8222-222222222222",
"policies": {},
"status": "completed",
"type": "tool"
}
]
}