Get Logistics Hubs
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/logistics/hubs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/logistics/hubs"
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/hubs \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": [
{
"id": "<string>",
"name": "<string>",
"address": "<string>",
"country": "<string>",
"type": "<string>",
"category": "<string>",
"status": "<string>",
"supercharger": true,
"facility_id": "<string>",
"co2e": 123,
"created_at": {},
"updated_at": {}
}
],
"total": 123,
"page": 123,
"size": 123
}Get Logistics Hubs
Retrieve all logistics hubs for your organization
GET
/
v1
/
logistics
/
hubs
Get Logistics Hubs
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/logistics/hubs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/logistics/hubs"
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/hubs \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": [
{
"id": "<string>",
"name": "<string>",
"address": "<string>",
"country": "<string>",
"type": "<string>",
"category": "<string>",
"status": "<string>",
"supercharger": true,
"facility_id": "<string>",
"co2e": 123,
"created_at": {},
"updated_at": {}
}
],
"total": 123,
"page": 123,
"size": 123
}Get Logistics Hubs
Retrieve a paginated list of logistics hubs for your organization. Hubs represent physical locations (warehouses, transshipment points, etc.) used as origins in logistics shipments.Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faQuery Parameters
string
Filter hubs by name (partial match, case-insensitive)Example:
"Madrid"string
Filter by hub typeAvailable values:
owned, subcontractedstring
Filter by hub categoryAvailable values:
transshipment_ambient, transshipment_mixed, storage_transhipment_ambient, storage_transhipment_mixed, warehouse_ambient, warehouse_mixed, liquid_bulk_terminals_ambient, liquid_bulk_terminals_mixed, maritime_container_terminals_ambient, maritime_container_terminals_temperature_controlledinteger
default:"1"
Page number for pagination
integer
default:"10"
Number of items per page (max 100)
Response
array
Array of hub objects
Show Hub Object
Show Hub Object
string
Unique identifier (UUID)
string
Hub name
string
Physical address of the hub
string
ISO country code (e.g.
ES, FR)string
Hub type:
owned (linked to a facility) or subcontractedstring
Hub category (e.g.
warehouse_ambient, transshipment_mixed)string
Status:
active or archivedboolean
Whether the hub is a supercharger location
string
UUID of the linked facility (only for
owned hubs)number
CO2e emissions from the linked facility, if available
datetime
Timestamp when the hub was created
datetime | null
Timestamp when the hub was last updated
integer
Total number of hubs matching the filter
integer
Current page number
integer
Number of items per page
Example
curl -X GET "https://api.dcycle.io/v1/logistics/hubs?page=1&size=10" \
-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")
headers = {
"x-api-key": api_key,
"x-organization-id": org_id
}
response = requests.get(
"https://api.dcycle.io/v1/logistics/hubs",
headers=headers,
params={"page": 1, "size": 10}
)
result = response.json()
for hub in result["items"]:
print(f"{hub['name']} ({hub['type']}) — {hub['address']}")
const axios = require('axios');
axios.get('https://api.dcycle.io/v1/logistics/hubs', {
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
},
params: { page: 1, size: 10 },
})
.then(({ data }) => {
data.items.forEach(hub => {
console.log(`${hub.name} (${hub.type}) — ${hub.address}`);
});
});
Successful Response
{
"items": [
{
"id": "b3d2e1f0-1234-5678-abcd-ef0123456789",
"name": "HUB-MAD-001",
"address": "Calle Ejemplo 1, Madrid, Spain",
"country": "ES",
"type": "owned",
"category": "warehouse_ambient",
"status": "active",
"supercharger": false,
"facility_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"co2e": 1240.5,
"created_at": "2024-10-01T09:00:00Z",
"updated_at": "2024-11-15T14:30:00Z"
},
{
"id": "c4e5f6a7-2345-6789-bcde-f01234567890",
"name": "HUB-BCN-SUB",
"address": "Av. Diagonal 100, Barcelona, Spain",
"country": "ES",
"type": "subcontracted",
"category": "transshipment_ambient",
"status": "active",
"supercharger": false,
"facility_id": null,
"co2e": null,
"created_at": "2024-11-01T11:00:00Z",
"updated_at": null
}
],
"total": 2,
"page": 1,
"size": 10
}
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{"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"}
Related Endpoints
Get Logistics Requests
Retrieve requests — each includes a
hub_id referenceCreate Logistics Request
Create a shipment leg referencing a hub
Logistic Hubs (full CRUD)
Full hub management: create, update, delete
Was this page helpful?