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

> Returns a list of agents accessible to the authenticated user within their organization.

Supports optional pagination, filtering, and sorting. When pagination parameters are
provided, returns a paginated response with `totalRecordCount`. When no pagination
parameters are provided, returns a simple array for backward compatibility.

**Filtering**

- `name` — filter by agent name (case-insensitive contains match)
- `status` — filter by last run status (`RunStatus` enum):
  - not provided: no filter
  - `1` Running
  - `4` Queuing
  - `6` Failure
  - `7` Failed
  - `8` Stopped
  - `9` Completed
  - `10` Success

  Agents that have never run report `status = null`.
- `spaceId` — filter by space ID
- `configType` — filter by config type

**Sorting**

- `sortColumn` — `name` | `lastActivity` | `created` | `updated` | `status` | `configType` (default: `name`)
- `sortOrder` — `0` ascending (default) | `1` descending

**Response format**

- Without pagination params: array of agents (backward compatible)
- With pagination params: `{ agents: [...], totalRecordCount: N }`



## OpenAPI

````yaml GET /api/v1/agent/all
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/all:
    get:
      tags:
        - ApiAgent
      summary: Get all agents
      description: >-
        Returns a list of agents accessible to the authenticated user within
        their organization.


        Supports optional pagination, filtering, and sorting. When pagination
        parameters are

        provided, returns a paginated response with `totalRecordCount`. When no
        pagination

        parameters are provided, returns a simple array for backward
        compatibility.


        **Filtering**


        - `name` — filter by agent name (case-insensitive contains match)

        - `status` — filter by last run status (`RunStatus` enum):
          - not provided: no filter
          - `1` Running
          - `4` Queuing
          - `6` Failure
          - `7` Failed
          - `8` Stopped
          - `9` Completed
          - `10` Success

          Agents that have never run report `status = null`.
        - `spaceId` — filter by space ID

        - `configType` — filter by config type


        **Sorting**


        - `sortColumn` — `name` | `lastActivity` | `created` | `updated` |
        `status` | `configType` (default: `name`)

        - `sortOrder` — `0` ascending (default) | `1` descending


        **Response format**


        - Without pagination params: array of agents (backward compatible)

        - With pagination params: `{ agents: [...], totalRecordCount: N }`
      parameters:
        - name: pageIndex
          in: query
          description: >-
            Page number (1-based). If provided with recordsPerPage, enables
            pagination.
          schema:
            type: integer
            format: int32
        - name: recordsPerPage
          in: query
          description: >-
            Number of records per page. If provided with pageIndex, enables
            pagination.
          schema:
            type: integer
            format: int32
        - name: sortColumn
          in: query
          description: >-
            Column to sort by: name, lastActivity, created, updated, status,
            configType
          schema:
            type: string
            default: name
        - name: sortOrder
          in: query
          description: 'Sort order: 0 = ascending (default), 1 = descending'
          schema:
            type: integer
            format: int32
            default: 0
        - name: name
          in: query
          description: Filter by agent name (contains match, case-insensitive)
          schema:
            type: string
        - name: status
          in: query
          description: >-
            Filter by last run status (RunStatus: 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). Agents
            that never ran have null status.
          schema:
            type: integer
            format: int32
        - name: spaceId
          in: query
          description: Filter by space ID
          schema:
            type: integer
            format: int32
        - name: configType
          in: query
          description: Filter by config type
          schema:
            $ref: '#/components/schemas/ConfigType'
        - name: includeArchived
          in: query
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: >-
            Returns the list of agents (array without pagination, object with
            pagination)
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentApiModel'
        '400':
          description: If the request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: If the API key is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    ConfigType:
      enum:
        - 1
        - 2
        - 3
        - 4
      type: integer
      description: '`1` = `Agent`; `2` = `SharedFile`; `3` = `Template`; `4` = `Command`'
      format: int32
    AgentApiModel:
      type: object
      properties:
        agentTemplates:
          type: string
          nullable: true
        configType:
          $ref: '#/components/schemas/ConfigType'
        description:
          type: string
          nullable: true
        documentation:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
        image:
          type: string
          format: byte
          nullable: true
        inputParameters:
          type: object
          additionalProperties:
            type: string
          nullable: true
        id:
          type: integer
          format: int32
          nullable: true
        isActive:
          type: boolean
          readOnly: true
        lastActivity:
          type: string
          format: date-time
          nullable: true
        name:
          type: string
          nullable: true
        proxyPoolId:
          type: integer
          format: int32
          nullable: true
        spaceId:
          type: integer
          format: int32
          nullable: true
        startUrl:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        userId:
          type: integer
          format: int32
          nullable: true
        validationStatus:
          $ref: '#/components/schemas/ConfigValidationStatus'
        version:
          type: integer
          format: int32
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      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: {}
    ConfigValidationStatus:
      enum:
        - 1
        - 2
        - 3
      type: integer
      description: "Semantic validation status of a config's most recently saved definition (e.g. whether every\r\nfixed export schema column is actually produced by a command). Serialized as its underlying\r\nint, not a string - see Sequentum.Enterprise.ControlCenter.Swagger.EnumDescriptionsSchemaFilter\r\nfor how these values get documented in the public OpenAPI spec. (`1` = `Unknown` - Validation status was not computed for this response (e.g. a historical config version, which does not retain its own stored status); `2` = `Invalid` - The config has one or more semantic validation errors (e.g. a required export column with no producing command); `3` = `Valid` - The config has no semantic validation errors)"
      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

````