> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Logistic Hub

> Retrieve a single logistic hub by its ID

# Get Logistic Hub

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

## Request

### Path Parameters

<ParamField path="hub_id" type="uuid" required>
  The UUID of the logistic hub to retrieve

  **Example:** `550e8400-e29b-41d4-a716-446655440000`
</ParamField>

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

## Response

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

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests
  import os

  headers = {
      "x-api-key": os.getenv("DCYCLE_API_KEY"),
      "x-organization-id": os.getenv("DCYCLE_ORG_ID")
  }

  hub_id = "550e8400-e29b-41d4-a716-446655440000"
  response = requests.get(
      f"https://api.dcycle.io/v1/logistic-hubs/{hub_id}",
      headers=headers
  )

  hub = response.json()
  print(f"{hub['name']}: {hub['co2e'] or 0} kg CO2e")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  const headers = {
    'x-api-key': process.env.DCYCLE_API_KEY,
    'x-organization-id': process.env.DCYCLE_ORG_ID
  };

  const hubId = '550e8400-e29b-41d4-a716-446655440000';
  axios.get(`https://api.dcycle.io/v1/logistic-hubs/${hubId}`, { headers })
    .then(response => console.log(response.data));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "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`

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Logistic hub doesn't belong to organization"
}
```

### 404 Not Found

**Cause:** Logistic hub with the given ID does not exist

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "code": "NOT_FOUND",
  "detail": "LogisticHUB with id=UUID('...') not found"
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="List Logistic Hubs" icon="list" href="/api-reference/logistic-hubs/list">
    Retrieve all logistic hubs
  </Card>

  <Card title="Update Logistic Hub" icon="pencil" href="/api-reference/logistic-hubs/update">
    Modify logistic hub details
  </Card>
</CardGroup>
