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));import requests
url = "https://api.dcycle.io/v1/logistic-hubs/{hub_id}"
payload = {
"name": "<string>",
"address": "<string>",
"country": "<string>",
"type": "<string>",
"category": "<string>",
"facility_id": "<string>",
"supercharger": True
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)curl --request PUT \
--url https://api.dcycle.io/v1/logistic-hubs/{hub_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"name": "<string>",
"address": "<string>",
"country": "<string>",
"type": "<string>",
"category": "<string>",
"facility_id": "<string>",
"supercharger": true
}
'{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"category": {},
"address": {},
"country": {},
"status": "<string>",
"supercharger": true,
"facility_id": {},
"co2e": {},
"created_at": {},
"updated_at": {}
}Update Logistic Hub
Modify an existing logistic hub’s details
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));import requests
url = "https://api.dcycle.io/v1/logistic-hubs/{hub_id}"
payload = {
"name": "<string>",
"address": "<string>",
"country": "<string>",
"type": "<string>",
"category": "<string>",
"facility_id": "<string>",
"supercharger": True
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)curl --request PUT \
--url https://api.dcycle.io/v1/logistic-hubs/{hub_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"name": "<string>",
"address": "<string>",
"country": "<string>",
"type": "<string>",
"category": "<string>",
"facility_id": "<string>",
"supercharger": true
}
'{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"category": {},
"address": {},
"country": {},
"status": "<string>",
"supercharger": true,
"facility_id": {},
"co2e": {},
"created_at": {},
"updated_at": {}
}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
uuid
required
The UUID of the logistic hub to updateExample:
550e8400-e29b-41d4-a716-446655440000Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faBody Parameters
All fields are optional — only include what you want to change.string
Hub name
string
Physical address
string
ISO country code
string
Hub type:
owned or subcontractedstring
Hub category
uuid
Linked facility ID
boolean
Whether hub is a supercharger
Response
Returns the updated logistic hub object.string
Logistic hub UUID
string
Hub name
string
Hub type:
owned or subcontractedstring | null
Hub category classification (e.g.
warehouse_ambient, warehouse_mixed)string | null
Physical address
string | null
ISO country code
string
Hub status:
active or archivedboolean
Whether the hub is a supercharger
string | null
UUID of the linked facility (only for
owned hubs)number | null
CO2e emissions from the linked facility (tCO2e)
datetime
Creation timestamp (ISO 8601)
string | null
Last update timestamp (ISO 8601)
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"
}'
import requests
import os
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
"Content-Type": "application/json"
}
hub_id = "550e8400-e29b-41d4-a716-446655440000"
response = requests.put(
f"https://api.dcycle.io/v1/logistic-hubs/{hub_id}",
headers=headers,
json={"name": "Madrid Distribution Center", "category": "warehouse_mixed"}
)
print(f"Updated: {response.json()['name']}")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
'Content-Type': 'application/json'
};
const hubId = '550e8400-e29b-41d4-a716-446655440000';
axios.put(`https://api.dcycle.io/v1/logistic-hubs/${hubId}`, {
name: "Madrid Distribution Center",
category: "warehouse_mixed"
}, { headers })
.then(response => console.log(`Updated: ${response.data.name}`));
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"
}
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"}
404 Not Found
Cause: The logistic hub does not exist or belongs to another organization{"detail": "Logistic hub not found"}
422 Unprocessable Entity
Cause: Invalid field value (e.g. invalid country code or UUID format){
"detail": [
{
"loc": ["body", "facility_id"],
"msg": "value is not a valid uuid",
"type": "type_error.uuid"
}
]
}
Related Endpoints
Get Logistic Hub
Retrieve logistic hub details
Delete Logistic Hub
Remove a logistic hub
Was this page helpful?