Fifteen recipes.
PHP and Bash.
Every example below is a complete, runnable script. Click into one to see the PHP and Bash source side-by-side with syntax highlighting and one-click copy.
Send a single event
The minimum POST to /api/events, all fields filled in.
Send an event with a timestamp
Backdate or schedule an event with an explicit timestamp.
Batch of events in a loop
Push many events back-to-back from a single script.
Minimal event (all defaults)
The smallest valid body — every event field is optional.
Auth via request body
Send credentials in the JSON body instead of HTTP headers.
Handle 401 / 403 / 422 / network
Production-grade error handling for every failure mode.
Reusable client
A reusable PHP class and Bash function set for any script.
URL monitor (cron-ready)
Probe a URL, report response time as a number — drop into cron.
Fan-out to multiple DataStreams
Post the same event to several streams in one run.
Long-running interval reporter
A daemon that emits a heartbeat event every N seconds.
List, search, and filter
Pull events with full filter / sort / pagination.
Poll for events since a datetime
The polling pattern for a follower process.
Get a single event by ID
Retrieve one event when you already know its ID.
Update an existing event
Edit any field on an existing event.
Soft-delete an event
Mark an event deleted (recoverable, ledger-preserving).
Three setup steps.
- 1Create a DataStream in Connect — copy its UUID.
- 2Create a Token — copy its value.
- 3Create a Token Provision with API Endpoints
*(or including/api/events), Start in the past, End in the future.
Paste those values into the script before running. See the authentication section for the full validation rules.