Skip to content

Change feed

The change feed tells your system what changed in TrakIT, in the order it happened. Instead of asking again and again which work orders or entities were updated, you read a log of changes from where you left off. Each change names the work order or entity, says whether it was created, updated or deleted, and lists every field that changed with its value before and after.

The feed covers two types of object:

  • Work orders (WO): the header, the job fields each work order shows, its parties, events and data fields, services, assets, items, locations and the details of its documents.
  • Entities (ENT): customers, suppliers, agents and every other party. The entity’s details, its types, Entity Data fields, contact people, Per Company settings, credit status and the details of its documents.
Endpoint What it does
GET /api/public/changes Returns the changes after a cursor, oldest first.
GET /api/public/changes/head Returns the newest cursor, to start following from now.
GET /api/public/changes/doc Returns the current document of up to 100 work orders or entities.
GET /api/public/changes/ids Lists the work orders or entities your key may see, to load your first copy.

Ask TrakIT support for a change feed key. Support switches the change feed on for work orders, entities or both in your TrakIT, then sets up an API key with:

  • the permission cdc.read, which every change feed endpoint needs;
  • the permission cdc.wo, to read work order changes, and cdc.ent, to read entity changes;
  • the TrakIT user the key acts as. It must be an internal user who is not locked.

A key acts as only one user, so a change feed key cannot also be a vendor bill key, which acts as a supplier’s external user. Use a separate key for each.

Send the key in the APIKey header of every request, over HTTPS:

APIKey: your-api-key

A key may make at most 120 requests a minute.

The key sees what its user sees on screen.

Work orders:

  • A system administrator sees every work order. Any other user sees the work orders of the workflows assigned to them.
  • Events and data fields that the user’s roles hide are left out, both from the changes and from the documents. A change that touched only hidden fields does not reach the key at all.
  • A key that support has set to one company sees only that company’s work orders.

Entities:

  • The user needs the Read right of Entity Management, as for the entity pages. Without it, the key gets 403 permission_denied when it asks for entities.
  • A system administrator sees every entity. Any other user sees the entities the entity list shows them: those whose Responsible Company is one of the user’s companies, and those set up on the Per Company tab for one of the user’s companies and not disabled there.
  • A key that support has set to one company sees only the entities whose Responsible Company is that company.

When a work order moves to a workflow or company the key cannot see, or an entity’s Responsible Company changes to one the key cannot see, the key gets a delete for it with the reason scope. When it moves back, the key gets an update.

Every change has a sequence number, seq, that only grows. A cursor is the feed’s ID and a sequence number, written feedId:seq, for example 6f1c0e9a2b7d4f3c8e5a1b2c3d4e5f60:1520.

  • Pass the last cursor you processed as after, and you get the changes after it.
  • Every reply gives you next. Store it once you have processed the page, and pass it next time.
  • after=0 starts from the oldest change still kept.

Two cases make an old cursor unusable. The API then answers 410 Gone, and you load your copy again (see Typical flow):

error When
cursor_expired Your cursor is older than the changes TrakIT keeps. Changes are kept for 3 months unless your TrakIT is set otherwise.
feed_reset The feed restarted with a new feed ID, because the TrakIT database was restored or copied. Sequence numbers from before do not match the new feed.
  1. Call ids and keep the asOf cursor of its first page.
  2. Page through ids, and fetch the documents with doc, up to 100 at a time. Save them as your copy.
  3. Call changes with after set to the asOf cursor from step 1. Apply each change to your copy, store next, and call again. While hasMore is true, call at once; otherwise wait a little, for example 30 seconds.
  4. If changes answers 410, start again at step 1.

A change made while you load your copy may come through again in step 3. That is safe: apply changes in seq order and skip any seq you have already applied.

To follow changes from now on without loading a copy first, take the head cursor from head and start at step 3.

Each change looks like this:

{
"seq": 1521,
"at": "2026-11-04T09:15:02Z",
"type": "WO",
"id": 773284,
"ref": "ABCU1234567",
"op": "U",
"user": "JDOE",
"txid": 6157826,
"companyId": 16,
"workflowId": 104,
"paths": ["events.GATEIN", "sealNo"],
"changes": [
{ "path": "events.GATEIN.value", "old": null, "new": "2026-11-04 09:14", "at": "2026-11-04T09:14:58Z", "by": "JDOE" },
{ "path": "events.GATEIN.date", "old": null, "new": "2026-11-04T09:14:00Z", "at": "2026-11-04T09:14:58Z", "by": "JDOE" },
{ "path": "sealNo", "old": "SL1001", "new": "SL1002" }
]
}
Field Meaning
seq The change’s sequence number.
at When the change entered the feed, in UTC.
type WO for a work order, ENT for an entity.
id The work order’s or entity’s ID.
ref For a work order, the container number, or else the load ID, or else W and the ID. For an entity, its code, or else E and the ID.
op C created, U updated, D deleted.
baseline true when TrakIT does not know the values from before. This happens on an object’s first change after the feed was switched on for its type, and on an object that had not changed for longer than changes are kept. changes then lists every value as new.
reason Why the change happened, when it was not an ordinary save: scope (moved out of what the key may see), retention (removed by TrakIT’s data retention), or a label TrakIT gives some bulk work.
user The user who made the change, when TrakIT knows it.
txid The database transaction the change came from. Changes with the same txid were saved together, for example a job-level field written to every work order of a job.
companyId, workflowId The work order’s company and workflow. For an entity, companyId is its Responsible Company; an entity has no workflow.
paths The fields that changed.
changes Each value that changed, with old and new. A value added has old null; a value removed has new null. at and by say when and by whom the field was saved: for a work order’s events and data fields, and for an entity’s details, Entity Data fields, contacts, Per Company settings and credit status.
doc The object’s current document, with include=doc. For a delete, its last document.

