List Logistic Hubs
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/logistic-hubs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/logistic-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/logistic-hubs \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": {
"id": "<string>",
"name": "<string>",
"address": {},
"country": {},
"type": "<string>",
"category": {},
"status": "<string>",
"supercharger": true,
"facility_id": {},
"co2e": {},
"created_at": {},
"updated_at": {}
},
"total": 123,
"page": 123,
"size": 123
}List Logistic Hubs
Retrieve all logistic hubs with filtering and pagination support
GET
/
v1
/
logistic-hubs
List Logistic Hubs
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/logistic-hubs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/logistic-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/logistic-hubs \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": {
"id": "<string>",
"name": "<string>",
"address": {},
"country": {},
"type": "<string>",
"category": {},
"status": "<string>",
"supercharger": true,
"facility_id": {},
"co2e": {},
"created_at": {},
"updated_at": {}
},
"total": 123,
"page": 123,
"size": 123
}List Logistic Hubs
Retrieve a paginated list of logistic hubs in your organization with support for filtering by name, category, type, and status.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 categoryExample:
"warehouse_ambient"string
Filter by hub typeAvailable values:
owned, subcontractedarray[string]
Filter by hub statusAvailable values:
active, archivedExample: status[]=activeinteger
default:"1"
Page number for pagination
integer
default:"10"
Number of items per page (max 100)
Response
array[object]
Array of logistic hub objects
Show Logistic Hub Object
Show Logistic Hub Object
string
Unique identifier (UUID)
string
Hub name
string | null
Physical address
string | null
ISO country code
string
Hub type:
owned or subcontractedstring | null
Hub category
string
Status:
active or archivedboolean
Whether hub is a supercharger
string | null
Linked facility UUID
number | null
CO2e emissions from linked facility
datetime
Creation timestamp
datetime | null
Last update timestamp
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/logistic-hubs?page=1&size=50&status[]=active" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID")
}
response = requests.get(
"https://api.dcycle.io/v1/logistic-hubs",
headers=headers,
params={"page": 1, "size": 50, "status[]": ["active"]}
)
for hub in response.json()["items"]:
print(f"{hub['name']}: {hub['co2e'] or 0} kg CO2e")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
};
axios.get('https://api.dcycle.io/v1/logistic-hubs', {
headers,
params: { page: 1, size: 50, 'status[]': ['active'] }
})
.then(response => {
response.data.items.forEach(h => {
console.log(`${h.name}: ${h.co2e || 0} kg CO2e`);
});
});
Successful Response
{
"items": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Madrid Warehouse",
"type": "owned",
"category": "warehouse_ambient",
"address": "Calle Industrial 5, Madrid",
"country": "ES",
"status": "active",
"supercharger": false,
"facility_id": "660e8400-e29b-41d4-a716-446655440000",
"co2e": 1250.5,
"created_at": "2024-11-24T10:30:00Z",
"updated_at": "2024-11-24T10:30:00Z"
}
],
"total": 8,
"page": 1,
"size": 50
}
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
Create Logistic Hub
Add a new logistic hub
Get Logistic Hub
Retrieve a single logistic hub
Was this page helpful?