> ## Documentation Index
> Fetch the complete documentation index at: https://www.octoparse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List upstream calls (debug runs)

> Inspect the timeline of every upstream HTTP interaction in an author debug run for troubleshooting.

**`GET`** `https://api-datahub.octoparse.com/v1/runs/{run_id}/upstream-calls`

Authentication: API key required, and only the app author (publisher) may call it. Everyone else gets `404`.

Upstream-call timeline for debug runs (`run_kind=test`). For api-type runs, each upstream HTTP interaction (`submit` / `status` / `fetch`) is one entry. `summary` aggregates the full trail by (attempt, stage), independent of pagination, so you can see which stage is stuck at a glance. `items` carries metadata only; request and response bodies are loaded on demand from the single-call detail endpoint.

You can only read your own debug runs. Another account’s runs, missing runs, and **production runs** all return `404`. Credential and environment values are redacted on write; values marked `sensitive` in the input contract are redacted again on read. Code-type runs have no HTTP trail and return an empty list.

## Request

### Path parameters

<ParamField path="run_id" type="string" required>
  Debug run id.
</ParamField>

### Query parameters

<ParamField query="offset" type="integer" default="0">
  Pagination offset.

  Range ≥ 0.
</ParamField>

<ParamField query="limit" type="integer" default="50">
  Page size.

  Range 1 to 500.
</ParamField>

<ParamField query="stage" type="string">
  Filter to one stage. `submit` submits work, `status` polls status, `fetch` retrieves data.

  Values: `submit` / `status` / `fetch`.
</ParamField>

### Example request

```bash theme={null}
curl \
  -H "Authorization: Bearer $OCTOPARSE_API_KEY" \
  "https://api-datahub.octoparse.com/v1/runs/run_c62bc0fb8df2/upstream-calls"
```

## Response

### 200 success

```json theme={null}
{
  "data": {
    "run_id": "string",
    "summary": [
      {
        "attempt": 0,
        "stage": "string",
        "calls": 0,
        "last_status_code": 0,
        "last_error": "string",
        "duration_ms_sum": 0,
        "first_at": "string",
        "last_at": "string"
      }
    ],
    "items": [
      {
        "call_id": 0,
        "attempt": 0,
        "seq": 0,
        "stage": "string",
        "method": "string",
        "url": "string",
        "status_code": 0,
        "error": "string",
        "duration_ms": 0,
        "response_truncated": false,
        "created_at": "string"
      }
    ],
    "pagination": {
      "offset": 0,
      "limit": 0,
      "count": 0,
      "total": 0,
      "has_more": false
    }
  }
}
```

The payload is wrapped in `data`. Fields:

<ResponseField name="run_id" type="string" required>
  —
</ResponseField>

<ResponseField name="summary" type="object[]" required>
  Stats aggregated by (attempt, stage).

  <Expandable title="fields">
    <ResponseField name="attempt" type="integer" required>
      —
    </ResponseField>

    <ResponseField name="stage" type="string" required>
      —
    </ResponseField>

    <ResponseField name="calls" type="integer" required>
      —
    </ResponseField>

    <ResponseField name="last_status_code" type="integer">
      —
    </ResponseField>

    <ResponseField name="last_error" type="string">
      —
    </ResponseField>

    <ResponseField name="duration_ms_sum" type="integer">
      —
    </ResponseField>

    <ResponseField name="first_at" type="string">
      —
    </ResponseField>

    <ResponseField name="last_at" type="string">
      —
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="items" type="object[]" required>
  Call metadata entries.

  <Expandable title="fields">
    <ResponseField name="call_id" type="integer" required>
      Entry id. Use it to load detail.
    </ResponseField>

    <ResponseField name="attempt" type="integer" required>
      Attempt number.
    </ResponseField>

    <ResponseField name="seq" type="integer" required>
      —
    </ResponseField>

    <ResponseField name="stage" type="string" required>
      Stage.
    </ResponseField>

    <ResponseField name="method" type="string" required>
      HTTP method.
    </ResponseField>

    <ResponseField name="url" type="string" required>
      Request URL (credentials redacted).
    </ResponseField>

    <ResponseField name="status_code" type="integer">
      Upstream response status code.
    </ResponseField>

    <ResponseField name="error" type="string">
      —
    </ResponseField>

    <ResponseField name="duration_ms" type="integer">
      Duration in milliseconds.
    </ResponseField>

    <ResponseField name="response_truncated" type="boolean">
      —
    </ResponseField>

    <ResponseField name="created_at" type="string" required>
      —
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object" required>
  Pagination object.

  <Expandable title="fields">
    <ResponseField name="offset" type="integer">
      —
    </ResponseField>

    <ResponseField name="limit" type="integer">
      —
    </ResponseField>

    <ResponseField name="count" type="integer">
      —
    </ResponseField>

    <ResponseField name="total" type="integer">
      —
    </ResponseField>

    <ResponseField name="has_more" type="boolean">
      —
    </ResponseField>
  </Expandable>
</ResponseField>

### Errors

| HTTP | `code`                     | `category`  | Description                                                                                                                                  |
| ---- | -------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| 401  | `unauthorized`             | `forbidden` | Missing or invalid API key.                                                                                                                  |
| 404  | `upstream-calls-not-found` | `not_found` | Only debug runs (`run_kind=test`) keep an upstream-call trail. Production runs, other people’s runs, and missing runs all return this error. |

Error responses use `{"error": {code, category, message, retryable}}`. See <a href="/docs/en/datahub/api/reference/introduction#errors">Errors</a>.

## Client libraries

The Python and JavaScript SDKs do not wrap this endpoint yet. Call REST directly.
