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

# List Transport Routes

> Retrieve a paginated list of transport routes with optional filtering, search, and sorting

# List Transport Routes

Retrieve all transport routes for your organization. Supports full-text search, date range filters, status filters, and sorting. The response includes a `filter_hash` you can pass to the bulk-delete-by-filters endpoint to delete all matching records at once.

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

### Query Parameters

<ParamField query="search" type="string">
  Free-text search across route names, suppliers, and addresses. Minimum 1 character, maximum 255 characters.
</ParamField>

<ParamField query="from_date" type="date">
  Filter routes with `transport_date` on or after this date (YYYY-MM-DD)
</ParamField>

<ParamField query="to_date" type="date">
  Filter routes with `transport_date` on or before this date (YYYY-MM-DD)
</ParamField>

<ParamField query="status" type="array of string">
  Filter by route status. Allowed values: `pending`, `active`, `error`. Pass multiple values to include more than one status.
</ParamField>

<ParamField query="transport_direction" type="string">
  Filter by direction: `downstream` (outbound — goods sent to customers) or `upstream` (inbound — goods received from suppliers)
</ParamField>

<ParamField query="file_id" type="array of UUID">
  Filter by the uploaded file(s) that created these routes. Pass multiple UUIDs to include routes from several files.
</ParamField>

<ParamField query="created_at_from" type="datetime">
  Filter routes created on or after this timestamp (ISO 8601)
</ParamField>

<ParamField query="created_at_to" type="datetime">
  Filter routes created on or before this timestamp (ISO 8601)
</ParamField>

<ParamField query="co2e_status" type="string">
  Filter by emission calculation state: `calculated` (co2e is present) or `not_calculated` (co2e is null)
</ParamField>

<ParamField query="supplier" type="array of string">
  Filter by supplier name (exact match). Pass multiple values to include routes from several suppliers.
</ParamField>

<ParamField query="sort" type="array of string">
  Sort fields. Prefix with `-` for descending order. Allowed fields: `name`, `start_date`, `quantity_transported`, `created_at`.

  **Example:** `-created_at` (newest first), `start_date` (oldest first)
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number (1-based)
</ParamField>

<ParamField query="size" type="integer" default="50">
  Number of results per page
</ParamField>

## Response

