Skip to main content
GET
/
v1
/
logistics
/
report
/
export
Export Detailed Report
const options = {
  method: 'GET',
  headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};

fetch('https://api.dcycle.io/v1/logistics/report/export', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.dcycle.io/v1/logistics/report/export"

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/logistics/report/export \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-organization-id: <x-organization-id>'
{
  "processing_job_id": "<string>",
  "message": "<string>"
}

Export Detailed Report

Queue an asynchronous line-level logistics export — one row per request leg, including company name, movement/leg/package IDs, origin/destination, distance, load, tkm, vehicle type and kgCO2e. Unlike GET /report, which returns an aggregated ISO 14083 summary inline, this endpoint streams the full detail and is built to scale to organizations with millions of requests. It returns 202 immediately; a background worker generates the file and emails a download link (valid 7 days) when ready.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Query Parameters

start_date
string
required
Period start date as a Unix timestamp (seconds)Example: 1735689600
end_date
string
required
Period end date as a Unix timestamp (seconds). Must be after start_date. Multi-year ranges are allowed.Example: 1767139200
clients[]
string[]
Client name(s) to include. Omit to export the whole organization (all clients).
per_client
boolean
default:"false"
If true, generate one file per client (selected, or all) bundled into a single ZIP.
output_format
string
default:"csv"
Output file format: excel, csv, or json. Large csv/json exports arrive inside a .zip; Excel is refused above ~5M rows — use csv for very large windows.
lang
string
default:"es"
Language for the column headers: es or en.
project_id
uuid
Filter the export by project UUID

Response (202 Accepted)

processing_job_id
string
UUID of the processing job for tracking progress
message
string
Confirmation message

Example

curl -X GET "https://api.dcycle.io/v1/logistics/report/export?start_date=1735689600&end_date=1767139200&output_format=csv&lang=en" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os

response = requests.get(
    "https://api.dcycle.io/v1/logistics/report/export",
    headers={
        "x-api-key": os.getenv("DCYCLE_API_KEY"),
        "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
    },
    params={
        "start_date": "1735689600",
        "end_date": "1767139200",
        "output_format": "csv",
        "lang": "en",
    },
)

result = response.json()
print(f"Export queued — job ID: {result['processing_job_id']}")
const axios = require('axios');

const response = await axios.get(
  'https://api.dcycle.io/v1/logistics/report/export',
  {
    headers: {
      'x-api-key': process.env.DCYCLE_API_KEY,
      'x-organization-id': process.env.DCYCLE_ORG_ID,
    },
    params: {
      start_date: '1735689600',
      end_date: '1767139200',
      output_format: 'csv',
      lang: 'en',
    },
  }
);

console.log(`Export queued — job ID: ${response.data.processing_job_id}`);

Successful Response

{
  "processing_job_id": "job-uuid",
  "message": "Logistics report export queued. You will receive an email with the download link when it is ready."
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"detail": "Invalid API key", "code": "INVALID_API_KEY"}

404 Not Found

Cause: Organization not found
{"code": "ORGANIZATION_NOT_FOUND", "detail": "Organization with id=UUID('...') not found"}

422 Unprocessable Entity

Cause: Invalid or inverted date range
{"code": "INVALID_DATE_RANGE", "detail": "start_date and end_date must be Unix timestamps (seconds)."}
Solution: Pass start_date/end_date as Unix timestamps in seconds, with end_date after start_date.

Generate Report

Get the aggregated ISO 14083 summary inline

List Clients

Get available clients for filtering