Delete Vehicle Consumption
const options = {
method: 'DELETE',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'Delete Vehicle Consumption
Permanently delete a single vehicle consumption record by its ID
DELETE
/
v1
/
vehicle_consumptions
/
{vehicle_consumption_id}
Delete Vehicle Consumption
const options = {
method: 'DELETE',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'← Vehicles API
Permanently delete a single vehicle consumption record. This action cannot be undone and will remove all associated emissions data from your organization’s totals.
No response body is returned for successful deletions.
Solution: Verify your API key is valid and active. Get a new one from Settings → API.
Solution: Verify the consumption ID is correct and belongs to your organization. Use the List Vehicle Consumptions endpoint to retrieve valid IDs.
Irreversible Action: Deleting a consumption record is permanent. All associated CO₂e impact data will be removed.
Request
Path Parameters
uuid
required
The UUID of the vehicle consumption record to deleteExample:
660e8400-e29b-41d4-a716-446655440000Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faResponse
Returns204 No Content on successful deletion. No response body.
Example
curl -X DELETE "https://api.dcycle.io/v1/vehicle_consumptions/660e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
api_key = os.getenv("DCYCLE_API_KEY")
org_id = os.getenv("DCYCLE_ORG_ID")
consumption_id = "660e8400-e29b-41d4-a716-446655440000"
headers = {
"x-api-key": api_key,
"x-organization-id": org_id
}
response = requests.delete(
f"https://api.dcycle.io/v1/vehicle_consumptions/{consumption_id}",
headers=headers
)
if response.status_code == 204:
print("Vehicle consumption deleted successfully")
else:
print(f"Error: {response.status_code}")
const axios = require('axios');
const apiKey = process.env.DCYCLE_API_KEY;
const orgId = process.env.DCYCLE_ORG_ID;
const consumptionId = '660e8400-e29b-41d4-a716-446655440000';
const headers = {
'x-api-key': apiKey,
'x-organization-id': orgId
};
axios.delete(
`https://api.dcycle.io/v1/vehicle_consumptions/${consumptionId}`,
{ headers }
)
.then(response => {
if (response.status === 204) {
console.log('Vehicle consumption deleted successfully');
}
})
.catch(error => console.error(error));
Successful Response
HTTP/1.1 204 No Content
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{
"detail": "Invalid API key",
"code": "INVALID_API_KEY"
}
404 Not Found
Cause: Vehicle consumption record not found in organization{
"code": "VEHICLE_CONSUMPTION_NOT_FOUND",
"detail": "VehicleConsumption with id=UUID('...') not found"
}
422 Validation Error
Cause: Malformed UUID in path parameter{
"detail": [
{
"loc": ["path", "vehicle_consumption_id"],
"msg": "value is not a valid uuid",
"type": "type_error.uuid"
}
]
}
Related Endpoints
Vehicle Consumptions
List all consumption records for a vehicle
Delete Consumptions by File
Delete all consumptions from a CSV upload by file ID
Bulk Delete Consumptions
Delete multiple consumption records at once
Bulk Delete by Filters
Delete consumptions matching filter criteria
Was this page helpful?