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

# List Agents

> Retrieve a list of agents or create a new agent.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://api.roe-ai.com/v1/agents/?organization_id=YOUR_ORG_ID" \
    --header "Authorization: Bearer YOUR_API_KEY"
  ```
</RequestExample>


## OpenAPI

````yaml GET /v1/agents/
openapi: 3.1.0
info:
  title: Roe AI API
  version: 1.0.0
  description: Complete API documentation for Roe AI platform
servers:
  - url: https://api.roe-ai.com
    description: Production API
security: []
paths:
  /v1/agents/:
    get:
      tags:
        - v1
      summary: List agents or create a new agent.
      description: Retrieve a list of agents or create a new agent.
      operationId: v1_agents_list
      parameters:
        - in: query
          name: engine_class_id
          schema:
            type: string
          description: Filter agents by engine type.
        - in: query
          name: exclude_engine_class_id
          schema:
            type: string
          description: Exclude agents with this engine type.
        - in: query
          name: include_job_stats
          schema:
            type: boolean
          description: >-
            Include job_count and most_recent_job in response (default: true).
            Set to false for faster response.
        - in: query
          name: ordering
          schema:
            type: string
          description: >-
            Field to order results by. Prefix with '-' for descending. Options:
            name, created_at, most_recent_job, job_count, engine_class_id,
            creator.
        - in: query
          name: organization_id
          schema:
            type: string
            format: uuid
          description: Organization ID to list agents from.
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Search term to filter agents by name, ID, engine, creator, tags, or
            version IDs (case-insensitive).
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: Filter agents by tag IDs. Can be provided multiple times.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedBaseAgentList'
          description: Successfully retrieved list of agents.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: organization_id query parameter is required.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Access to the Agents feature is forbidden or organization access
            denied.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Organization not found.
components:
  schemas:
    PaginatedBaseAgentList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/BaseAgent'
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
      required:
        - message
    BaseAgent:
      type: object
      description: Serializer for BaseAgent (agent config)
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        creator:
          oneOf:
            - $ref: '#/components/schemas/UserInfo'
            - type: 'null'
        created_at:
          type: string
          format: date-time
          readOnly: true
        name:
          type: string
          maxLength: 200
          minLength: 1
        disable_cache:
          type: boolean
          description: Whether to disable job cache fetching for this agent.
        cache_failed_jobs:
          type: boolean
          description: Whether to cache failed jobs for this agent.
        organization_id:
          type: string
          format: uuid
          description: Organization ID that owns this agent.
        engine_class_id:
          type: string
          maxLength: 200
        current_version_id:
          type: string
          format: uuid
          readOnly: true
          description: UUID of the current agent version.
        job_count:
          type:
            - integer
            - 'null'
          description: >-
            Job count from annotation, or None when not fetched (use
            /agents/job-stats/).
          readOnly: true
        most_recent_job:
          type: string
          readOnly: true
        engine_name:
          type: string
          description: Engine Display Name
          readOnly: true
        tags:
          type: string
          readOnly: true
      required:
        - cache_failed_jobs
        - created_at
        - current_version_id
        - disable_cache
        - engine_class_id
        - engine_name
        - id
        - job_count
        - most_recent_job
        - name
        - organization_id
        - tags
    UserInfo:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        email:
          type: string
          format: email
          title: Email address
          maxLength: 254
        first_name:
          type: string
          maxLength: 150
        last_name:
          type: string
          maxLength: 150
        display_name:
          type: string
          readOnly: true
      required:
        - display_name
        - email
        - id

````