TOVRReference

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.

EndpointScopeDelivers
GET /api/v1/eventsevents:readA page of events after a cursor
GET /api/v1/events/streamevents:streamServer-sent events, as they are recorded
Webhookswebhooks:write to subscribeA 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"
}
FieldTypeNotes
object"event"
idstringaev_<uuid>. Stable across redeliveries. Deduplicate on it.
typestringSee Event types. The list grows.
createdRFC 3339When the change happened. Webhook bodies omit it. Do not order by it.
object_typestringshipment, vehicle, chain, match, quote, outreach, invoice. The list grows.
object_idstringThe object's prefixed id. Its prefix follows object_type (shp_, veh_, chn_, mch_, qte_, otr_, inv_).

Event types

typeobject_typeRead scopeEmitted whenRefetch with
shipment.createdshipmentshipments:readA shipment enters your book: created, or transferred to you from another organizationGET /shipments/{id}
shipment.updatedshipmentshipments:readA 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.unsharedshipmentshipments:readA shipment leaves your book. It now answers 404.—
quote.submittedquotequotes:readA carrier bid was submittedGET /quotes/{id}
outreach.loggedoutreachoutreach:readAn outreach interaction was recordedGET /outreach/{id}
vehicle.availability.changedvehiclevehicles:readA vehicle's availability window was created or changed. object_id is the vehicle.GET /vehicles/{id}/availabilities
match.createdmatchmatches:readA new pairing between two shipments exists. Sent to the owner of each side.GET /matches/{id}
chain.proposedchainchains:readA chain is created as, or moves to, proposedGET /chains/{id}
chain.awardedchainchains:readA chain moves to assigned, or an awarded organization is set. Sent to the chain's organization and the awarded organization.GET /chains/{id}
chain.expiredchainchains:readA chain moves to expiredGET /chains/{id}
invoice.recordedinvoiceinvoices:readYour organization recorded a freight invoice TOVR had not seen beforeGET /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

RuleBehaviour
FiresOnce per invoice, when the record is first created
A correctionThe 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 numberAdded to the record's covers[], and no event is emitted
Market freightAn invoice against a public-market shipment belongs to no organization and emits nothing
ShipmentsThe 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

ParameterDefaultValues
after—A cursor. Without it the feed starts at the oldest retained event.
limit501–100
typeallComma 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

RuleValue
next_cursorNever null, including on an empty page. Store it after every page and send it as after.
OrderThe order in which events were recorded after commit. Process events in the order received.
FormatOpaque 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.
SharedA 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

ParameterValues
afterA cursor. Wins over Last-Event-ID.
Last-Event-ID headerA cursor. A standard EventSource sends it on reconnect.
typeComma 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:dataWhen
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 typeThe event objectFor 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
PropertyValue
HeartbeatA : keepalive comment every 25 s
Reconnect hintretry: 3000 (3 s)
Resume pointsThe 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.
DeliveryAt 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 connecting401, 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 /eventsGET /events/streamWebhooks
Who retriesYou, by polling again from the stored cursorYour client, after retry: 3000TOVR: 7 attempts over about 31 hours
GuaranteeEvery retained event, in recorded orderAt least onceAt least once, unordered
SignedNo (HTTPS and your token)No (HTTPS and your token)tovr-signature, HMAC-SHA256, 300 s window
BackfillYes, 30 daysNo, start from a cursorreplay_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.

  1. Ignore an event whose type or object_type you do not handle. Do not throw.
  2. Store the cursor past it anyway. A consumer that stops before saving next_cursor never gets past the first unknown event.
  3. 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/.

On this page