Events and subscriptions
Register an endpoint for events, read the events and their delivery state, and replay a parked event.
On this page
List events
GET /hr/v1/events
Returns the events of your subscriptions in pages, the newest first, with the state of their delivery.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
state | query | string | Nooptional | Only events in this delivery state. One of delivered, retrying, parked, replayed |
limit | query | integer | Nooptional | Records per page. Default 100 Range 1 – 500 |
cursor | query | string | Nooptional | The nextCursor of the previous page. |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | A page of records. | EventPage |
400 | The request cannot be read or breaks the contract: the JSON is malformed, a field is missing or unknown, or a type is wrong. fields names each one. | Error |
401 | The token is missing, not valid or has ended. | Error |
403 | The token does not give access to this data, or to this account. | Error |
429 | The request was refused. The code is rate_limited. | Error |
503 | The request was refused. The code is unavailable. | Error |
Request
curl
curl "$RDC_BASE_URL/hr/v1/events?limit=20" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/events?limit=20`, {
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"]}/hr/v1/events?limit=20',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/events?limit=20');
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")}/hr/v1/events?limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 200
{
"items": [
{
"id": "5e2b9c47-8d13-4a6f-b0e5-71c4a2d93f68",
"type": "com.rdcopilot.hr.leave.approved.v1",
"time": "2026-11-23T09:41:07Z",
"aggregateId": "bd9ccb68-cdef-4ec9-b852-dfa82203a948",
"state": "parked",
"attempts": 6
}
],
"nextCursor": null
} Replay an event
POST /hr/v1/events/{eventId}/replay
Sends a parked event again, with the same id, to the subscriptions it belongs to.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
eventId | path | string (uuid) | Yesrequired | The event. |
Request body
| Field | Type | Required | Meaning |
|---|---|---|---|
operationId | string (uuid) | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
Responses
| Status | Meaning | Body |
|---|---|---|
202 | The change was accepted. The body is the operation result. | OperationResult |
400 | The request cannot be read or breaks the contract: the JSON is malformed, a field is missing or unknown, or a type is wrong. fields names each one. | Error |
401 | The token is missing, not valid or has ended. | Error |
403 | The token does not give access to this data, or to this account. | Error |
404 | The request was refused. The code is event_not_found. | Error |
409 | The request was refused. The code is operation_reused. | Error |
429 | The request was refused. The code is rate_limited. | Error |
503 | The request was refused. The code is unavailable. | Error |
Request
curl
curl -X POST "$RDC_BASE_URL/hr/v1/events/5e2b9c47-8d13-4a6f-b0e5-71c4a2d93f68/replay" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "ef97144c-6435-4b7c-ac45-cde5a83a855e"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/events/5e2b9c47-8d13-4a6f-b0e5-71c4a2d93f68/replay`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "ef97144c-6435-4b7c-ac45-cde5a83a855e"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/hr/v1/events/5e2b9c47-8d13-4a6f-b0e5-71c4a2d93f68/replay',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': 'ef97144c-6435-4b7c-ac45-cde5a83a855e',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "ef97144c-6435-4b7c-ac45-cde5a83a855e"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/events/5e2b9c47-8d13-4a6f-b0e5-71c4a2d93f68/replay');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$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.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/events/5e2b9c47-8d13-4a6f-b0e5-71c4a2d93f68/replay");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "ef97144c-6435-4b7c-ac45-cde5a83a855e"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 202
{
"operationId": "ef97144c-6435-4b7c-ac45-cde5a83a855e",
"status": "accepted",
"aggregateRevision": 1
} Create a subscription
POST /hr/v1/subscriptions
Registers an HTTPS endpoint of yours for the event types you name. Every delivery is signed with the secret of the subscription; the answer carries the secret once.
Request body
| Field | Type | Required | Meaning |
|---|---|---|---|
operationId | string (uuid) | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
endpoint | string | Yesrequired | The HTTPS address that receives the events. It has 10 seconds to answer a delivery with a 2xx status. |
eventTypes | string[] | Yesrequired | The event types to send, for example com.rdcopilot.hr.leave.approved.v1. |
Responses
| Status | Meaning | Body |
|---|---|---|
202 | The change was accepted. The body is the operation result and secret, the signing secret of the subscription. It is returned in this answer only. | SecretOperationResult |
400 | The request cannot be read or breaks the contract: the JSON is malformed, a field is missing or unknown, or a type is wrong. fields names each one. | Error |
401 | The token is missing, not valid or has ended. | Error |
403 | The token does not give access to this data, or to this account. | Error |
409 | The request was refused. The code is operation_reused. | Error |
429 | The request was refused. The code is rate_limited. | Error |
503 | The request was refused. The code is unavailable. | Error |
Request
curl
curl -X POST "$RDC_BASE_URL/hr/v1/subscriptions" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "2668f2ad-b620-4e09-b0d3-1cf5572b8487",
"endpoint": "https://hooks.brumar.example/hr",
"eventTypes": [
"com.rdcopilot.hr.leave.approved.v1",
"com.rdcopilot.hr.leave.cancelled.v1"
]
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/subscriptions`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "2668f2ad-b620-4e09-b0d3-1cf5572b8487",
"endpoint": "https://hooks.brumar.example/hr",
"eventTypes": [
"com.rdcopilot.hr.leave.approved.v1",
"com.rdcopilot.hr.leave.cancelled.v1"
]
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/hr/v1/subscriptions',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '2668f2ad-b620-4e09-b0d3-1cf5572b8487',
'endpoint': 'https://hooks.brumar.example/hr',
'eventTypes': [
'com.rdcopilot.hr.leave.approved.v1',
'com.rdcopilot.hr.leave.cancelled.v1',
],
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "2668f2ad-b620-4e09-b0d3-1cf5572b8487",
"endpoint": "https://hooks.brumar.example/hr",
"eventTypes": [
"com.rdcopilot.hr.leave.approved.v1",
"com.rdcopilot.hr.leave.cancelled.v1"
]
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/subscriptions');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$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.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/subscriptions");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "2668f2ad-b620-4e09-b0d3-1cf5572b8487",
"endpoint": "https://hooks.brumar.example/hr",
"eventTypes": [
"com.rdcopilot.hr.leave.approved.v1",
"com.rdcopilot.hr.leave.cancelled.v1"
]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 202
{
"operationId": "2668f2ad-b620-4e09-b0d3-1cf5572b8487",
"status": "accepted",
"aggregateRevision": 1,
"secret": "whsec_MfKQ9r8GKYqrTwjFZ5E5Zp0c7yD3pJ1uVbN6xH2aLsE="
} Rotate the secret of a subscription
POST /hr/v1/subscriptions/{subscriptionId}/secret
Issues a new signing secret and returns it once. For 24 hours every delivery carries two signatures, one for each secret; after that only the new one.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
subscriptionId | path | string (uuid) | Yesrequired | The subscription. |
Request body
| Field | Type | Required | Meaning |
|---|---|---|---|
operationId | string (uuid) | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
Responses
| Status | Meaning | Body |
|---|---|---|
202 | The change was accepted. The body is the operation result and secret, the signing secret of the subscription. It is returned in this answer only. | SecretOperationResult |
401 | The token is missing, not valid or has ended. | Error |
403 | The token does not give access to this data, or to this account. | Error |
404 | The request was refused. The code is subscription_not_found. | Error |
409 | The request was refused. The code is operation_reused. | Error |
429 | The request was refused. The code is rate_limited. | Error |
503 | The request was refused. The code is unavailable. | Error |
Request
curl
curl -X POST "$RDC_BASE_URL/hr/v1/subscriptions/db227a77-1d3a-4997-a445-0266bf81f572/secret" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "9b23aa84-709f-4992-8656-95171226e049"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/subscriptions/db227a77-1d3a-4997-a445-0266bf81f572/secret`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "9b23aa84-709f-4992-8656-95171226e049"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/hr/v1/subscriptions/db227a77-1d3a-4997-a445-0266bf81f572/secret',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '9b23aa84-709f-4992-8656-95171226e049',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "9b23aa84-709f-4992-8656-95171226e049"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/subscriptions/db227a77-1d3a-4997-a445-0266bf81f572/secret');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$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.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/subscriptions/db227a77-1d3a-4997-a445-0266bf81f572/secret");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "9b23aa84-709f-4992-8656-95171226e049"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 202
{
"operationId": "9b23aa84-709f-4992-8656-95171226e049",
"status": "accepted",
"aggregateRevision": 2,
"secret": "whsec_q7RtV0eJ4mZ2yXw9cB6nLpA1sKd8HgF3uOiM5vTjNYU="
}