# Agents > List your agents, read their settings, and change them through reviewed tool calls The Tools API lets your code see every agent in the workspace and change how each one behaves: its instructions, model, Chat bubble text and look, guardrails and deploy channels. You find agents with `list_agents`, read settings with the read tools, and change them with tools that prepare a review you then apply. Every call is scoped to the workspace that owns the key: an agent from another workspace returns `CHATBOT_NOT_FOUND`. Agents are created, renamed and deleted in the dashboard. The API has no tool for that. ## Agent status `list_agents` returns each agent with its `id`, `name`, `status`, `isDefault`, `language` and `training`: ```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}' ``` ```json { "success": true, "data": { "agents": [ { "id": "YOUR_AGENT_ID", "name": "QwryAI", "status": "active", "isDefault": true, "language": "en", "training": { "status": "pending", "percent": 75 } } ], "page": 1, "total": 1, "hasMore": false } } ``` | Field | Meaning | | - | - | | `id` | The agent's id. Pass it as `chatbotId` to every agent tool, and as `agentId` in Chat API paths. | | `status` | Whether the agent is `active`. | | `isDefault` | The workspace's default agent. | | `training` | The latest training run's `status` and `percent`, or `null` if it never trained. | To follow training source by source, use `check_training_status` or `find_sources_by_status`. See [Sources](/docs/api-reference/v2/sources). ## Reading settings | Tool | Returns | | - | - | | `agent_configuration` | Model, citations, language, status and routing settings. `null` means not configured. | | `agent_instructions` | One instruction field, such as `systemPrompt` or `guardrails`, in 4,000-character pages. | | `get_chat_interface` | The Chat bubble's text and behaviour: name, placeholder, welcome and suggested messages. | | `list_available_models` | The model catalog **Model Settings** uses, with each model's capabilities and credit cost, 20 per page. | | `get_deploy_status` | Each channel's setup and on/off state, as **Channels** shows it. | These tools need **Read agent settings**. ## Reviewed updates Tools that change an agent never apply the change on the first call. They return a **review**: each change with its value before and after, and a `reviewId`. Nothing changes until you apply that review. ```json { "success": true, "data": { "status": "review_required", "reviewId": "4e1d7b0a-6c2f-4f93-8a15-2b9e0d3c7a64", "tool": "update_model", "changes": [ { "title": "Temperature", "before": 0.2, "after": 0.5 } ], "unchanged": [], "expiresAt": "2026-12-01T10:15:00.000Z", "next": "Show these changes to the user. Call apply_change with this reviewId only after they approve; the review expires in 15 minutes." } } ``` Apply it with `POST /public/v1/reviews/{reviewId}/apply`, or the `apply_change` tool: ```bash curl -X POST 'https://api.qwryai.com/public/v1/reviews/REVIEW_ID/apply' \ -H 'Authorization: Bearer YOUR_API_KEY' ``` | What you send | Result | | - | - | | Only the fields you want to change | Those fields change; everything else keeps its value. | | Values that are already set | `409 NOTHING_TO_CHANGE`; no review is created. | | More than 20 changes at once | `400 TOO_MANY_CHANGES`; split the request. | A review lasts **15 minutes** and works once, for the key that prepared it. If the agent changed in the meantime, applying returns `409 STALE_REVIEW` and you call the tool again for a fresh review. Several update tools also ask for the `updatedAt` you read, as `expectedUpdatedAt`, so they never overwrite a newer change. ## Where changes go live Instructions, the model and the Chat bubble's look save to the agent's **draft**, just as they do in the dashboard. The Playground uses the draft; your channels keep the published version until you publish: | Tool | Does | | - | - | | `show_pending_changes` | Lists what's in the draft. | | `publish_draft` | Publishes all of the draft, or only the changes you name, through a review. | | `discard_draft` | Throws away all of the draft, or the changes you name, through a review. | The **Guardrails** rate limit goes live as soon as its review is applied. See [Drafts and publishing](/docs/user-guides/chatbot/drafts-and-publishing). ## Training is separate Adding or editing a source doesn't retrain the agent on its own. Call `train_pending_sources`, the API's **Retrain agent**, to train every new or changed source in one review. See [Sources](/docs/api-reference/v2/sources). ## Tools > [card] List agents | /docs/api-reference/v2/agents/list-agents | Every agent in the workspace, 20 per page. > [card] Get agent | /docs/api-reference/v2/agents/get-agent | Read an agent's model, language, status and routing. > [card] Update agent | /docs/api-reference/v2/agents/update-agent | Change instructions, model and guardrails through a review. > [card] Update agent styles | /docs/api-reference/v2/agents/update-agent-styles | Change the Chat bubble's colors, launcher and fonts. > [card] Toggle auto-retrain | /docs/api-reference/v2/agents/toggle-auto-retrain | Turn weekly retraining of a website source on or off. > [card] Get agent analytics | /docs/api-reference/v2/agents/get-agent-analytics | Conversations, feedback, sentiment and resolution rate over a date range. > [card] Chat with an agent | /docs/api-reference/v2/agents/chat-with-an-agent | Send a customer message and stream the answer. ## Error codes Agent-specific error codes beyond the standard [authentication and rate-limiting errors](/docs/api-reference/v2/error-handling): | Code | HTTP | Description | | - | - | - | | `CHATBOT_ID_REQUIRED` | 400 | The body has no valid `chatbotId`. Get one from `list_agents`. | | `CHATBOT_NOT_FOUND` | 404 | No agent with that id in your workspace. | | `AGENT_NOT_FOUND` | 404 | Chat API: no agent with that id in your workspace. | | `NOTHING_TO_CHANGE` | 409 | The values you asked for are already set. | | `STALE_REVIEW` | 409 | The agent changed after the review. Call the tool again. | | `REVIEW_EXPIRED` | 409 | The review is older than 15 minutes. Call the tool again. |