Change feed
The change feed of the TOVR REST API. GET /v1/events pages it with a cursor, GET /v1/events/stream pushes it as server-sent events, and webhooks POST it to your URL. Event object, event types, scopes, cursors, retention, stream frames and metering.
The change feed is the list of changes to objects your organization can see. Each event names an object and a type and carries no data from the object. Read the object through its own endpoint to see what changed.
| Endpoint | Scope | Delivers |
|---|---|---|
GET /api/v1/events | events:read | A page of events after a cursor |
GET /api/v1/events/stream | events:stream | Server-sent events, as they are recorded |
| Webhooks | webhooks:write to subscribe | A signed POST per event to your URL |
All three read the same ledger and use the same cursor.
The event object
{
"object": "event",
"id": "aev_9c3f2b10-4d5e-4f6a-8b7c-1d2e3f4a5b6c",
"type": "shipment.updated",
"created": "2026-11-16T07:42:10.233Z",
"object_type": "shipment",
"object_id": "shp_7c2e5a90-3b1d-4f6e-9a4c-8d2b1e0f5a37"
}| Field | Type | Notes |
|---|---|---|
object | "event" | |
id | string | aev_<uuid>. Stable across redeliveries. Deduplicate on it. |
type | string | See Event types. The list grows. |
created | RFC 3339 | When the change happened. Webhook bodies omit it. Do not order by it. |
object_type | string | shipment, vehicle, chain, match, quote, outreach, invoice. The list grows. |
object_id | string | The object's prefixed id. Its prefix follows object_type (shp_, veh_, chn_, mch_, qte_, otr_, inv_). |
Event types
type | object_type | Read scope | Emitted when | Refetch with |
|---|---|---|---|---|
shipment.created | shipment | shipments:read | A shipment enters your book: created, or transferred to you from another organization | GET /shipments/{id} |
shipment.updated | shipment | shipments:read | A field a reader renders changes, such as status, availability, price or visibility. A re-check that confirms a value emits nothing. | GET /shipments/{id} |
shipment.unshared | shipment | shipments:read | A shipment leaves your book. It now answers 404. | — |
quote.submitted | quote | quotes:read | A carrier bid was submitted | GET /quotes/{id} |
outreach.logged | outreach | outreach:read | An outreach interaction was recorded | GET /outreach/{id} |
vehicle.availability.changed | vehicle | vehicles:read | A vehicle's availability window was created or changed. object_id is the vehicle. | GET /vehicles/{id}/availabilities |
match.created | match | matches:read | A new pairing between two shipments exists. Sent to the owner of each side. | GET /matches/{id} |
chain.proposed | chain | chains:read | A chain is created as, or moves to, proposed | GET /chains/{id} |
chain.awarded | chain | chains:read | A chain moves to assigned, or an awarded organization is set. Sent to the chain's organization and the awarded organization. | GET /chains/{id} |
chain.expired | chain | chains:read | A chain moves to expired | GET /chains/{id} |
invoice.recorded | invoice | invoices:read | Your organization recorded a freight invoice TOVR had not seen before | GET /invoices/{id} |
A transfer between organizations emits shipment.unshared to the organization that lost the
shipment and shipment.created to the one that gained it, and no shipment.updated to either.
shipment.created and shipment.unshared together tell you which shipments are in your book.
There are no quote lifecycle events (quote.awarded and similar), no match.updated and no
invoice.updated.
invoice.recorded
| Rule | Behaviour |
|---|---|
| Fires | Once per invoice, when the record is first created |
| A correction | The ERP re-sends the same external_ref with a new amount or date: the record is updated in place, and no event is emitted |
| More transports under the same number | Added to the record's covers[], and no event is emitted |
| Market freight | An invoice against a public-market shipment belongs to no organization and emits nothing |
| Shipments | The event names the invoice. The transports are in covers[] on GET /invoices/{id}. |
Scopes
events:read and events:stream open the feed. They do not widen it: an event is included only
when the token also holds the read scope in the Event types table. Events the
token cannot read are left out, not refused. Pages stay full, has_more stays accurate,
next_cursor moves past them, and a ?type= filter for them returns no rows.
Poll the feed
GET /api/v1/events
| Parameter | Default | Values |
|---|---|---|
after | — | A cursor. Without it the feed starts at the oldest retained event. |
limit | 50 | 1–100 |
type | all | Comma list of event types. An unknown type is 422. |
curl "https://tovr.eu/api/v1/events?type=shipment.updated,shipment.unshared&limit=50" \
-H "Authorization: Bearer $TOVR_TOKEN"{
"object": "list",
"data": [
{
"object": "event",
"id": "aev_9c3f2b10-4d5e-4f6a-8b7c-1d2e3f4a5b6c",
"type": "shipment.updated",
"created": "2026-11-16T07:42:10.233Z",
"object_type": "shipment",
"object_id": "shp_7c2e5a90-3b1d-4f6e-9a4c-8d2b1e0f5a37"
}
],
"has_more": false,
"next_cursor": "pV0b3mQx1sK7hC2eT9wYfN4uLr8aZ6dG…"
}Cursors
| Rule | Value |
|---|---|
next_cursor | Never null, including on an empty page. Store it after every page and send it as after. |
| Order | The order in which events were recorded after commit. Process events in the order received. |
| Format | Opaque and encrypted: two cursors for the same position can differ. A value TOVR did not issue is 422 invalid_cursor. An empty after= is 422 validation_failed. |
| Shared | A next_cursor, a stream frame id and a webhook endpoint's replay_from are the same kind of value. |
Retention
Events are kept for 30 days. A cursor before that window answers 410 cursor_expired, not an
empty page. To recover, read the current state from the list endpoints you mirror, then continue
from the next_cursor of a new GET /events without after.
Stream the feed
GET /api/v1/events/stream
| Parameter | Values |
|---|---|
after | A cursor. Wins over Last-Event-ID. |
Last-Event-ID header | A cursor. A standard EventSource sends it on reconnect. |
type | Comma list of event types, as on GET /events |
Without a cursor the stream starts at the current head: it does not replay history. To backfill,
page GET /events first, then connect with the cursor you reached.
curl -N "https://tovr.eu/api/v1/events/stream?type=shipment.updated" \
-H "Authorization: Bearer $TOVR_TOKEN" \
-H "Accept: text/event-stream"The response is text/event-stream. Frames:
event: | data | When |
|---|---|---|
hello | {"object":"hello","cursor","types","minutes_limit","minutes_remaining"} | First frame. types is "all" or the filter. The minute fields are null on an unmetered plan. |
the event's type | The event object | For each event |
cursor | {"object":"cursor","cursor"} | The feed's position moved with no event for you |
error | {"object":"error","code","message"} | cursor_expired or quota_exceeded while connected. The stream then closes. |
event: hello
id: pV0b3mQx1sK7hC2eT9wYfN4uLr8aZ6dG…
retry: 3000
data: {"object":"hello","cursor":"pV0b3mQx1sK7hC2eT9wYfN4uLr8aZ6dG…","types":"all","minutes_limit":45000,"minutes_remaining":44987}
event: shipment.updated
id: Wm4tR8yLq0dZ6nJfH2cXs5vB1kPe7uQa…
data: {"object":"event","id":"aev_9c3f2b10-4d5e-4f6a-8b7c-1d2e3f4a5b6c","type":"shipment.updated","created":"2026-11-16T07:42:10.233Z","object_type":"shipment","object_id":"shp_7c2e5a90-3b1d-4f6e-9a4c-8d2b1e0f5a37"}
: keepalive| Property | Value |
|---|---|
| Heartbeat | A : keepalive comment every 25 s |
| Reconnect hint | retry: 3000 (3 s) |
| Resume points | The id: line appears on the last frame of each batch, and on hello and cursor frames. Store every id you receive, including those on cursor frames. |
| Delivery | At least once. A reconnect can repeat events from a batch that was cut off. It never skips one. Deduplicate on the event id. |
| Errors before connecting | 401, 402, 403, 410, 422, 429 arrive as ordinary JSON errors, not as frames |
A listener registered per event name receives nothing for a type added later. Also listen with
onmessage, or re-check the Event types list when you upgrade.
Metering
The stream is metered in connection-minutes: one when the connection opens, and one for each
further minute it stays open. The monthly allowance is per plan (Hobby 45,000, Pro 450,000,
Scale 2,000,000, Enterprise unmetered). When it runs out, open streams receive an error frame
with quota_exceeded and close, and new connections are refused with 402. GET /events is
unaffected and counts against the ordinary request quota.
Delivery rules across the three channels
GET /events | GET /events/stream | Webhooks | |
|---|---|---|---|
| Who retries | You, by polling again from the stored cursor | Your client, after retry: 3000 | TOVR: 7 attempts over about 31 hours |
| Guarantee | Every retained event, in recorded order | At least once | At least once, unordered |
| Signed | No (HTTPS and your token) | No (HTTPS and your token) | tovr-signature, HMAC-SHA256, 300 s window |
| Backfill | Yes, 30 days | No, start from a cursor | replay_from on re-enable |
The webhook retry ladder and signature are specified in Webhooks.
Handle unknown values
type and object_type are open lists. invoice was added on 2026-09-17.
- Ignore an event whose
typeorobject_typeyou do not handle. Do not throw. - Store the cursor past it anyway. A consumer that stops before saving
next_cursornever gets past the first unknown event. - If you generate a client from the OpenAPI document, let these enums accept unknown values.
Each new type is recorded in
apps/web/lib/api/versions/.
Invoices
The invoices endpoints of the TOVR REST API. GET /v1/invoices and GET /v1/invoices/{invoice_id}, scope invoices:read. The invoice record object, list parameters, lookup by ERP number and errors.
Webhooks
Webhook endpoints of the TOVR REST API. Endpoint object and its six operations, URL rules, the per-event scope rule, the delivery request and its headers, the HMAC-SHA256 signature with verification code, the retry ladder, disabling and re-enabling, and secret rotation.