A delete carries no changes.

Changes are captured a few seconds after they are saved, at most about 40 seconds later. If a field changes twice within those seconds, the feed can show only the overall change, from the first value to the last.

A document holds the work order’s current values. Fields with no value are left out.

Part Fields
Header id, ref, jobId, jobNo, workflowId, companyId, jobType, cargoType, incoterm, jobRemarks, status, parentWO, containerNo, loadId, typeCode, sealNo, bookingNo, commodity, weight, volume, hazardous, ownContainer, doorDelivery, customsEscort, priority, originCountry, destinationCountry, responsible, warehouseId, areaId, locationRef, estimateLocked, warehouseOut, remarks, customerRemarks, reasonId, minMargin, createdBy, createdOn, closedOn, closedBy
parties The entity IDs of customer, shipper, receiver, carrier, agent, clearingAgent, transporter, returnTransporter
events One entry per event, keyed by its code: value, date (the event time in UTC), remarks
data One entry per data field, keyed by its code: value, remarks, and where they apply valueId (the ID of a chosen entity or location), num (the value as a number), date (yyyy-MM-dd), extra
services, assets, locations Lists of IDs. Locations are in route order.
items Keyed by item ID: name, description, qty, weight, volume, serial, hsCode, reference, remarks
docs Keyed by document ID: title, fileName, size, role, uploaded, uploadedBy, cancelled, expiry. The file itself is never included.
labels Names for display: workflow, zone (the company’s time zone), parties, services, locations and fields (the names of the events and data fields). Labels never make a change.

Event and data field entries also carry at and by: when and by whom the field was last saved. na or tba is true when the value is NA or TBA.

Some things are never in the document, and so never make a change: KPIs, GPS positions, empty fields, and computed data fields unless support has switched a computed field on for the feed.

An entity’s document holds the values of its page. Fields with no value are left out.

Part Fields
Details id, code, name, localName, type, groupId, countryCode, address, contact, phone, email, financeEmail, managementEmail, whatsApp, tin, regNo, account, currency, scac, responsibleCompanyId, responsibleUser, profitCentreId, active, disabled, enableApi, notify, trackLink, template, remarks, invoiceReminderDays, approvedOn, approvedBy, createdOn, createdBy
types The IDs of the entity’s other types, from the Multi-Type tab. type is its main type.
fields One entry per field of the Entity Data tab, keyed by its code: value, remarks, and where they apply valueId, num (the value as a number) and date (yyyy-MM-dd)
contacts The people on the Contacts tab, keyed by contact ID: name, designation, phone, email, primary, active, socialUrl
companies The Per Company tab, keyed by company ID: currency, account, creditDays, taxExempt, disabled
credit The current entry of the Credit Status tab: type (none, partial or full), days, limit, currency, rating (notRated, bad, okay, good or excellent), remarks
docs The Documents tab, keyed by document ID: title, fileName, size, docType, description, active, role, companyId, status, expiry, uploaded, uploadedBy. The file itself is never included.
labels Names for display: type, group, country, responsibleCompany, responsibleUser, profitCentre, and the names of the types, companies, docTypes and fields. Labels never make a change.

Entity Data field entries, contacts, Per Company entries and credit also carry at and by: when and by whom they were last saved.

Some things are never in the document, and so never make a change: a contact’s ID number, the logo, the users on the Linked Users tab, document files, empty fields, and computed Entity Data fields unless support has switched a computed field on for the feed.

Errors come with an HTTP status and a body like this:

{ "error": "cursor_expired", "message": "This cursor is older than the changes kept - load your copy again (ids and doc) and continue from the asOf cursor" }
Status error When
400 invalid_parameter A parameter is missing or not valid. The message names it.
401 invalid_key The APIKey header is missing, or the key is disabled, not recognized or lacks cdc.read.
403 permission_denied The key lacks the type’s permission (for example cdc.wo), has no user, or its user is locked or external. For entities, also when the user lacks the Read right of Entity Management.
404 not_available The change feed is not set up on this TrakIT.
410 cursor_expired, feed_reset See Cursors.
429 rate_limited More than 120 requests in a minute.
500 server_error Something went wrong in TrakIT. Try again later.
503 not_available The change feed has not started yet.