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

# List Agents

> Retrieve a paginated list of all AI agents associated with your account. Use this endpoint to get an overview of all your agents and their details.

## List Agents

Retrieve a paginated list of all AI agents associated with your account. Use this endpoint to get an overview of all your agents and their details.

<ParamField body="query" path="page" type="integer" required>
  The page number to retrieve (starts from 1)
</ParamField>

<ParamField body="query" path="per_page" type="integer" required>
  Number of agents to return per page (maximum 100)
</ParamField>

<ParamField body="header" path="Authorization" type="string" required>
  Bearer token in the format: `Bearer {access_token}`
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://app.aisync.link/api/ai/agent/list?page=1&per_page=100' \
    --header 'Authorization: Bearer {{bearer_token}}'
  ```
</CodeGroup>

<ResponseField name="data" type="array">
  Array of agent objects containing agent details
</ResponseField>

<ResponseField name="current_page" type="integer">
  The current page number
</ResponseField>

<ResponseField name="per_page" type="integer">
  Number of items per page
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of agents available
</ResponseField>

<Note>
  Use pagination parameters to efficiently retrieve large lists of agents. The maximum number of agents per page is 100.
</Note>


## OpenAPI

````yaml GET /api/ai/agent/list
openapi: 3.1.0
info:
  title: AI Sync OAuth API
  description: OAuth 2.0 API for authenticating and authorizing third-party applications
  version: 1.0.0
servers:
  - url: https://app.aisync.link
    description: Production server
security: []
paths:
  /api/ai/agent/list:
    get:
      tags:
        - AI Agents
      summary: List Agents
      description: >-
        Retrieve a paginated list of all AI agents associated with your account.
        Use this endpoint to get an overview of all your agents and their
        details.
      operationId: listAgents
      parameters:
        - name: page
          in: query
          description: The page number to retrieve (starts from 1)
          required: true
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: per_page
          in: query
          description: Number of agents to return per page (maximum 100)
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
      responses:
        '200':
          description: List of agents
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentListResponse'
        '401':
          description: Invalid or expired token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    AgentListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Agent'
          description: Array of agent objects containing agent details
        current_page:
          type: integer
          description: The current page number
        per_page:
          type: integer
          description: Number of items per page
        total:
          type: integer
          description: Total number of agents available
      required:
        - data
        - current_page
        - per_page
        - total
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code
        error_description:
          type: string
          description: Human-readable error description
        message:
          type: string
          description: Error message
      required:
        - error
    Agent:
      type: object
      properties:
        agent_id:
          type: string
          description: Unique identifier for the agent
        agent_name:
          type: string
          description: The name of the agent
        status:
          type: string
          description: Status of the agent (typically 'active' or 'pending')
        general_prompt:
          type: string
          description: The main system prompt for the agent
        weebhook_endpoint:
          type: string
          format: uri
          description: Webhook callback URL for call completion
        weebhook_endpoint_method:
          type: string
          enum:
            - GET
            - POST
          description: HTTP method for webhook callback
        created_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the agent was created
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the agent was last updated
      required:
        - agent_id
        - agent_name
        - status
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token authentication. Include the access token in the
        Authorization header as 'Bearer {access_token}'

````