Streaming

Configuring Fleet Telemetry, and receiving it with Server-Sent Events.

A shared vehicle streams the Fleet Telemetry fields in its streaming config. You receive that data on your webhook, or with Server-Sent Events.

Default config

When a customer shares a vehicle, Teslemetry applies your business's default config to it once. You set the default on the Vehicle config page, or with the API:

Curl Example
curl --request PUT --header "Authorization: Bearer {token}" --header 'Content-Type: application/json' \
  --data '{"fields":{"BatteryLevel":{"interval_seconds":300},"ChargeState":{"interval_seconds":60}}}' \
  'https://api.teslemetry.pro/api/business/config/default'

GET /api/business/config/default returns the current default, or null if none is set. Field names the API does not recognise are dropped, and listed in the response's ignoredFields.

Changing the default does not change vehicles already shared.

One vehicle's config

After a vehicle is shared, you manage its streaming yourself:

RequestEffect
GET /api/config/{vin}The vehicle's current streaming config.
PATCH /api/config/{vin}Adds or changes the fields you send, and keeps the rest.
POST /api/config/{vin}Replaces the whole config.
DELETE /api/config/{vin}Stops streaming from the vehicle.
Curl Example
curl --request PATCH --header "Authorization: Bearer {token}" --header 'Content-Type: application/json' \
  --data '{"fields":{"VehicleSpeed":{"interval_seconds":10}}}' \
  'https://api.teslemetry.pro/api/config/{vin}'

Each field takes interval_seconds, and optionally minimum_delta and resend_interval_seconds. The limits and defaults for each field are at api.teslemetry.com/fields.json.

A vehicle has one streaming config. If the customer also uses Teslemetry themselves, or shares the vehicle with another business, the same config serves everyone.

GET /api/1/vehicles/{vin}/fleet_telemetry_errors lists errors the vehicle reported while streaming.

Server-Sent Events

GET /sse/{vin} streams a vehicle's data as Server-Sent Events. GET /sse/{vin}/{field} streams a single field.

Curl Example
curl --no-buffer --header "Authorization: Bearer {token}" 'https://api.teslemetry.pro/sse/{vin}'

Use the topics query parameter to choose which event types you receive. See the API reference for the event names.