Endpoints
Get all chatbots
List your workspace's agents with the list_agents tool
API v1 has no endpoint for listing chatbots. List your agents with the Tools API's list_agents tool: it returns each agent's id, name, status, language and training state, 20 per page. The full reference is List agents.
POST
https://api.qwryai.com/public/v1/tools/list_agentsAuthentication
Send your API key as Authorization: Bearer YOUR_API_KEY. The key needs Chat with agents. See Authentication.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number, starting at 1. Defaults to 1. |
Request example
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
{
"success": true,
"data": {
"agents": [
{ "id": "YOUR_AGENT_ID", "name": "QwryAI", "status": "active", "isDefault": true, "language": "en", "training": null }
],
"page": 1,
"total": 1,
"hasMore": false
}
}Each agent's id is the chatbotId the other tools and the v1 chat endpoint take. The agent's model and instructions are read with agent_configuration and agent_instructions; see Get agent.
Errors
| HTTP status | code | When |
|---|---|---|
| 400 | INVALID_ARGUMENTS | page isn't a whole number from 1 to 1000. |
| 403 | INSUFFICIENT_PERMISSION | The key doesn't hold Chat with agents. |
See Error Handling for authentication and rate-limit errors.