> ## Documentation Index
> Fetch the complete documentation index at: https://beta-docs-prod.indices.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List runs

> <p>List runs of a given connector.</p>



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/indices/openapi.documented.yml get /v1beta/runs
openapi: 3.1.0
info:
  title: Indices API
  description: 'The Indices REST API. See docs for details: https://docs.indices.io'
  version: 0.0.1
servers:
  - url: https://api.indices.io
security:
  - ApiKeyAuth: []
tags:
  - name: Capture Sessions
    description: >-
      Record a browser session; a completed capture is a reusable input for
      building connectors.
  - name: Connectors
    description: Manage connectors.
  - name: Runs
    description: Execute a connector.
  - name: Secrets
    description: Manage secrets like login credentials and API keys.
paths:
  /v1beta/runs:
    get:
      tags:
        - Runs
      summary: List runs
      description: <p>List runs of a given connector.</p>
      operationId: listRuns
      parameters:
        - name: connector_id
          in: query
          required: true
          schema:
            type: string
            description: The ID of the connector to list runs for.
            title: Connector Id
          description: The ID of the connector to list runs for.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Maximum number of runs to return.
            default: 20
            title: Limit
          description: Maximum number of runs to return.
        - name: cursor
          in: query
          required: false
          schema:
            description: >-
              Cursor from a previous response's `next_cursor`, to fetch the next
              page.
            title: Cursor
            type: string
          description: >-
            Cursor from a previous response's `next_cursor`, to fetch the next
            page.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListRunsResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Indices from 'indicesio';


            const client = new Indices({
              apiKey: process.env['INDICES_API_KEY'], // This is the default and can be omitted
            });


            // Automatically fetches more pages as needed.

            for await (const run of client.beta.runs.list({ connector_id:
            'connector_id' })) {
              console.log(run.id);
            }
        - lang: Python
          source: |-
            import os
            from indices import Indices

            client = Indices(
                api_key=os.environ.get("INDICES_API_KEY"),  # This is the default and can be omitted
            )
            page = client.beta.runs.list(
                connector_id="connector_id",
            )
            page = page.data[0]
            print(page.id)
components:
  schemas:
    ListRunsResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/Run'
          type: array
          description: Runs for the requested page, ordered newest first.
        has_more:
          type: boolean
          description: Whether more runs exist after this page.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Pass as the `cursor` query parameter to fetch the next page. Null
            when has_more is false.
      type: object
      required:
        - data
        - has_more
        - next_cursor
      title: ListRunsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Run:
      properties:
        id:
          type: string
          description: Unique identifier for the object.
        connector_id:
          type: string
          description: ID of the connector executed in this run.
        arguments:
          additionalProperties: true
          type: object
          description: Arguments in this run for the connector's input parameters.
        secret_bindings:
          additionalProperties:
            type: string
          type: object
          description: >-
            Secrets to use for this run. This dict must be a mapping of secret
            slot names to secret IDs.
        status:
          $ref: '#/components/schemas/RunStatus'
          description: >-
            Lifecycle status of the run: `pending`, `running`, `success`,
            `connector_error`, `timed_out`, `result_too_large`, or
            `internal_error`. `connector_error` means the connector's code
            failed (see `error`); `timed_out` and `internal_error` are platform
            outcomes worth retrying; `result_too_large` is not retryable as-is.
        result_json:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Execution result of the run. In JSON, matching the connector's
            output schema. Limited to 100MB; results above 100MB will be
            truncated and result in a `result_too_large` status.
        error:
          anyOf:
            - $ref: '#/components/schemas/RunError'
            - type: 'null'
          description: >-
            Why the run failed. Present iff `status` is `connector_error`; for
            platform failures the status itself is the reason.
        has_logs:
          type: boolean
          description: Whether the run has associated logs
        created_at:
          type: string
          format: date-time
          description: Timestamp when the object was created.
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Timestamp when the object was last updated.
      type: object
      required:
        - id
        - connector_id
        - arguments
        - status
        - result_json
        - error
        - has_logs
        - created_at
        - finished_at
      title: Run
    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
    RunStatus:
      type: string
      enum:
        - pending
        - running
        - success
        - connector_error
        - timed_out
        - result_too_large
        - internal_error
      title: RunStatus
    RunError:
      properties:
        type:
          type: string
          description: >-
            Machine-readable failure type: `auth_required`, `invalid_input`,
            `site_unavailable`, `site_changed`, `crash`, or `unhandled`.
        message:
          type: string
          description: Human-readable description of the failure.
        retryable:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Whether retrying the run with the same arguments is expected to
            succeed. Null when unknown.
        exception:
          anyOf:
            - type: string
            - type: 'null'
          description: Exception class name, when the failure came from a raised exception.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: Structured context reported by the connector.
      type: object
      required:
        - type
        - message
        - retryable
        - exception
        - details
      title: RunError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Enter your API key as the bearer token. Set header: `Authorization` to
        `Bearer <api_key>`

````