Skip to main content
PUT
/
v1
/
logistic-hubs
/
{hub_id}
Update Logistic Hub
const options = {
  method: 'PUT',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: '<string>',
    address: '<string>',
    country: '<string>',
    type: '<string>',
    category: '<string>',
    facility_id: '<string>',
    supercharger: true
  })
};

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));

Update Logistic Hub

Update an existing logistic hub in your organization. Only include the fields you want to change — all other fields remain unchanged.
Auto-creation: If you change type to owned on a hub that has no linked facility and provide an address, a new facility will be automatically created and linked.

Request

Path Parameters

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

Headers

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

Body Parameters

All fields are optional — only include what you want to change.
name
string
Hub name
address
string
Physical address
country
string
ISO country code
type
string
Hub type: owned or subcontracted
category
string
Hub category
facility_id
uuid
Linked facility ID
supercharger
boolean
Whether hub is a supercharger

Response

Returns the updated logistic hub object.

Example

curl -X PUT "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}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Madrid Distribution Center",
    "category": "warehouse_mixed"
  }'

Successful Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Madrid Distribution Center",
  "type": "owned",
  "category": "warehouse_mixed",
  "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-12-01T15:45:00Z"
}