Check Multiple Events
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": "environment_123",
"run_id": "run_refund_123",
"external_session_id": "conversation_456",
"events": [
{
"type": "message",
"role": "user",
"content": "Can you refund my order 4815?",
"event_id": "evt_user_001"
},
{
"type": "tool",
"name": "lookup_order",
"output": {
"order_id": "4815",
"refund_eligible": true
},
"event_id": "evt_tool_001",
"call_id": "call_abc"
}
]
}
'import requests
url = "https://eu.whitecircle.com/api/events"
payload = {
"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 4815?",
"event_id": "evt_user_001"
},
{
"type": "tool",
"name": "lookup_order",
"output": {
"order_id": "4815",
"refund_eligible": True
},
"event_id": "evt_tool_001",
"call_id": "call_abc"
}
]
}
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: 'environment_123',
run_id: 'run_refund_123',
external_session_id: 'conversation_456',
events: [
{
type: 'message',
role: 'user',
content: 'Can you refund my order 4815?',
event_id: 'evt_user_001'
},
{
type: 'tool',
name: 'lookup_order',
output: {order_id: '4815', refund_eligible: true},
event_id: 'evt_tool_001',
call_id: 'call_abc'
}
]
})
};
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' => 'environment_123',
'run_id' => 'run_refund_123',
'external_session_id' => 'conversation_456',
'events' => [
[
'type' => 'message',
'role' => 'user',
'content' => 'Can you refund my order 4815?',
'event_id' => 'evt_user_001'
],
[
'type' => 'tool',
'name' => 'lookup_order',
'output' => [
'order_id' => '4815',
'refund_eligible' => true
],
'event_id' => 'evt_tool_001',
'call_id' => 'call_abc'
]
]
]),
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\": \"environment_123\",\n \"run_id\": \"run_refund_123\",\n \"external_session_id\": \"conversation_456\",\n \"events\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": \"Can you refund my order 4815?\",\n \"event_id\": \"evt_user_001\"\n },\n {\n \"type\": \"tool\",\n \"name\": \"lookup_order\",\n \"output\": {\n \"order_id\": \"4815\",\n \"refund_eligible\": true\n },\n \"event_id\": \"evt_tool_001\",\n \"call_id\": \"call_abc\"\n }\n ]\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\": \"environment_123\",\n \"run_id\": \"run_refund_123\",\n \"external_session_id\": \"conversation_456\",\n \"events\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": \"Can you refund my order 4815?\",\n \"event_id\": \"evt_user_001\"\n },\n {\n \"type\": \"tool\",\n \"name\": \"lookup_order\",\n \"output\": {\n \"order_id\": \"4815\",\n \"refund_eligible\": true\n },\n \"event_id\": \"evt_tool_001\",\n \"call_id\": \"call_abc\"\n }\n ]\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\": \"environment_123\",\n \"run_id\": \"run_refund_123\",\n \"external_session_id\": \"conversation_456\",\n \"events\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": \"Can you refund my order 4815?\",\n \"event_id\": \"evt_user_001\"\n },\n {\n \"type\": \"tool\",\n \"name\": \"lookup_order\",\n \"output\": {\n \"order_id\": \"4815\",\n \"refund_eligible\": true\n },\n \"event_id\": \"evt_tool_001\",\n \"call_id\": \"call_abc\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"flagged": false,
"messages": [
{
"type": "message",
"status": "completed",
"flagged": false,
"policies": {
"01930000-0000-7000-8000-000000000001": {
"flagged": false,
"name": "PII disclosure",
"enabled_by_conditions": [
{
"id": "01930000-0000-7000-8000-000000000002",
"name": "EU users"
}
]
}
},
"event_id": "evt_user_001",
"internal_event_id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890"
}
],
"artifacts": [],
"tools": [
{
"type": "tool",
"status": "completed",
"flagged": false,
"policies": {},
"note": "No policies or metrics were selected for this Event",
"event_id": "evt_tool_001",
"internal_event_id": "b2c3d4e5-f6a7-4901-bcde-f23456789012"
}
],
"functions": [],
"agents": [],
"reasoning": [],
"run_id": "run_refund_123"
}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
messages, artifacts, tools, functions, agents, and reasoning.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" } }
}
]
}
Response Overview
Each result includestype, 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.
include_shadow=true at the top level to also return shadow-mode Policies for every Event in the batch, each marked shadow: true. Shadow results never change any top-level flagged verdict.
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.
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
1 - 50 elementsHide child attributes
Hide child attributes
message, artifact, tool, function, agent, reasoning Also return shadow-policy results (each marked shadow: true). Shadow results never affect the top-level flagged/violation verdict.
Response
Success
Hide child attributes
Hide child attributes
message, artifact, tool, function, agent, reasoning completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Present and true only for shadow policies surfaced via include_shadow. A shadow result never affects the top-level verdict.
Hide child attributes
Hide child attributes
message, artifact, tool, function, agent, reasoning completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Present and true only for shadow policies surfaced via include_shadow. A shadow result never affects the top-level verdict.
Hide child attributes
Hide child attributes
message, artifact, tool, function, agent, reasoning completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Present and true only for shadow policies surfaced via include_shadow. A shadow result never affects the top-level verdict.
Hide child attributes
Hide child attributes
message, artifact, tool, function, agent, reasoning completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Present and true only for shadow policies surfaced via include_shadow. A shadow result never affects the top-level verdict.
Hide child attributes
Hide child attributes
message, artifact, tool, function, agent, reasoning completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Present and true only for shadow policies surfaced via include_shadow. A shadow result never affects the top-level verdict.
Hide child attributes
Hide child attributes
message, artifact, tool, function, agent, reasoning completed, failed, referenced, not_found Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Present and true only for shadow policies surfaced via include_shadow. A shadow result never affects the top-level verdict.
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": "environment_123",
"run_id": "run_refund_123",
"external_session_id": "conversation_456",
"events": [
{
"type": "message",
"role": "user",
"content": "Can you refund my order 4815?",
"event_id": "evt_user_001"
},
{
"type": "tool",
"name": "lookup_order",
"output": {
"order_id": "4815",
"refund_eligible": true
},
"event_id": "evt_tool_001",
"call_id": "call_abc"
}
]
}
'import requests
url = "https://eu.whitecircle.com/api/events"
payload = {
"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 4815?",
"event_id": "evt_user_001"
},
{
"type": "tool",
"name": "lookup_order",
"output": {
"order_id": "4815",
"refund_eligible": True
},
"event_id": "evt_tool_001",
"call_id": "call_abc"
}
]
}
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: 'environment_123',
run_id: 'run_refund_123',
external_session_id: 'conversation_456',
events: [
{
type: 'message',
role: 'user',
content: 'Can you refund my order 4815?',
event_id: 'evt_user_001'
},
{
type: 'tool',
name: 'lookup_order',
output: {order_id: '4815', refund_eligible: true},
event_id: 'evt_tool_001',
call_id: 'call_abc'
}
]
})
};
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' => 'environment_123',
'run_id' => 'run_refund_123',
'external_session_id' => 'conversation_456',
'events' => [
[
'type' => 'message',
'role' => 'user',
'content' => 'Can you refund my order 4815?',
'event_id' => 'evt_user_001'
],
[
'type' => 'tool',
'name' => 'lookup_order',
'output' => [
'order_id' => '4815',
'refund_eligible' => true
],
'event_id' => 'evt_tool_001',
'call_id' => 'call_abc'
]
]
]),
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\": \"environment_123\",\n \"run_id\": \"run_refund_123\",\n \"external_session_id\": \"conversation_456\",\n \"events\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": \"Can you refund my order 4815?\",\n \"event_id\": \"evt_user_001\"\n },\n {\n \"type\": \"tool\",\n \"name\": \"lookup_order\",\n \"output\": {\n \"order_id\": \"4815\",\n \"refund_eligible\": true\n },\n \"event_id\": \"evt_tool_001\",\n \"call_id\": \"call_abc\"\n }\n ]\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\": \"environment_123\",\n \"run_id\": \"run_refund_123\",\n \"external_session_id\": \"conversation_456\",\n \"events\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": \"Can you refund my order 4815?\",\n \"event_id\": \"evt_user_001\"\n },\n {\n \"type\": \"tool\",\n \"name\": \"lookup_order\",\n \"output\": {\n \"order_id\": \"4815\",\n \"refund_eligible\": true\n },\n \"event_id\": \"evt_tool_001\",\n \"call_id\": \"call_abc\"\n }\n ]\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\": \"environment_123\",\n \"run_id\": \"run_refund_123\",\n \"external_session_id\": \"conversation_456\",\n \"events\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": \"Can you refund my order 4815?\",\n \"event_id\": \"evt_user_001\"\n },\n {\n \"type\": \"tool\",\n \"name\": \"lookup_order\",\n \"output\": {\n \"order_id\": \"4815\",\n \"refund_eligible\": true\n },\n \"event_id\": \"evt_tool_001\",\n \"call_id\": \"call_abc\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"flagged": false,
"messages": [
{
"type": "message",
"status": "completed",
"flagged": false,
"policies": {
"01930000-0000-7000-8000-000000000001": {
"flagged": false,
"name": "PII disclosure",
"enabled_by_conditions": [
{
"id": "01930000-0000-7000-8000-000000000002",
"name": "EU users"
}
]
}
},
"event_id": "evt_user_001",
"internal_event_id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890"
}
],
"artifacts": [],
"tools": [
{
"type": "tool",
"status": "completed",
"flagged": false,
"policies": {},
"note": "No policies or metrics were selected for this Event",
"event_id": "evt_tool_001",
"internal_event_id": "b2c3d4e5-f6a7-4901-bcde-f23456789012"
}
],
"functions": [],
"agents": [],
"reasoning": [],
"run_id": "run_refund_123"
}