Webhooks

Webhooks overview

Webhooks push events from the Tranztec Platform to a URL you control, so you do not have to poll. You register them per partner, either on one object (a specific load, tractor or driver) or on an object type (every load the partnership shares, now and in future).

Event types

typeFires whenObject types
updateThe object's fields changeany
archiveThe object is archived (an order is cancelled or completed and filed)any
gpsA new position is recordeddriver, truck, trailer, order, segment
hosA driver's duty status changesdriver
arriveA stop is arrivedorder, segment
departA stop is departedorder, segment
truckperformanceA performance summary arrives from the ELDtruck

Object types: order (customer orders), segment (carrier loads), driver, truck, trailer, carrier. See Resources and identifiers for the order-versus-load distinction.

Register on one object

TerminalCode
curl -X POST "https://carriercloud.ai/v1/webhooks/MIST/register/" \ -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \ -d '{ "type": "arrive", "cardid": "Tyc24gHSx2SHShYma", "url": "https://hooks.example.com/carriercloud" }'
JSONCode
{ "_id": "wh-6f2a1c9d" }

cardid is the object's identifier (a loadid, tractorguid, driverid). Registering the same object, type and URL twice answers 422 Webhook already exists.

Register on an object type

TerminalCode
curl -X POST "https://carriercloud.ai/v1/webhooks/MIST/type/register/" \ -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \ -d '{ "type": "gps", "cardtype": "truck", "url": "https://hooks.example.com/carriercloud/gps" }'

Answers 204. The subscription is attached to every board the partnership shares for that type and is copied onto objects created later, so new trucks report positions without a new registration. Registering the same subscription again is ignored.

Remove subscriptions

TerminalCode
# one object curl -X DELETE "https://carriercloud.ai/v1/webhooks/MIST/Tyc24gHSx2SHShYma/update" -H "Authorization: Bearer YOUR_API_KEY" # an object type curl -X DELETE "https://carriercloud.ai/v1/webhooks/MIST/type/truck/gps" -H "Authorization: Bearer YOUR_API_KEY"

Both answer 204.

Object-level removal accepts only update, archive, gps and hos; an object-level arrive, depart or truckperformance registration answers 422 Invalid type on removal. Register those three at the type level if you expect to turn them off.

Choosing between object and type

Use object-level whenUse type-level when
You care about specific loads for their lifetime (a shipper following its own orders)You want everything the partnership shares (a visibility provider, a fleet dashboard)
You want to stop receiving events when the load is doneYou want new objects covered automatically

Next: Event payloads and Delivery, retries and security.

Last modified on