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

# 업스트림 호출 목록

> 디버그 실행 업스트림 타임라인.

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

인증: API 키 필요. App 작성자(게시자)만. 그 외 `404`.

디버그 실행(`run_kind=test`)의 업스트림 호출 타임라인. api 유형 실행에서는 업스트림과의 HTTP 상호작용(`submit` / `status` / `fetch`) 하나가 항목 하나입니다. `summary`는 페이징과 관계없이 전체 기록을 (시도, 단계)별로 집계하므로 어느 단계에서 막혔는지 한눈에 알 수 있습니다. `items`에는 메타데이터만 있으며, 요청과 응답 본문은 단일 호출 상세 엔드포인트에서 필요할 때 불러옵니다.

내 디버그 실행만 조회할 수 있습니다. 다른 계정의 실행, 존재하지 않는 실행, **프로덕션 실행**은 모두 `404`를 반환합니다. 자격 증명과 환경 값은 기록 시 마스킹되며, 입력 계약에서 `sensitive`로 표시된 값은 조회 시 다시 마스킹됩니다. code 유형 실행에는 HTTP 기록이 없으므로 빈 목록을 반환합니다.

## 요청

### 경로 파라미터

<ParamField path="run_id" type="string" required>
  디버그 실행 ID.
</ParamField>

### 쿼리 파라미터

<ParamField query="offset" type="integer" default="0">
  페이지 오프셋.

  범위 ≥ 0.
</ParamField>

<ParamField query="limit" type="integer" default="50">
  페이지 크기.

  범위는 1\~500입니다.
</ParamField>

<ParamField query="stage" type="string">
  하나의 단계로 필터링합니다. `submit`은 작업 제출, `status`는 상태 폴링, `fetch`는 데이터 조회입니다.

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

### 요청 예시

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

## 응답

### 200 성공

```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
    }
  }
}
```

페이로드는 `data`로 감쌉니다. 필드:

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

<ResponseField name="summary" type="object[]" required>
  (시도, 단계)별로 집계한 통계.

  <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>
  호출 메타데이터 항목.

  <Expandable title="fields">
    <ResponseField name="call_id" type="integer" required>
      항목 ID. 상세를 불러올 때 사용합니다.
    </ResponseField>

    <ResponseField name="attempt" type="integer" required>
      시도 번호.
    </ResponseField>

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

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

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

    <ResponseField name="url" type="string" required>
      요청 URL(자격 증명은 마스킹됨).
    </ResponseField>

    <ResponseField name="status_code" type="integer">
      업스트림 응답 상태 코드.
    </ResponseField>

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

    <ResponseField name="duration_ms" type="integer">
      소요 시간(밀리초).
    </ResponseField>

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

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

<ResponseField name="pagination" type="object" required>
  페이징 객체.

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

### 오류

| HTTP | `code`                     | `category`  | 설명                                                    |
| ---- | -------------------------- | ----------- | ----------------------------------------------------- |
| 401  | `unauthorized`             | `forbidden` | API 키 누락 또는 무효.                                       |
| 404  | `upstream-calls-not-found` | `not_found` | 업스트림 트레일은 디버그 실행(`run_kind=test`)만. 프로덕션·타인·없음은 이 오류. |

오류 응답은 `{"error": {code, category, message, retryable}}`입니다. <a href="/docs/ko/datahub/api/reference/introduction#errors">오류</a> 참고.

## 클라이언트 라이브러리

Python / JavaScript SDK는 아직 이 엔드포인트를 감싸지 않습니다. REST를 직접 호출하세요.
