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

# Real-time Tracking WebSocket

> Establish a WebSocket connection to receive real-time tracking updates

Connect via WebSocket to receive instant updates about a delivery's location and status changes without polling.

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the delivery request to track
</ParamField>

## Connection

The WebSocket connection will remain open until either party closes it. The server will send updates whenever the delivery's location or status changes.

## Message Format

Updates are sent as JSON messages with the following structure:

<ResponseField name="type" type="string">
  Type of update (LOCATION\_UPDATE, STATUS\_CHANGE)
</ResponseField>

<ResponseField name="delivery_id" type="string">
  The unique identifier of the delivery request
</ResponseField>

<ResponseField name="timestamp" type="string">
  ISO 8601 timestamp when the update occurred
</ResponseField>

<ResponseField name="data" type="object">
  Update details

  <Expandable title="properties">
    <ResponseField name="status" type="string">
      Current delivery status (only for STATUS\_CHANGE events)
    </ResponseField>

    <ResponseField name="location" type="object">
      Location information (only for LOCATION\_UPDATE events)

      <Expandable title="properties">
        <ResponseField name="latitude" type="number">
          Current latitude coordinate
        </ResponseField>

        <ResponseField name="longitude" type="number">
          Current longitude coordinate
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="notes" type="string">
      Optional notes about the update
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Messages

### Location Update
