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

# List agents

> Lists non-deleted agents in a workspace with `workspace` or `organization` visibility, sorted by title. Private agents are excluded.




## OpenAPI

````yaml GET /workspace/{workspaceId}/agents
openapi: 3.1.0
info:
  title: TeamAI API
  version: '1.0'
  description: >
    REST API for TeamAI. Run agents and chat completions, and manage projects,
    files, and skills programmatically.
servers:
  - url: https://app.teamai.com/api/v1
security:
  - apiKey: []
tags:
  - name: Chat
  - name: Agents
  - name: Projects
  - name: Skills
paths:
  /workspace/{workspaceId}/agents:
    get:
      tags:
        - Agents
      summary: List agents
      description: >
        Lists non-deleted agents in a workspace with `workspace` or
        `organization` visibility, sorted by title. Private agents are excluded.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
            maximum: 100
          description: Page size. Values above 100 are clamped to 100.
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Paginated agent list.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      agents:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            title:
                              type: string
                            description:
                              type: string
                              nullable: true
                            image:
                              type: string
                              nullable: true
                            model:
                              type: string
                              nullable: true
                            visibility:
                              type: string
                              enum:
                                - workspace
                                - organization
                            category:
                              type: string
                              nullable: true
                            createdAt:
                              type: string
                              format: date-time
                            updatedAt:
                              type: string
                              format: date-time
                      pagination:
                        $ref: '#/components/schemas/Pagination'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/NotAuthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    workspaceId:
      name: workspaceId
      in: path
      required: true
      schema:
        type: string
      description: Workspace ID.
  schemas:
    Pagination:
      type: object
      properties:
        total:
          type: integer
          description: Total matching records.
        limit:
          type: integer
        offset:
          type: integer
    Error:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code.
          example: bad_request
        message:
          type: string
          description: Human-readable error description.
        details:
          type: object
          additionalProperties: true
          description: Additional error context.
  responses:
    BadRequest:
      description: Request body or parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotAuthenticated:
      description: >
        API key missing or invalid (`not_authenticated`), or valid but not
        permitted to access this resource (`unauthorized`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Requested resource does not exist or is not visible to this key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-teamai-api-key
      description: >
        Secret API key created in Workspace Settings → API Keys (workspace keys)
        or Organization Admin → API Keys (organization keys).

````