Guides
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:
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}'{
"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.
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.
{
"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:
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.
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.
Tools
List agents
Every agent in the workspace, 20 per page.
Get agent
Read an agent's model, language, status and routing.
Update agent
Change instructions, model and guardrails through a review.
Update agent styles
Change the Chat bubble's colors, launcher and fonts.
Toggle auto-retrain
Turn weekly retraining of a website source on or off.
Get agent analytics
Conversations, feedback, sentiment and resolution rate over a date range.
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:
| 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. |