# 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](/docs/api-reference/v2/sources/update-source). ```http POST https://api.qwryai.com/public/v1/tools/update_source_content ``` ## Authentication Send your API key as `Authorization: Bearer YOUR_API_KEY`. The key needs **Change sources and training**. See [Authentication](/docs/api-reference/v2/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 ```bash 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](/docs/api-reference/v2/sources). > [!NOTE] > > The API doesn't rename agents. To change the name customers see in the chat, set `displayName` with `update_chat_interface`; see [Update chatbot settings](/docs/api-reference/v1/chatbots/update-chatbot-settings). ## Errors See [Update source](/docs/api-reference/v2/sources/update-source) and [Error Handling](/docs/api-reference/v2/error-handling).