ACTIONS API · WEBHOOKS

Your car — now in your code

CarStream sends your car's events to your server the moment they happen: a trip started or ended, a rule fired, the car crossed a geofence, an engine fault appeared. Signed webhooks, a never-expiring token, and samples you can run in a minute.

Event in the car A trip, a geofence, speeding, an engine fault
CarStream cloud The same instant as the phone push, it builds the event for your hooks
Your server A signed POST with the full JSON — verify the HMAC and do your thing
Your automation A Telegram bot, a smart home, a mileage sheet — anything
HOW DELIVERY WORKS

One POST — the whole event is yours

Every delivery is a JSON envelope with a unique id, the event type, your car and the data. The body is signed with your webhook's HMAC-SHA256 secret, so requests cannot be forged.

An X-CarStream-Signature on every delivery — verified in two lines of code
Answer 2xx within 10 seconds — delivered; 3 failures in a row and the hook switches itself off
A never-expiring token with one-click regeneration on the API page
POST /carstream/hook
X-CarStream-Event: trip.ended
X-CarStream-Signature: sha256=1f8ac10f…
Content-Type: application/json

{
  "type": "trip.ended",
  "car": { "name": "BMW 530d" },
  "data": {
    "distance_km": 23.4,
    "max_speed_kmh": 92,
    "duration_min": 31.5
  }
}
EVENTS

Everything your car can tell you

trip.startedThe car started moving
trip.endedTrip finished: distance, speeds, duration
violation.speedYour speed-limit rule fired
violation.camera_speedingSpeeding past a speed camera
geofence.enteredThe car entered a geofence
geofence.exitedThe car left a geofence
dtc.detectedNew engine fault codes
webhook.testVerification ping when a hook is registered
WHAT PEOPLE BUILD

Four automations you can write in an evening

Your smart home greets you

Home Assistant gets the event when your car enters the home geofence — the gate opens and the yard lights come on before you have even parked.

geofence.entered
A bot reports to the chat

After every trip a Telegram or Slack bot drops a short summary into the family or team chat: route finished, 23 km, max 92 km/h.

trip.ended
The mileage log keeps itself

Every finished trip becomes a row in Google Sheets — date, distance, duration. The report for accounting or fuel reimbursement is always ready.

trip.ended
A fleet with no surprises

A new engine fault on any car in the fleet — and a ticket with the codes is already open in your service system. The mechanic knows before the driver does.

dtc.detected
QUICK START

Your first webhook in three minutes

1
Grab your token

Open the API page in the app — the token is already waiting, inlined into ready-made samples.

2
Register your URL

One POST — and CarStream immediately checks your endpoint with a test event. Answer 200 and the hook is live.

3
Catch events

From the next trip on, everything lands on your server. Each hook's status is visible on the same page.

# register a webhook — the endpoint must answer 200 to our test POST
curl -X POST https://carstream.live/api/actions/webhooks \
  -H "Authorization: Bearer cs_live_…" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/carstream/hook"}'

Wire up your first automation