<ResponseField name="items" type="array">
  List of transport routes on this page. See [Route Fields](#route-fields) below.
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of routes matching the current filters (across all pages)
</ResponseField>

<ResponseField name="page" type="integer">
  Current page number
</ResponseField>

<ResponseField name="size" type="integer">
  Number of items per page
</ResponseField>

<ResponseField name="filter_hash" type="string">
  Opaque hash representing the current filter state. Pass this value to the bulk-delete-by-filters endpoint to delete all routes matching the current query without specifying IDs individually.
</ResponseField>

### Route Fields

<ResponseField name="items[].id" type="string">
  Unique identifier (UUID)
</ResponseField>

<ResponseField name="items[].name" type="string | null">
  Optional route name
</ResponseField>

<ResponseField name="items[].transport_date" type="date | null">
  Date of transport (YYYY-MM-DD). `null` if not set.
</ResponseField>

<ResponseField name="items[].quantity_transported" type="number">
  Amount transported (max 10 digits, 3 decimal places)
</ResponseField>

<ResponseField name="items[].supplier" type="string | null">
  Optional supplier name
</ResponseField>

<ResponseField name="items[].transport_direction" type="string">
  `downstream` (outbound — goods sent to customers) or `upstream` (inbound — goods received from suppliers)
</ResponseField>

<ResponseField name="items[].transport_frequency" type="string | null">
  Recurrence: `once`, `weekly`, `monthly`
</ResponseField>

<ResponseField name="items[].unit" type="object">
  Measurement unit for the quantity transported

  <Expandable title="unit fields">
    <ResponseField name="items[].unit.id" type="string">UUID of the unit</ResponseField>
    <ResponseField name="items[].unit.name" type="string">Unit name, e.g. `kilogram_(kg)`, `metric_tonne_(t)`</ResponseField>
    <ResponseField name="items[].unit.type" type="string">Unit type, e.g. `solid`, `liquid`</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="items[].co2e" type="number | null">
  Total CO2-equivalent emissions in kg across all sections. `null` if no impacts have been calculated yet.
</ResponseField>

<ResponseField name="items[].emissions" type="array">
  Route-level emissions summary: `[{"value": 245.67, "gas": "co2e", "unit_name": "kgCO2e"}]`
</ResponseField>

<ResponseField name="items[].status" type="string">
  Route status: `pending` (awaiting calculation), `active` (calculated), `error` (calculation failed)
</ResponseField>

<ResponseField name="items[].file_id" type="string | null">
  ID of the uploaded file if this route was created via bulk upload
</ResponseField>

<ResponseField name="items[].file_name" type="string | null">
  Name of the uploaded file if this route was created via bulk upload
</ResponseField>

<ResponseField name="items[].sections" type="array">
  List of transport sections (legs) for this route. See [Section Fields](#section-fields) below.
</ResponseField>

<ResponseField name="items[].uploaded_by" type="object | null">
  User who uploaded this route

  <Expandable title="uploaded_by fields">
    <ResponseField name="items[].uploaded_by.id" type="string">User ID</ResponseField>
    <ResponseField name="items[].uploaded_by.first_name" type="string | null">First name</ResponseField>
    <ResponseField name="items[].uploaded_by.last_name" type="string | null">Last name</ResponseField>
    <ResponseField name="items[].uploaded_by.profile_img_url" type="string | null">Profile image URL</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="items[].created_at" type="datetime">
  ISO 8601 creation timestamp
</ResponseField>

<ResponseField name="items[].updated_at" type="datetime">
  ISO 8601 last-update timestamp
</ResponseField>

### Section Fields

<ResponseField name="items[].sections[].id" type="string">
  Section UUID
</ResponseField>

<ResponseField name="items[].sections[].part" type="integer">
  Sequence number within the route (1-based)
</ResponseField>

<ResponseField name="items[].sections[].transport_type" type="string">
  `road`, `air`, `maritime`, `rail`, or `do_not_know`
</ResponseField>

<ResponseField name="items[].sections[].travel_method" type="string | null">
  Sub-type for road transport: `car`, `truck`, `motorbike`, `bicycle`, `electric_kick_scooter`
</ResponseField>

<ResponseField name="items[].sections[].electric" type="boolean">
  Whether the vehicle is electric
</ResponseField>

<ResponseField name="items[].sections[].refrigerated" type="boolean">
  Whether the cargo is refrigerated
</ResponseField>

<ResponseField name="items[].sections[].detail" type="string | null">
  Additional detail used for emission factor selection (e.g. distance band or weight class)
</ResponseField>

<ResponseField name="items[].sections[].origin" type="string">
  Origin location address
</ResponseField>

<ResponseField name="items[].sections[].origin_geocode" type="object | null">
  Geocoded origin location

  <Expandable title="Geographic Point">
    <ResponseField name="country_code" type="string">ISO country code</ResponseField>
    <ResponseField name="place_id" type="string">Geocoder place identifier</ResponseField>
    <ResponseField name="address_formatted" type="string">Full formatted address</ResponseField>
    <ResponseField name="latitude" type="number">Latitude</ResponseField>
    <ResponseField name="longitude" type="number">Longitude</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="items[].sections[].destination" type="string">
  Destination location address
</ResponseField>

<ResponseField name="items[].sections[].destination_geocode" type="object | null">
  Geocoded destination location

  <Expandable title="Geographic Point">
    <ResponseField name="country_code" type="string">ISO country code</ResponseField>
    <ResponseField name="place_id" type="string">Geocoder place identifier</ResponseField>
    <ResponseField name="address_formatted" type="string">Full formatted address</ResponseField>
    <ResponseField name="latitude" type="number">Latitude</ResponseField>
    <ResponseField name="longitude" type="number">Longitude</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="items[].sections[].kms" type="number | null">
  Calculated or user-provided distance in kilometers
</ResponseField>

<ResponseField name="items[].sections[].kms_manual" type="number | null">
  Distance override provided by the user (max 7 digits, 2 decimal places). Present when `distance_manual` is `true`.
</ResponseField>

<ResponseField name="items[].sections[].distance_manual" type="boolean">
  `true` when the distance was provided manually via `kms_manual` instead of being auto-calculated
</ResponseField>

<ResponseField name="items[].sections[].kms_source" type="string | null">
  Method used to compute the distance. See the [Transport Overview](/api-reference/transport/overview) for all values.
</ResponseField>

<ResponseField name="items[].sections[].status" type="string">
  Section status: `pending`, `active`, `error`
</ResponseField>

<ResponseField name="items[].sections[].step" type="string | null">
  Current processing step: `geocoding`, `impact_calculation`, `completed`
</ResponseField>

<ResponseField name="items[].sections[].error_messages" type="array | null">
  List of error messages when `status` is `error`
</ResponseField>

<ResponseField name="items[].sections[].reference_product" type="string | null">
  Emission factor reference product used for impact calculation
</ResponseField>

<ResponseField name="items[].sections[].emissions" type="array | null">
  CO2e emissions for this section: `[{"value": 12.34, "gas": "co2e", "unit_name": "kgCO2e"}]`
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL (API Key) theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET "https://api.dcycle.io/v1/transports?status=active&transport_direction=downstream&page=1&size=20" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

  ```bash cURL (JWT) theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET "https://api.dcycle.io/v1/transports?status=active&transport_direction=downstream&page=1&size=20" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests
  import os

  response = requests.get(
      "https://api.dcycle.io/v1/transports",
      headers={
          "x-api-key": os.getenv("DCYCLE_API_KEY"),
          "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
      },
      params={
          "status": ["active", "pending"],
          "transport_direction": "downstream",
          "from_date": "2024-01-01",
          "to_date": "2024-12-31",
          "sort": "-created_at",
          "page": 1,
          "size": 20,
      },
  )

  data = response.json()
  print(f"Total routes: {data['total']}")
  for route in data["items"]:
      print(f"  {route['name']} | {route['transport_date']} | CO2e: {route['co2e']} kgCO2e")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  axios.get('https://api.dcycle.io/v1/transports', {
    headers: {
      'x-api-key': process.env.DCYCLE_API_KEY,
      'x-organization-id': process.env.DCYCLE_ORG_ID,
    },
    params: {
      status: ['active', 'pending'],
      transport_direction: 'downstream',
      from_date: '2024-01-01',
      to_date: '2024-12-31',
      sort: '-created_at',
      page: 1,
      size: 20,
    },
  })
  .then(({ data }) => {
    console.log(`Total routes: ${data.total}`);
    data.items.forEach(route => {
      console.log(`  ${route.name} | ${route.transport_date} | CO2e: ${route.co2e} kgCO2e`);
    });
  });
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "items": [
    {
      "id": "010ed3b6-b513-40f3-b9fe-0f0a338d9274",
      "name": "Madrid to Syria Shipment",
      "transport_date": "2024-06-15",
      "quantity_transported": 1500.0,
      "supplier": "LogiTrans S.A.",
      "transport_direction": "downstream",
      "transport_frequency": null,
      "unit": {
        "id": "61743a63-ff70-459c-9567-5eee8f7dfd5c",
        "name": "kilogram_(kg)",
        "type": "solid"
      },
      "co2e": 245.67,
      "emissions": [{"value": 245.67, "gas": "co2e", "unit_name": "kgCO2e"}],
      "status": "active",
      "file_id": null,
      "file_name": null,
      "sections": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440001",
          "part": 1,
          "transport_type": "road",
          "travel_method": "truck",
          "electric": false,
          "refrigerated": false,
          "detail": null,
          "origin": "Madrid, Spain",
          "origin_geocode": {
            "country_code": "ES",
            "place_id": "ChIJgTwKgJcpQg0RaSKMYcHeNsQ",
            "address_formatted": "Madrid, Spain",
            "latitude": 40.4168,
            "longitude": -3.7038
          },
          "destination": "Barcelona Port, Spain",
          "destination_geocode": {
            "country_code": "ES",
            "place_id": "ChIJ5TCOcRaYpBIRCmZHTz37sEQ",
            "address_formatted": "Barcelona, Spain",
            "latitude": 41.3874,
            "longitude": 2.1686
          },
          "kms": 145.0,
          "kms_manual": null,
          "distance_manual": false,
          "kms_source": "google_maps_distance_matrix_v1",
          "status": "active",
          "step": "completed",
          "error_messages": null,
          "reference_product": null,
          "emissions": [{"value": 12.34, "gas": "co2e", "unit_name": "kgCO2e"}],
          "created_at": "2024-06-10T09:00:00Z",
          "updated_at": "2024-06-15T14:30:00Z"
        }
      ],
      "uploaded_by": {
        "id": "user-123",
        "first_name": "Maria",
        "last_name": "García",
        "profile_img_url": null
      },
      "created_at": "2024-06-10T09:00:00Z",
      "updated_at": "2024-06-15T14:30:00Z"
    }
  ],
  "total": 142,
  "page": 1,
  "size": 20,
  "filter_hash": "eyJzdGF0dXMiOiBbImFjdGl2ZSJdfQ=="
}
```

## Common Errors

### 401 Unauthorized

**Cause:** Missing or invalid API key / JWT token

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
```

### 403 Forbidden

**Cause:** The authenticated user is not a member of the organization

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
```

### 422 Unprocessable Entity

**Cause:** Invalid query parameter value (e.g. unrecognized status or direction)

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": [
    {
      "loc": ["query", "transport_direction"],
      "msg": "value is not a valid enumeration member; permitted: 'downstream', 'upstream'",
      "type": "type_error.enum"
    }
  ]
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Get Transport Route" icon="magnifying-glass" href="/api-reference/transport/get">
    Retrieve a single transport route by ID
  </Card>

  <Card title="Create Transport Route" icon="plus" href="/api-reference/transport/create">
    Create a new transport route with sections
  </Card>

  <Card title="Update Transport Route" icon="pencil" href="/api-reference/transport/update">
    Modify a transport route and its sections
  </Card>

  <Card title="Transport Overview" icon="book" href="/api-reference/transport/overview">
    Full data model and distance calculation reference
  </Card>
</CardGroup>
