# List agents > Every agent in your workspace, with its status and training progress, 20 per page `list_agents` returns the agents in the workspace that owns your key. Use it to find the `id` every other agent tool takes as `chatbotId`, and that Chat API paths take as `agentId`. Each row is a short summary; read an agent's settings with [Get agent](/docs/api-reference/v2/agents/get-agent). ```http POST https://api.qwryai.com/public/v1/tools/list_agents ``` ## Authentication Send your API key as `Authorization: Bearer `, or in an `x-api-key` header. The key needs **Chat with agents**. See [Authentication](/docs/api-reference/v2/authentication). ## Body parameters `list_agents` covers the whole workspace, so it takes no `chatbotId`. | Name | Type | Required | Description | | - | - | - | - | | `page` | `integer` | No | The page to return, from `1` to `1000`. Defaults to `1`. | ## Request example > [tab] cURL > > ```bash > curl -X POST 'https://api.qwryai.com/public/v1/tools/list_agents' \ > -H 'Authorization: Bearer YOUR_API_KEY' \ > -H 'Content-Type: application/json' \ > -d '{"page": 1}' > ``` > [tab] JavaScript > > ```javascript > const response = await fetch("https://api.qwryai.com/public/v1/tools/list_agents", { > method: "POST", > headers: { > Authorization: "Bearer YOUR_API_KEY", > "Content-Type": "application/json", > }, > body: JSON.stringify({ page: 1 }), > }); > const { data } = await response.json(); > for (const agent of data.agents) console.log(agent.id, agent.name); > ``` > [tab] Python > > ```python > import requests > > response = requests.post( > "https://api.qwryai.com/public/v1/tools/list_agents", > headers={"Authorization": "Bearer YOUR_API_KEY"}, > json={"page": 1}, > ) > for agent in response.json()["data"]["agents"]: > print(agent["id"], agent["name"]) > ``` ## Response ```json { "success": true, "data": { "agents": [ { "id": "YOUR_AGENT_ID", "name": "QwryAI", "status": "active", "isDefault": true, "language": "en", "training": { "status": "completed", "percent": 100 } } ], "page": 1, "total": 1, "hasMore": false } } ``` | Field | Type | Description | | - | - | - | | `agents[].id` | `string` | The agent's id. Pass it as `chatbotId` to agent tools and as `agentId` in Chat API paths. | | `agents[].name` | `string` | The agent's name, as the dashboard shows it. | | `agents[].status` | `string` | Whether the agent is `active`. | | `agents[].isDefault` | `boolean` | `true` for the workspace's default agent. | | `agents[].language` | `string \| null` | The agent's language code, or `null` if none is set. | | `agents[].training` | `object \| null` | Training across the agent's sources, or `null` if it has none. `status` is `training`, `pending` (untrained changes), `completed`, `completed_with_errors` or `failed`; `percent` is the share of source documents trained. | | `page` | `integer` | The page you asked for. | | `total` | `integer` | How many agents the workspace has. | | `hasMore` | `boolean` | `true` when there's another page. | Raise `page` until `hasMore` is `false` to read them all. See [Pagination](/docs/api-reference/v2/pagination). > [!NOTE] > > The list shows each agent's summary only. Instructions, model, Chat bubble text and guardrails come from the read tools in [Get agent](/docs/api-reference/v2/agents/get-agent). ## Errors | HTTP status | Code | When | | - | - | - | | 400 | `INVALID_ARGUMENTS` | `page` isn't a whole number from 1 to 1000, or the body has another field. `issues` lists each problem. | | 401 | `API_KEY_REQUIRED` | No credential was sent. | | 401 | `INVALID_API_KEY` / `INVALID_OAUTH_TOKEN` | The credential is malformed, unknown, deleted or expired. | | 403 | `API_ACCESS_PLAN_REQUIRED` | The workspace's plan doesn't include API access. | | 403 | `INSUFFICIENT_PERMISSION` | The key doesn't hold **Chat with agents**. | | 429 | `INTEGRATION_RATE_LIMIT_EXCEEDED` | More than 2,000 requests in 15 minutes. Wait for `Retry-After` seconds. | | 500 | `TOOL_FAILED` | The tool failed on our side. Try again. | See [Error Handling](/docs/api-reference/v2/error-handling) for every code.