Get Transport Route Version History
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/transports/{transport_route_id}/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/transports/{transport_route_id}/versions"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/transports/{transport_route_id}/versions \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": [
{}
],
"total": 123,
"page": 123,
"size": 123,
"items[].transaction_id": 123,
"items[].operation_type": "<string>",
"items[].issued_at": {},
"items[].user_id": {},
"items[].user_first_name": {},
"items[].user_last_name": {},
"items[].changes": [
{
"changes[].field": "<string>",
"changes[].old_value": {},
"changes[].new_value": {}
}
]
}Get Transport Route Version History
Retrieve the full audit trail of changes made to a transport route, with field-level diffs and user attribution
GET
/
v1
/
transports
/
{transport_route_id}
/
versions
Get Transport Route Version History
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/transports/{transport_route_id}/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/transports/{transport_route_id}/versions"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/transports/{transport_route_id}/versions \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": [
{}
],
"total": 123,
"page": 123,
"size": 123,
"items[].transaction_id": 123,
"items[].operation_type": "<string>",
"items[].issued_at": {},
"items[].user_id": {},
"items[].user_first_name": {},
"items[].user_last_name": {},
"items[].changes": [
{
"changes[].field": "<string>",
"changes[].old_value": {},
"changes[].new_value": {}
}
]
}Returns a paginated list of every change ever made to a transport route — who made it, when, and which fields were affected. Each entry covers one database transaction and includes a
changes array that shows the before/after value for each tracked field.
Tracked fields: name, quantity, unit_id, start_date, transport_direction.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
The unique identifier (UUID) of the transport routeExample:
010ed3b6-b513-40f3-b9fe-0f0a338d9274Query Parameters
integer
default:"1"
Page number (1-based)
integer
default:"50"
Number of version entries per page
Response
array
List of version entries for the requested page. See Version Entry Fields below.
integer
Total number of version entries across all pages
integer
Current page number
integer
Number of items per page
Version Entry Fields
integer
Internal database transaction ID. Versions are returned newest-first (descending
transaction_id).string
Type of change:
CREATE, UPDATE, or DELETEdatetime | null
ISO 8601 timestamp of when the change was committed.
null for very old records pre-dating audit logging.string | null
ID of the user who made the change.
null for system-triggered changes.string | null
First name of the user who made the change
string | null
Last name of the user who made the change
array
For
CREATE operations, old_value is always null and new_value contains the initial value of each tracked field. For UPDATE operations, only fields that actually changed are included in changes. For DELETE operations, changes is an empty array.Example
curl -X GET "https://api.dcycle.io/v1/transports/010ed3b6-b513-40f3-b9fe-0f0a338d9274/versions?page=1&size=50" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
curl -X GET "https://api.dcycle.io/v1/transports/010ed3b6-b513-40f3-b9fe-0f0a338d9274/versions?page=1&size=50" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
route_id = "010ed3b6-b513-40f3-b9fe-0f0a338d9274"
response = requests.get(
f"https://api.dcycle.io/v1/transports/{route_id}/versions",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
},
params={"page": 1, "size": 50},
)
data = response.json()
print(f"Total versions: {data['total']}")
for version in data["items"]:
print(
f" [{version['operation_type']}] {version['issued_at']} "
f"by {version['user_first_name']} {version['user_last_name']}"
)
for change in version["changes"]:
print(f" {change['field']}: {change['old_value']} → {change['new_value']}")
const axios = require('axios');
const routeId = '010ed3b6-b513-40f3-b9fe-0f0a338d9274';
axios.get(`https://api.dcycle.io/v1/transports/${routeId}/versions`, {
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
},
params: { page: 1, size: 50 },
})
.then(({ data }) => {
console.log(`Total versions: ${data.total}`);
data.items.forEach(version => {
console.log(
`[${version.operation_type}] ${version.issued_at} ` +
`by ${version.user_first_name} ${version.user_last_name}`
);
version.changes.forEach(c => {
console.log(` ${c.field}: ${c.old_value} → ${c.new_value}`);
});
});
})
.catch(error => console.error(error));
Successful Response
{
"items": [
{
"transaction_id": 48291,
"operation_type": "UPDATE",
"issued_at": "2024-06-20T11:45:00Z",
"user_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"user_first_name": "Maria",
"user_last_name": "Garcia",
"changes": [
{
"field": "quantity",
"old_value": "1000",
"new_value": "1500"
},
{
"field": "transport_direction",
"old_value": "upstream",
"new_value": "downstream"
}
]
},
{
"transaction_id": 47103,
"operation_type": "CREATE",
"issued_at": "2024-06-10T09:00:00Z",
"user_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"user_first_name": "Maria",
"user_last_name": "Garcia",
"changes": [
{
"field": "name",
"old_value": null,
"new_value": "Madrid to Syria Shipment"
},
{
"field": "quantity",
"old_value": null,
"new_value": "1000"
},
{
"field": "transport_direction",
"old_value": null,
"new_value": "upstream"
}
]
}
],
"total": 2,
"page": 1,
"size": 50
}
Common Errors
401 Unauthorized
Cause: Missing or invalid API key / JWT token{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
403 Forbidden
Cause: The authenticated user is not a member of the organization{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
404 Not Found
Cause: Route ID does not exist or belongs to a different organization{"detail": "TransportRoute not found", "code": "TRANSPORT_ROUTE_NOT_FOUND"}
Related Endpoints
Get Transport Route
Retrieve the current state of a transport route
Update Transport Route
Modify a transport route and its sections
List Transport Routes
Retrieve all transport routes with filtering and pagination
Transport Overview
Full data model and distance calculation reference
Was this page helpful?