> ## Documentation Index
> Fetch the complete documentation index at: https://docs.primefreight.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook

> Webhook events and notifications

# Webhooks

Webhooks allow you to receive real-time notifications when events occur in your PrimeFreight account. Instead of polling the API for updates, webhooks will send HTTP POST requests to your specified URL when events happen.

## Webhook Events

PrimeFreight sends webhook notifications for a comprehensive range of events including:

### Container Transport Events

* **container.transport.vessel\_arrived** - Vessel arrives at port
* **container.transport.vessel\_discharged** - Container discharged from vessel
* **container.transport.vessel\_loaded** - Container loaded onto vessel
* **container.transport.vessel\_departed** - Vessel departs from port
* **container.transport.vessel\_berthed** - Vessel berthed at terminal
* **container.transport.rail\_departed** - Container departs by rail
* **container.transport.rail\_arrived** - Container arrives by rail
* **container.transport.rail\_loaded** - Container loaded onto rail
* **container.transport.rail\_unloaded** - Container unloaded from rail
* **container.transport.transshipment\_arrived** - Container arrives at transshipment port
* **container.transport.transshipment\_discharged** - Container discharged at transshipment
* **container.transport.transshipment\_loaded** - Container loaded at transshipment
* **container.transport.transshipment\_departed** - Container departs transshipment
* **container.transport.feeder\_arrived** - Feeder vessel arrives
* **container.transport.feeder\_discharged** - Container discharged from feeder
* **container.transport.feeder\_loaded** - Container loaded onto feeder
* **container.transport.feeder\_departed** - Feeder vessel departs
* **container.transport.empty\_out** - Container emptied out
* **container.transport.full\_in** - Container filled in
* **container.transport.full\_out** - Container filled out
* **container.transport.empty\_in** - Container emptied in
* **container.transport.arrived\_at\_inland\_destination** - Container arrived at inland destination
* **container.transport.estimated.arrived\_at\_inland\_destination** - Estimated arrival at inland destination
* **container.transport.available** - Container available for pickup

### Container Events

* **container.created** - New container created
* **container.updated** - Container information updated
* **container.pod\_terminal\_changed** - Port of discharge terminal changed
* **container.pickup\_lfd.changed** - Pickup last free day changed

### Shipment Events

* **shipment.estimated.arrival** - Shipment arrival time updated

### Tracking Request Events

* **tracking\_request.succeeded** - Tracking request successfully created
* **tracking\_request.failed** - Tracking request failed
* **tracking\_request.awaiting\_manifest** - Tracking request waiting for manifest
* **tracking\_request.tracking\_stopped** - Tracking request stopped

## Webhook Payload Structure

All webhook payloads follow a consistent JSON:API structure with included related resources. Here's an example of the type of notification you would receive:

```json theme={null}
[
  {
    "data": {
      "id": "17d8ef84-eef3-4780-8c6f-ad47b7c940e2",
      "type": "webhook_notification",
      "attributes": {
        "id": "17d8ef84-eef3-4780-8c6f-ad47b7c940e2",
        "event": "container.updated",
        "delivery_status": "pending",
        "created_at": "2025-08-28T19:26:48Z"
      },
      "relationships": {
        "reference_object": {
          "data": {
            "id": "892bfc0c-0f11-4e0a-9938-fe6f932c4d04",
            "type": "container_updated_event"
          }
        },
        "webhook": {
          "data": {
            "id": "c4b6ee2c-b3a9-48b2-882f-89e3c21f998b",
            "type": "webhook"
          }
        },
        "webhook_notification_logs": {
          "data": []
        }
      }
    },
    "included": [
      {
        "id": "bd02b718-3ab3-4277-af0a-598572eeea54",
        "type": "shipment",
        "attributes": {
          "created_at": "2025-07-20T09:24:20Z",
          "ref_numbers": [],
          "tags": [],
          "bill_of_lading_number": "SEKU5970536",
          "normalized_number": "SEKU5970536",
          "shipping_line_scac": "CMDU",
          "shipping_line_name": "CMA CGM",
          "shipping_line_short_name": "CMA CGM",
          "customer_name": "Prime Freight",
          "port_of_lading_locode": "BDCGP",
          "port_of_lading_name": "Chittagong",
          "port_of_discharge_locode": "CAHAL",
          "port_of_discharge_name": "Halifax",
          "pod_vessel_name": "CMA CGM NORMA",
          "pod_vessel_imo": "9299812",
          "pod_voyage_number": "1TUERN1MA",
          "pol_etd_at": "2025-07-20T04:37:00Z",
          "pol_atd_at": "2025-07-20T01:16:28Z",
          "pol_timezone": "Asia/Dhaka",
          "pod_eta_at": "2025-08-29T15:00:00Z",
          "pod_timezone": "America/New_York"
        }
      },
      {
        "id": "12b8f16e-f74c-457f-aa28-9262336e10d1",
        "type": "container",
        "attributes": {
          "number": "SEKU5970536",
          "created_at": "2025-07-20T09:24:21Z",
          "ref_numbers": [],
          "current_status": "on_ship",
          "equipment_type": "dry",
          "equipment_length": 40,
          "equipment_height": "high_cube",
          "holds_at_pod_terminal": [
            {
              "status": "pending",
              "name": "customs",
              "description": "NONE"
            }
          ],
          "available_for_pickup": false,
          "location_at_pod_terminal": "VESSEL 01404086",
          "terminal_checked_at": "2025-08-28T19:26:48Z"
        }
      },
      {
        "id": "892bfc0c-0f11-4e0a-9938-fe6f932c4d04",
        "type": "container_updated_event",
        "attributes": {
          "changeset": {
            "holds_at_pod_terminal": [
              [
                {
                  "name": "freight",
                  "status": "pending",
                  "description": "NONE"
                },
                {
                  "name": "customs",
                  "status": "pending",
                  "description": "NONE"
                }
              ],
              [
                {
                  "name": "customs",
                  "status": "pending",
                  "description": "NONE"
                }
              ]
            ]
          },
          "timestamp": "2025-08-28T19:26:48Z",
          "data_source": "terminal",
          "timezone": "America/New_York"
        }
      }
    ]
  }
]
```

<Note>
  Webhook notifications are only sent if you have at least one active webhook configured in your account.
</Note>
