Browse an aggregate's R2 event stream (paginated, filterable)
Returns the ordered R2 event stream for an aggregate with version-range (fromVersion/toVersion) and event-type filters, forward cursor pagination, and the latest snapshot version. type accepts the canonical aggregate type (e.g. LockAggregate) or its slug (e.g. lock). Read-only; requires dual admin auth (X-Admin-API-Key + JWT). Audit-logged.
curl -X GET "https://api.spkey.co/admin/aggregates/example_string/example_string/events?fromVersion=42&toVersion=42&type=example_string&limit=42&cursor=null" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://api.spkey.co/admin/aggregates/example_string/example_string/events?fromVersion=42&toVersion=42&type=example_string&limit=42&cursor=null"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://api.spkey.co/admin/aggregates/example_string/example_string/events?fromVersion=42&toVersion=42&type=example_string&limit=42&cursor=null", {
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.spkey.co/admin/aggregates/example_string/example_string/events?fromVersion=42&toVersion=42&type=example_string&limit=42&cursor=null", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.spkey.co/admin/aggregates/example_string/example_string/events?fromVersion=42&toVersion=42&type=example_string&limit=42&cursor=null')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-Key'] = 'YOUR_API_KEY'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"aggregateType": "example_string",
"aggregateId": "example_string",
"totalEvents": 3.14,
"snapshot": "null",
"events": [
{
"version": 3.14,
"type": "example_string",
"timestamp": "example_string",
"orgId": "example_string",
"event": "null"
}
],
"nextCursor": "null",
"filter": {
"fromVersion": "null",
"toVersion": "null",
"type": "null"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
/admin/aggregates/{type}/{id}/eventsTarget server for requests. Edit to use your own host.
Aggregate type or slug, e.g. "lock" or "LockAggregate"
Aggregate id (== state.id used for DO routing)
Only return events with version >= fromVersion (inclusive).
Only return events with version <= toVersion (inclusive).
Only return events whose type matches this exact event-type string.
Max events to return in this page (default 100).
Pagination cursor: return events with version > cursor. Use nextCursor from the previous page.
Request Preview
Response
Response will appear here after sending the request
Path Parameters
Aggregate type or slug, e.g. "lock" or "LockAggregate"
Aggregate id (== state.id used for DO routing)
Query Parameters
Only return events with version >= fromVersion (inclusive).
Only return events with version <= toVersion (inclusive).
Only return events whose type matches this exact event-type string.
Max events to return in this page (default 100).
Pagination cursor: return events with version > cursor. Use nextCursor from the previous page.