Skip to content
QwryAI
Documentation
Pages

Endpoints

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.

POSThttps://api.qwryai.com/public/v1/tools/list_agents

Authentication

Send your API key as Authorization: Bearer <api-key>, or in an x-api-key header. The key needs Chat with agents. See Authentication.

Body parameters

list_agents covers the whole workspace, so it takes no chatbotId.

NameTypeRequiredDescription
pageintegerNoThe page to return, from 1 to 1000. Defaults to 1.

Request example

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}'

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
  }
}
FieldTypeDescription
agents[].idstringThe agent's id. Pass it as chatbotId to agent tools and as agentId in Chat API paths.
agents[].namestringThe agent's name, as the dashboard shows it.
agents[].statusstringWhether the agent is active.
agents[].isDefaultbooleantrue for the workspace's default agent.
agents[].languagestring | nullThe agent's language code, or null if none is set.
agents[].trainingobject | nullTraining 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.
pageintegerThe page you asked for.
totalintegerHow many agents the workspace has.
hasMorebooleantrue when there's another page.

Raise page until hasMore is false to read them all. See Pagination.

Errors

HTTP statusCodeWhen
400INVALID_ARGUMENTSpage isn't a whole number from 1 to 1000, or the body has another field. issues lists each problem.
401API_KEY_REQUIREDNo credential was sent.
401INVALID_API_KEY / INVALID_OAUTH_TOKENThe credential is malformed, unknown, deleted or expired.
403API_ACCESS_PLAN_REQUIREDThe workspace's plan doesn't include API access.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Chat with agents.
429INTEGRATION_RATE_LIMIT_EXCEEDEDMore than 2,000 requests in 15 minutes. Wait for Retry-After seconds.
500TOOL_FAILEDThe tool failed on our side. Try again.

See Error Handling for every code.

Explore the documentation