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

# List Ingest Job Items

> Per-record outcomes of a bulk ingest job, in submission order

[← Create Wastes (v2)](/api-reference/wastes/create-v2)

One item per submitted record, in the order the records were sent. Use it to find which records failed to
calculate and why, and to map each record (by `source_row_index` or your `client_row_id`) to the entity that was
created (`entity_id`).

<Warning>
  **Beta.** Part of the bulk ingest API, currently in beta. The contract may still change before general
  availability.
</Warning>

## 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>
  UUID of the organization that created the job, or of one of its parent organizations.

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

### Path Parameters

<ParamField path="job_id" type="uuid" required>
  The job `id`.

  **Example:** `2d4b90c1-7c1e-4b6f-9a55-3f2b8e61d0aa`
</ParamField>

### Query Parameters

<ParamField query="status" type="string">
  Only items with this outcome.

  **Available values:** `pending`, `succeeded`, `failed`, `skipped`

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

<ParamField query="stage" type="string">
  Only items at this stage.

  **Available values:** `persist`, `calculate`

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

<ParamField query="page" type="integer" default="1">
  Page number, starting at 1.
</ParamField>

<ParamField query="size" type="integer" default="10">
  Items per page, between 1 and 500.
</ParamField>

## Response

<ResponseField name="items" type="array[object]">
  <Expandable title="item fields">
    <ResponseField name="source_row_index" type="integer">
      Position of the record in the submitted `records` array, starting at 0.
    </ResponseField>

    <ResponseField name="client_row_id" type="string | null">
      The `client_row_id` you sent with the record.
    </ResponseField>

    <ResponseField name="chunk_index" type="integer | null">
      Calculation chunk the record belongs to.
    </ResponseField>

    <ResponseField name="stage" type="string">
      Where the record is, or where it failed. **Available values:** `persist` (stored, nothing to calculate),
      `calculate` (stored, emissions calculated or being calculated).
    </ResponseField>

    <ResponseField name="status" type="string">
      **Available values:** `pending` (waiting for its chunk), `succeeded`, `failed`, `skipped`.
    </ResponseField>

    <ResponseField name="entity_id" type="uuid | null">
      Id of the entity created from the record, e.g. the waste id. For a record split across facilities, the id of the
      first waste of the group (the group shares it as `source_waste_id`).
    </ResponseField>

    <ResponseField name="error_code" type="string | null">
      Why the record failed, when `status` is `failed`. `CALCULATION_FAILED`: the entity was stored but its emissions
      could not be calculated (for example, no emission factor matches its LER/R/D codes, or it has no unit).
    </ResponseField>

    <ResponseField name="error_params" type="object | null">
      Values that explain the error, when available.
    </ResponseField>

    <ResponseField name="attempt_count" type="integer">
      How many times the record's calculation ran.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="integer">
  Number of items matching the filters.
</ResponseField>

<ResponseField name="page" type="integer">
  Current page.
</ResponseField>

<ResponseField name="size" type="integer">
  Page size.
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl "https://api.dcycle.io/v2/ingest-jobs/2d4b90c1-7c1e-4b6f-9a55-3f2b8e61d0aa/items?status=failed&size=500" \
    -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 os

  import requests

  url = "https://api.dcycle.io/v2/ingest-jobs/2d4b90c1-7c1e-4b6f-9a55-3f2b8e61d0aa/items"
  headers = {
      "x-api-key": os.environ["DCYCLE_API_KEY"],
      "x-organization-id": os.environ["DCYCLE_ORG_ID"],
  }

  page = 1
  while True:
      body = requests.get(url, headers=headers, params={"status": "failed", "size": 500, "page": page}, timeout=30).json()
      for item in body["items"]:
          print(item["source_row_index"], item["client_row_id"], item["entity_id"], item["error_code"])
      if page * body["size"] >= body["total"]:
          break
      page += 1
  ```

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

  const { data } = await axios.get(
    'https://api.dcycle.io/v2/ingest-jobs/2d4b90c1-7c1e-4b6f-9a55-3f2b8e61d0aa/items',
    {
      params: { status: 'failed', size: 500 },
      headers: {
        'x-api-key': process.env.DCYCLE_API_KEY,
        'x-organization-id': process.env.DCYCLE_ORG_ID,
      },
    },
  );
  data.items.forEach(item => console.log(item.client_row_id, item.error_code));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "items": [
    {
      "source_row_index": 88,
      "client_row_id": "ALB-2026-09-0089",
      "chunk_index": 0,
      "stage": "calculate",
      "status": "failed",
      "entity_id": "6a0c1f3e-2b7d-4c8e-9f10-4d5e6a7b8c9d",
      "error_code": "CALCULATION_FAILED",
      "error_params": null,
      "attempt_count": 1
    }
  ],
  "total": 1,
  "page": 1,
  "size": 500
}
```

<Note>
  A failed item still has an `entity_id`: the waste was stored, it just has no emissions. The usual causes are LER/R/D
  codes with no matching emission factor, or a missing unit.
</Note>

## Common Errors

### 401 Unauthorized

Missing or invalid API key.

### 404 Not Found

The job does not exist, or it belongs to an organization outside the one in `x-organization-id`.

### 422 Validation Error

An unknown `status` or `stage` value, or `size` outside 1 to 500.

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Get Ingest Job" icon="magnifying-glass" href="/api-reference/ingest-jobs/get">
    Status and progress of the job
  </Card>

  <Card title="Create Wastes (v2)" icon="plus" href="/api-reference/wastes/create-v2">
    Create one or up to 5,000 wastes in one request
  </Card>
</CardGroup>
