Skip to main content
GET
/
v1
/
logistic-hubs
/
{hub_id}
Get Logistic Hub
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/{hub_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "name": "<string>",
  "address": {},
  "country": {},
  "type": "<string>",
  "category": {},
  "status": "<string>",
  "supercharger": true,
  "facility_id": {},
  "co2e": {},
  "created_at": {},
  "updated_at": {}
}

Get Logistic Hub

Retrieve detailed information about a specific logistic hub in your organization.

Request

Path Parameters

hub_id
uuid
required
The UUID of the logistic hub to retrieveExample: 550e8400-e29b-41d4-a716-446655440000

Headers

x-api-key
string
required
Your API key for authentication
x-organization-id
string
required
Your organization UUID

Response

id
string
Unique identifier (UUID)
name
string
Hub name
address
string | null
Physical address
country
string | null
ISO country code
type
string
Hub type: owned or subcontracted
category
string | null
Hub category
status
string
Status: active or archived
supercharger
boolean
Whether hub is a supercharger
facility_id
string | null
Linked facility UUID
co2e
number | null
CO2e emissions from linked facility
created_at
datetime
Creation timestamp
updated_at
datetime | null
Last update timestamp

Example

curl -X GET "https://api.dcycle.io/v1/logistic-hubs/550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}"

Successful Response

{
  "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"
}

Common Errors

403 Forbidden

Cause: Logistic hub does not belong to the organization specified in x-organization-id
{
  "detail": "Logistic hub doesn't belong to organization"
}

404 Not Found

Cause: Logistic hub with the given ID does not exist
{
  "code": "NOT_FOUND",
  "detail": "LogisticHUB with id=UUID('...') not found"
}