Endpoints
Update a chatbot
Replace an agent's text knowledge with the source tools
API v1 has no endpoint that renames a chatbot and replaces its text in one call. In QwryAI an agent's knowledge is a set of sources, and you change them with the Tools API's source tools. Each change returns a review, and nothing changes until you apply it. The full reference is Update source.
POST
https://api.qwryai.com/public/v1/tools/update_source_contentAuthentication
Send your API key as Authorization: Bearer YOUR_API_KEY. The key needs Change sources and training. See Authentication.
Which tool to use
| To | Tool |
|---|---|
| Replace the text of an existing text or Q&A source | update_source_content, with the sourceId, expectedVersion and documentId from list_sources and get_source_content, and the new title, content (up to 10,000 characters) and contentType (text or qa). |
| Add new text as its own source | upload_text_source, with a name and content (up to 10,000 characters). |
| Retrain the agent on the changed sources | train_pending_sources or start_training. |
Request example
curl -X POST 'https://api.qwryai.com/public/v1/tools/upload_text_source' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"chatbotId": "YOUR_AGENT_ID",
"name": "Shipping policy",
"content": "We ship to Canada. Orders arrive in 5 to 8 business days."
}'The response is a review. Apply it with POST https://api.qwryai.com/public/v1/reviews/{reviewId}/apply within 15 minutes. See Sources.
Errors
See Update source and Error Handling.