Get Waste 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/wastes/{waste_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/wastes/{waste_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/wastes/{waste_id}/versions \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": {
"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": {}
}
},
"total": 123,
"page": 123,
"size": 123
}Get Waste Version History
Get the change history of a waste record
GET
/
v1
/
wastes
/
{waste_id}
/
versions
Get Waste 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/wastes/{waste_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/wastes/{waste_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/wastes/{waste_id}/versions \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": {
"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": {}
}
},
"total": 123,
"page": 123,
"size": 123
}← Wastes API
Returns a paginated list of all changes made to a waste, newest first: who made each change, when, and which fields it modified.
Tracked fields:
waste_ler_code_id, waste_rd_code_id, waste_efs_id, description, base_quantity, quantity, unit_id, start_date, end_date, identification_name, destination, total_km_to_waste_center, provider_name, transporter_name, file_url, file_name, percentage, facility_id, custom_emission_factor_id. Fields a recalculation rewrites (status, co2e) are not tracked, so a recalculation never reads as a user edit.
A parent organization can read the history of a waste in one of its subsidiaries’ facilities.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
UUID of the wasteExample:
550e8400-e29b-41d4-a716-446655440000Query Parameters
integer
default:"1"
Page number (1-based)
integer
default:"50"
Number of version entries per page
integer
Return only the change made by this transaction, with its diff, instead of the newest onesExample:
48291Response
array[object]
Version entries with change details
Show version object fields
Show version object fields
integer
Internal transaction identifier. Versions are returned newest-first (descending
transaction_id).string
The type of operation:
CREATE, UPDATE, or DELETEdatetime | null
When the change was made (ISO 8601)
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
integer
Total number of version entries
integer
Current page number
integer
Items per page
For
CREATE operations, old_value is always null and new_value holds the initial value of each tracked field. For UPDATE operations, only the fields that changed are included in changes.Example
curl -X GET "https://api.dcycle.io/v1/wastes/550e8400-e29b-41d4-a716-446655440000/versions?page=1&size=50" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import os
import requests
waste_id = "550e8400-e29b-41d4-a716-446655440000"
response = requests.get(
f"https://api.dcycle.io/v1/wastes/{waste_id}/versions",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
},
params={"page": 1, "size": 50},
)
for version in response.json()["items"]:
print(f"[{version['operation_type']}] {version['issued_at']}")
for change in version["changes"]:
print(f" {change['field']}: {change['old_value']} → {change['new_value']}")
const axios = require('axios');
const wasteId = '550e8400-e29b-41d4-a716-446655440000';
axios.get(`https://api.dcycle.io/v1/wastes/${wasteId}/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 }) => {
data.items.forEach(version => {
console.log(`[${version.operation_type}] ${version.issued_at}`);
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": "2026-10-20T11:45:00Z",
"user_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"user_first_name": "Maria",
"user_last_name": "Garcia",
"changes": [
{
"field": "base_quantity",
"old_value": 10.0,
"new_value": 25.0
},
{
"field": "quantity",
"old_value": 10.0,
"new_value": 25.0
}
]
},
{
"transaction_id": 47103,
"operation_type": "CREATE",
"issued_at": "2026-10-10T09:00:00Z",
"user_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"user_first_name": "Maria",
"user_last_name": "Garcia",
"changes": [
{
"field": "description",
"old_value": null,
"new_value": "Cardboard"
},
{
"field": "quantity",
"old_value": null,
"new_value": 10.0
}
]
}
],
"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: The waste does not exist or belongs to an organization outside yours and its subsidiaries{"detail": "Waste with id='550e8400-e29b-41d4-a716-446655440000' not found", "code": "NOT_FOUND"}
Related Endpoints
Get Waste
View the current state of a waste
Update Waste
Modify a waste
Was this page helpful?