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

# Upstream call audit (debug runs only, owner only)

> Upstream call timeline of a debug run (run_kind=test): one entry
per upstream HTTP interaction of an api kind run (submit / status /
fetch). `summary` aggregates the full audit trail by (attempt,
stage) (independent of pagination — see at a glance which stage is
stuck); `items` carries metadata only — request/response bodies are
fetched on demand via the single-entry detail endpoint.

You can only read your own debug runs: someone else's, nonexistent
and production runs all return 404. Credentials and environment
values are masked on the write side; values marked `sensitive` in
the input contract are masked again on the read side. code kind
runs have no HTTP audit trail and return an empty list.



## OpenAPI

````yaml /jp/datahub/api/openapi.json get /v1/runs/{run_id}/upstream-calls
openapi: 3.1.0
info:
  title: DataHub API
  version: 0.2.0
  description: Public /v1 contract of Octoparse DataHub. Internal channels are excluded.
servers:
  - url: https://api-datahub.octoparse.com
security:
  - bearerAuth: []
tags:
  - name: Discovery
    description: >-
      Anonymous access: platform metadata (currency), data app search, detail
      and input contract, machine-readable manifest spec.
  - name: Publishing
    description: >-
      Self-service publishing channel (API Key auth), two-phase: validate first
      (validate / package, nothing persisted), then publish (POST /data-apps,
      the submission goes live as a new Release). api kind (declarative
      integration) becomes visible on publish; code kind (code package) returns
      202 and enters an async image build; once ready it is promoted to a
      Release, visible and runnable. Poll progress via GET
      /data-apps/{ref}/builds.
  - name: Runs & Results
    description: >-
      Start / query / cancel runs and read result records with pagination.
      Business inputs go in the request body; platform run options (wait,
      max_records) go in query parameters.
  - name: Datasets
    description: >-
      Metadata and record access for platform datasets (including seeded stock
      data).
  - name: Account
    description: Account info and cumulative usage for the current API Key.
  - name: Secrets
    description: >-
      CRUD for upstream credentials (environment entries referenced by manifest
      `runtime.env`). Plaintext is write-only: every read returns a mask.
paths:
  /v1/runs/{run_id}/upstream-calls:
    get:
      tags:
        - Runs & Results
      summary: Upstream call audit (debug runs only, owner only)
      description: |-
        Upstream call timeline of a debug run (run_kind=test): one entry
        per upstream HTTP interaction of an api kind run (submit / status /
        fetch). `summary` aggregates the full audit trail by (attempt,
        stage) (independent of pagination — see at a glance which stage is
        stuck); `items` carries metadata only — request/response bodies are
        fetched on demand via the single-entry detail endpoint.

        You can only read your own debug runs: someone else's, nonexistent
        and production runs all return 404. Credentials and environment
        values are masked on the write side; values marked `sensitive` in
        the input contract are masked again on the read side. code kind
        runs have no HTTP audit trail and return an empty list.
      operationId: run_upstream_calls_page_v1_runs__run_id__upstream_calls_get
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            title: Run Id
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            default: 50
            title: Limit
        - name: stage
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                pattern: ^(submit|status|fetch)$
              - type: 'null'
            title: Stage
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataEnvelope_UpstreamCallsPage_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DataEnvelope_UpstreamCallsPage_:
      properties:
        data:
          $ref: '#/components/schemas/UpstreamCallsPage'
      type: object
      required:
        - data
      title: DataEnvelope[UpstreamCallsPage]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UpstreamCallsPage:
      properties:
        run_id:
          type: string
          title: Run Id
        summary:
          items:
            $ref: '#/components/schemas/UpstreamStageSummary'
          type: array
          title: Summary
        items:
          items:
            $ref: '#/components/schemas/UpstreamCallMeta'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - run_id
        - summary
        - items
        - pagination
      title: UpstreamCallsPage
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UpstreamStageSummary:
      properties:
        attempt:
          type: integer
          title: Attempt
        stage:
          type: string
          title: Stage
        calls:
          type: integer
          title: Calls
        last_status_code:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last Status Code
        last_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error
        duration_ms_sum:
          type: integer
          title: Duration Ms Sum
          default: 0
        first_at:
          anyOf:
            - type: string
            - type: 'null'
          title: First At
        last_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last At
      type: object
      required:
        - attempt
        - stage
        - calls
      title: UpstreamStageSummary
      description: >-
        Per-(attempt, stage) aggregate: answers "which stage is stuck" at a
        glance.
    UpstreamCallMeta:
      properties:
        call_id:
          type: integer
          title: Call Id
        attempt:
          type: integer
          title: Attempt
        seq:
          type: integer
          title: Seq
        stage:
          type: string
          title: Stage
        method:
          type: string
          title: Method
        url:
          type: string
          title: Url
        status_code:
          anyOf:
            - type: integer
            - type: 'null'
          title: Status Code
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
        response_truncated:
          type: boolean
          title: Response Truncated
          default: false
        created_at:
          type: string
          title: Created At
      type: object
      required:
        - call_id
        - attempt
        - seq
        - stage
        - method
        - url
        - created_at
      title: UpstreamCallMeta
      description: |-
        Metadata of one recorded upstream call (owner-only debug readback).
        The list shape omits request/response bodies; fetch them from the
        single-call detail endpoint. Status polling easily produces hundreds of
        calls, so the list stays light.
    Pagination:
      properties:
        offset:
          type: integer
          title: Offset
          default: 0
        limit:
          type: integer
          title: Limit
          default: 0
        count:
          type: integer
          title: Count
          default: 0
        total:
          type: integer
          title: Total
          default: 0
        has_more:
          type: boolean
          title: Has More
          default: false
      type: object
      title: Pagination
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: DataHub API Key

````