> ## 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 Waste

> Retrieve a single waste record with enriched data

# Get Waste

Retrieve a single waste record by ID with enriched data including CO2e emissions, user who created it, unit details, and linked projects.

## Request

### 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>

### Path Parameters

<ParamField path="waste_id" type="string" required>
  UUID of the waste record

  **Example:** `f47ac10b-58cc-4372-a567-0e02b2c3d479`
</ParamField>

## Response

<ResponseField name="id" type="string">
  Waste record UUID
</ResponseField>

<ResponseField name="type" type="string">
  Always `"wastes"`
</ResponseField>

<ResponseField name="status" type="string">
  Record status: `active`, `error`, `pending`
</ResponseField>

<ResponseField name="quantity" type="number | null">
  Waste quantity after facility allocation, in the specified unit
</ResponseField>

<ResponseField name="base_quantity" type="number | null">
  Original waste quantity before facility allocation
</ResponseField>

<ResponseField name="percentage" type="number | null">
  Facility allocation percentage (0–1)
</ResponseField>

<ResponseField name="identification_name" type="string | null">
  Waste stream identification name
</ResponseField>

<ResponseField name="description" type="string | null">
  Free-text description of the waste record
</ResponseField>

<ResponseField name="low_code" type="string | null">
  European Waste Catalogue (LER/LoW) code
</ResponseField>

<ResponseField name="rd_code" type="string | null">
  Recovery/disposal operation code
</ResponseField>

<ResponseField name="total_km_to_waste_center" type="number | null">
  Distance in km to the waste treatment center
</ResponseField>

<ResponseField name="start_date" type="string | null">
  Start date of the waste period (ISO 8601)
</ResponseField>

<ResponseField name="end_date" type="string | null">
  End date of the waste period (ISO 8601)
</ResponseField>

<ResponseField name="co2e" type="number | null">
  Calculated CO2 equivalent emissions in kg
</ResponseField>

<ResponseField name="co2e_biomass" type="number | null">
  CO2 equivalent biomass emissions in kg
</ResponseField>

<ResponseField name="facility_id" type="string | null">
  UUID of the facility this waste belongs to
</ResponseField>

<ResponseField name="uploaded_by" type="string | null">
  UUID of the user who created the record
</ResponseField>

<ResponseField name="source_invoice_id" type="string | null">
  Source waste UUID (if derived from a distributed waste record)
</ResponseField>

<ResponseField name="invoice_id" type="string | null">
  Same as `identification_name` (kept for consistency with other modules)
</ResponseField>

<ResponseField name="file_url" type="string | null">
  URL to download the linked file
</ResponseField>

<ResponseField name="file_id" type="string | null">
  UUID of the linked file
</ResponseField>

<ResponseField name="file_name" type="string | null">
  Name of the linked file
</ResponseField>

<ResponseField name="created_at" type="datetime">
  Timestamp when the record was created
</ResponseField>

<ResponseField name="updated_at" type="datetime | null">
  Timestamp when the record was last updated
</ResponseField>

<ResponseField name="custom_emission_factor_id" type="string | null">
  UUID of a custom emission factor, if applied
</ResponseField>

<ResponseField name="custom_emission_factor" type="object | null">
  Custom emission factor details, if applied
</ResponseField>

<ResponseField name="error_messages" type="array[string] | null">
  Error details when status is `error`
</ResponseField>

<ResponseField name="unit" type="object | null">
  Unit of measurement

  <Expandable title="Unit Object">
    <ResponseField name="id" type="string">Unit UUID</ResponseField>
    <ResponseField name="name" type="string">Unit display name (e.g., `"kg"`, `"t"`)</ResponseField>
    <ResponseField name="type" type="string">Unit category (e.g., `"weight"`)</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="user" type="object | null">
  User who created the record

  <Expandable title="User Object">
    <ResponseField name="id" type="string">User UUID</ResponseField>
    <ResponseField name="first_name" type="string | null">First name</ResponseField>
    <ResponseField name="last_name" type="string | null">Last name</ResponseField>
    <ResponseField name="email" type="string">Email address</ResponseField>
    <ResponseField name="prefix" type="string | null">Phone prefix</ResponseField>
    <ResponseField name="phone_number" type="string | null">Phone number</ResponseField>
    <ResponseField name="onboarding_done" type="boolean">Whether onboarding is complete</ResponseField>
    <ResponseField name="profile_img_url" type="string | null">Profile image URL</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="linked_projects" type="array[object]">
  Projects linked to this waste record
</ResponseField>

<ResponseField name="facility_percentages" type="array[object]">
  Facility percentage allocations (for distributed waste records)
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl "https://api.dcycle.io/v1/wastes/${WASTE_ID}/detail" \
    -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

  response = requests.get(
      f"https://api.dcycle.io/v1/wastes/{os.getenv('WASTE_ID')}/detail",
      headers={
          "x-api-key": os.getenv("DCYCLE_API_KEY"),
          "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
      },
  )

  waste = response.json()
  print(f"LER {waste['ler_code']} / RD {waste['rd_code']}: {waste['co2e']} kg CO2e")
  ```

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

  const response = await axios.get(
    `https://api.dcycle.io/v1/wastes/${process.env.WASTE_ID}/detail`,
    {
      headers: {
        'x-api-key': process.env.DCYCLE_API_KEY,
        'x-organization-id': process.env.DCYCLE_ORG_ID,
      },
    }
  );

  const w = response.data;
  console.log(`LER ${w.ler_code} / RD ${w.rd_code}: ${w.co2e} kg CO2e`);
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "type": "wastes",
  "status": "active",
  "quantity": 1250.5,
  "base_quantity": 1250.5,
  "percentage": null,
  "identification_name": "Paper & Cardboard",
  "description": null,
  "low_code": "200101",
  "rd_code": "R3",
  "total_km_to_waste_center": 45.0,
  "start_date": "2025-01-01",
  "end_date": "2025-03-31",
  "co2e": 26.26,
  "co2e_biomass": 0,
  "facility_id": "660e8400-e29b-41d4-a716-446655440000",
  "uploaded_by": "990e8400-e29b-41d4-a716-446655440000",
  "source_invoice_id": null,
  "invoice_id": "Paper & Cardboard",
  "file_url": null,
  "file_id": null,
  "file_name": null,
  "created_at": "2025-02-01T10:30:00Z",
  "updated_at": "2025-02-15T14:20:00Z",
  "custom_emission_factor_id": null,
  "custom_emission_factor": null,
  "error_messages": null,
  "unit": {
    "id": "ba80e6cb-86a4-4bb1-a0c5-8104365d523c",
    "name": "kg",
    "type": "weight"
  },
  "user": {
    "id": "990e8400-e29b-41d4-a716-446655440000",
    "first_name": "Ana",
    "last_name": "Garcia",
    "email": "ana.garcia@example.com",
    "prefix": null,
    "phone_number": null,
    "onboarding_done": true,
    "profile_img_url": null
  },
  "linked_projects": [],
  "facility_percentages": []
}
```

## Common Errors

### 404 Not Found

**Cause:** Waste record does not exist or does not belong to your organization

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{ "detail": "Waste not found" }
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="List Wastes" icon="list" href="/api-reference/wastes/list">
    Browse waste records
  </Card>

  <Card title="Update Waste" icon="pen" href="/api-reference/wastes/update">
    Modify a waste record
  </Card>
</CardGroup>
