Event catalogue
Route events by type and check the revision of the run.
| Type | When it is emitted |
|---|---|
| com.rdcopilot.ai.run.waiting_for_approval.v1 | The offer draft is ready for a reviewer. |
| com.rdcopilot.ai.run.done.v1 | The dispatch has a receipt. |
| com.rdcopilot.ai.run.failed.v1 | Preparation or dispatch failed; inspect the reason. |
| com.rdcopilot.ai.run.rejected.v1 | The reviewer rejected the draft. |
Use aggregateId to read the run, and aggregateRevision to avoid applying an older update. Deduplicate deliveries by id.
curl
curl "$RDC_BASE_URL/ai/v1/events" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/ai/v1/events`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/ai/v1/events',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/ai/v1/events');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/ai/v1/events");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"items": [
{
"specversion": "1.0",
"id": "5ec69550-f3fa-43b1-af49-18e3137c4f49",
"type": "com.rdcopilot.ai.run.done.v1",
"source": "/ai/v1/tasks/runs",
"time": "2026-11-19T11:00:00Z",
"customerOrgId": "brumar",
"legalCompanyId": "brumar-distributie",
"aggregateType": "run",
"aggregateId": "run-1042",
"aggregateRevision": 3,
"correlationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
"causationId": "423a61ed-2ea7-40fd-a31e-da3baa387eac",
"actor": {
"id": "ana-rusu",
"type": "user"
},
"data": {
"status": "done",
"receiptId": "offer-1042"
},
"state": "parked"
}
],
"nextCursor": null
}