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

# List runs for an agent

> Returns a list of all runs and run history for an agent. Most recent records are returned first.



## OpenAPI

````yaml GET /api/v1/agent/{agentId}/runs
openapi: 3.0.1
info:
  title: Sequentum Cloud API
  description: API endpoints for Sequentum Cloud
  version: v1
servers: []
security:
  - ApiKey: []
    Bearer: []
paths:
  /api/v1/agent/{agentId}/runs:
    get:
      tags:
        - ApiAgent
      summary: Get all runs for agent
      description: >-
        Returns a list of all runs and run history for an agent. Most recent
        records are returned first.
      parameters:
        - name: agentId
          in: path
          description: The id of the agent
          required: true
          schema:
            type: integer
            format: int32
        - name: maxRecords
          in: query
          description: >-
            The maximum number of records to return. If not specified, only the
            most recent 50 runs will be returned.
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentRunApiModel'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    AgentRunApiModel:
      type: object
      properties:
        id:
          type: integer
          format: int64
        configId:
          type: integer
          format: int64
        configName:
          type: string
          nullable: true
        spaceId:
          type: integer
          format: int32
        organizationId:
          type: integer
          format: int32
        organizationName:
          type: string
          nullable: true
        sequence:
          type: integer
          format: int64
        parallelism:
          type: integer
          format: int32
          nullable: true
        parallelMaxConcurrency:
          type: integer
          format: int32
          nullable: true
        parallelExport:
          $ref: '#/components/schemas/ParallelExport'
        parallelSet:
          type: integer
          format: int32
          nullable: true
        startTime:
          type: string
          format: date-time
          nullable: true
        endTime:
          type: string
          format: date-time
          nullable: true
        created:
          type: string
          format: date-time
          nullable: true
        status:
          $ref: '#/components/schemas/RunStatus'
        message:
          type: string
          nullable: true
        configVersion:
          type: integer
          format: int32
          nullable: true
        actionCount:
          type: integer
          format: int32
        pageCount:
          type: integer
          format: int32
        dynamicPageCount:
          type: integer
          format: int32
        requestCount:
          type: integer
          format: int32
        dataCount:
          type: integer
          format: int32
        inputCount:
          type: integer
          format: int32
          nullable: true
        errorCount:
          type: integer
          format: int32
        exportCount:
          type: integer
          format: int32
          nullable: true
        traffic:
          type: integer
          format: int64
          nullable: true
        runTimeSec:
          type: integer
          format: int32
          nullable: true
        serverName:
          type: string
          nullable: true
        tableType:
          type: string
          nullable: true
      additionalProperties: false
    BadRequestError:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
        statusDescription:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
          readOnly: true
        severity:
          $ref: '#/components/schemas/ErrorSeverity'
        errorCode:
          type: string
          description: "Optional machine-readable error code. When present, clients should switch on this\r\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. Omitted from the response when null."
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    InternalServerError:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
        statusDescription:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
          readOnly: true
        severity:
          $ref: '#/components/schemas/ErrorSeverity'
        errorCode:
          type: string
          description: "Optional machine-readable error code. When present, clients should switch on this\r\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. Omitted from the response when null."
          nullable: true
      additionalProperties: false
    ParallelExport:
      enum:
        - Combined
        - Separated
      type: string
      description: '`0` = `Combined`; `1` = `Separated`'
    RunStatus:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
      type: integer
      description: >-
        `0` = `Invalid`; `1` = `Running`; `2` = `Exporting`; `3` = `Starting`;
        `4` = `Queuing`; `5` = `Stopping`; `6` = `Failure`; `7` = `Failed`; `8`
        = `Stopped`; `9` = `Completed`; `10` = `Success`; `11` = `Skipped`; `12`
        = `Waiting`
      format: int32
    ErrorSeverity:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
      type: integer
      description: >-
        `0` = `Error`; `1` = `Unexpected`; `2` = `Fatal`; `3` = `Warning`; `4` =
        `Info`
      format: int32
  securitySchemes:
    ApiKey:
      type: apiKey
      description: >-
        API Key authorization header. Example: "Authorization: ApiKey
        {your-api-key}"
      name: Authorization
      in: header
    Bearer:
      type: http
      description: 'OAuth 2.0 Bearer token. Example: "Authorization: Bearer {access-token}"'
      scheme: bearer
      bearerFormat: JWT

````