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

# List Agents

> List all agents in your organization and find botId values

**What it does:** Returns a paginated list of every voice agent in your organization. Use it to find `botId` values before calling [Get Agent](https://docs.gnani.ai/Platform/Get_Agent.md), [Update Agent](https://docs.gnani.ai/Platform/Update_Agent.md), or [Trigger Call](https://docs.gnani.ai/Platform/Trigger_Call.md).

## Required Permission

`agents`

## Minimum working example

```bash theme={null}
curl "https://api.inya.ai/platform/v1/agents?pageNo=1&pageSize=10" \
  -H "x-api-key: <your_api_key>"
```

## Additional examples

### Search by name

```bash theme={null}
curl "https://api.inya.ai/platform/v1/agents?search=support&pageNo=1&pageSize=10" \
  -H "x-api-key: <your_api_key>"
```

## Query parameters

| Name | Required | Default | Description |
| - | - | - | - |
| `pageNo` | No | `1` | Page number. Must be `1` or higher — `pageNo=0` returns HTTP `500`. |
| `pageSize` | No | `10` | Agents per page. |
| `search` | No | — | Partial match on agent name. |

## Response

### Success (200)

```json theme={null}
{
  "status": "success",
  "message": "Agents retrieved successfully",
  "response": {
    "pageNo": 1,
    "pageSize": 10,
    "totalCount": 25,
    "totalPages": 3,
    "bots": [
      {
        "botId": "fb79920229d144608ebf665a10e50275",
        "botName": "Support Agent",
        "botInfo": {
          "botDescription": "Handles inbound customer support calls.",
          "botLanguage": ["en-IN"],
          "botRegion": "asia",
          "botTimezone": "Asia/Kolkata"
        },
        "createdAt": "2026-07-30T16:07:46.636000",
        "updatedAt": "2026-07-30T16:07:46.636000"
      }
    ]
  },
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

### What each field means

| Field | What it is |
| - | - |
| `bots[].botId` | **Copy this.** Use in Get, Update, Trigger Call, and FAQ endpoints. |
| `bots[].botName` | Display name shown in the dashboard and conversation logs. |
| `bots[].botInfo` | Summary only — language, region, timezone, description. |
| `bots[].createdAt` / `updatedAt` | ISO 8601 timestamps. |
| `totalCount` / `totalPages` | Use to paginate — increment `pageNo` until it exceeds `totalPages`. |

## List vs Get — which one do I need?

| Need | Use List | Use Get |
| - | - | - |
| Find `botId` by name | Yes | No |
| Full prompt, ASR, TTS, webhook config | No | Yes |
| Check `hasPostCallTrigger` | No | Yes |
| Build an agent picker UI | Yes | No |

## Edge cases

| Scenario | What happens |
| - | - |
| `pageNo: 0` | HTTP `500` — always start at `1` |
| `search` with no matches | `totalCount: 0`, empty `bots` array |
| Large org | Set `pageSize: 100` and loop pages |

## Errors

**500 Internal Server Error** - Invalid page number

Sending `pageNo=0` (or any value below `1`) returns HTTP `500`. Always start pagination at `pageNo=1`.

```json theme={null}
{
  "status": "failure",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "Internal server error"
}
```

> [!TIP]
>
> Use `search` to locate an agent by name instead of paginating through every page manually.

> [!NOTE]
>
> Save the `requestId` from every response. You will need it if you contact Gnani support to trace a specific request.


## OpenAPI

````yaml GET /v1/agents
openapi: 3.0.3
info:
  title: Platform Agents API
  description: API endpoints for creating, managing, and interacting with voice agents
  version: 2.1.0
servers:
  - url: https://api.inya.ai/platform
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Agent management operations
  - name: AgentFAQ
    description: Agent FAQ management
  - name: AgentCallTriggers
    description: Outbound call triggers
  - name: ChatSDK
    description: Chat Widget configuration
  - name: Conversations
    description: Conversation logs, statistics, and audio
paths:
  /v1/agents:
    get:
      tags:
        - Agents
      summary: List all agents
      description: >-
        Retrieve a paginated list of all agents belonging to your organization.
        Results can be filtered by name.
      operationId: listAgents
      parameters:
        - name: search
          in: query
          description: Filter results by agent name (partial match)
          required: false
          schema:
            type: string
        - name: pageNo
          in: query
          description: Page number to retrieve. Default 1.
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: pageSize
          in: query
          description: Number of agents per page. Default 10.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
      responses:
        '200':
          description: Agents retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
              examples:
                success:
                  value:
                    status: success
                    requestId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    message: Agents retrieved successfully
                    response:
                      pageNo: 1
                      pageSize: 10
                      totalCount: 1
                      totalPages: 1
                      bots:
                        - botId: fb79920229d144608ebf665a10e50275
                          botName: Support Agent
                          botInfo:
                            botDescription: Handles inbound customer support calls.
                            botLanguage:
                              - en-IN
                            botRegion: asia
                            botTimezone: Asia/Kolkata
                          createdAt: '2026-04-01T10:00:00Z'
                          updatedAt: '2026-07-01T12:00:00Z'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    StandardResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        requestId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        message:
          type: string
        response:
          type: object
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: failure
        requestId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        message:
          type: string
  responses:
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key with 'agents' permission

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.