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

# List Agents

> List all agents in your account

## Request

Retrieve a paginated list of all AI voice agents in your account.

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer YOUR_API_KEY`
</ParamField>

### Query Parameters

<ParamField query="limit" type="integer" default="20">
  Number of agents to return (1-100)
</ParamField>

<ParamField query="cursor" type="string">
  Pagination cursor from a previous response
</ParamField>

<ParamField query="status" type="string">
  Filter by status: `active` or `inactive`
</ParamField>

<ParamField query="search" type="string">
  Search agents by name
</ParamField>

<ParamField query="order" type="string" default="desc">
  Sort order: `asc` or `desc` (by created\_at)
</ParamField>

## Response

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

<ResponseField name="has_more" type="boolean">
  Whether there are more results available
</ResponseField>

<ResponseField name="next_cursor" type="string">
  Cursor for fetching the next page
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of agents matching the filter
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.ringyo.ai/v1/agents?limit=10&status=active" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const params = new URLSearchParams({
    limit: '10',
    status: 'active',
  });

  const response = await fetch(
    `https://api.ringyo.ai/v1/agents?${params}`,
    {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
      },
    }
  );

  const { data, has_more } = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.ringyo.ai/v1/agents',
      headers={'Authorization': 'Bearer YOUR_API_KEY'},
      params={
          'limit': 10,
          'status': 'active'
      }
  )

  data = response.json()
  agents = data['data']
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "data": [
      {
        "id": "agent_abc123",
        "name": "Sales Assistant",
        "voice_id": "sarah-professional",
        "language": "en-US",
        "model": "gpt-4o",
        "status": "active",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-18T14:22:00Z"
      },
      {
        "id": "agent_def456",
        "name": "Support Agent",
        "voice_id": "michael-friendly",
        "language": "en-US",
        "model": "gpt-4o-mini",
        "status": "active",
        "created_at": "2024-01-10T08:15:00Z",
        "updated_at": "2024-01-10T08:15:00Z"
      }
    ],
    "has_more": false,
    "next_cursor": null,
    "total": 2
  }
  ```
</ResponseExample>

## Error Codes

| Code             | Description                                 |
| ---------------- | ------------------------------------------- |
| `invalid_cursor` | The pagination cursor is invalid or expired |
| `invalid_status` | Status must be 'active' or 'inactive'       |
