Update a Chatbot via API (PUT)
This article explains how to update an existing Chat Agent (chatbot) in your Flora AI account using a PUT request.
Overview
You can modify a chatbot’s configuration—such as its name, model, behavior, rate limits, and UI options—by sending a PUT request to the chatbot API endpoint.
Use this when you want to:
Change the chatbot’s name or display name
Switch to a different LLM model or set a backup model
Adjust temperature or knowledge base behavior
Enable/disable features like streaming, audio, image upload
Configure rate limiting and cooldown messages
Pin the chatbot in your list
API Endpoint
Use the following URL, replacing your_chatbot_uuid with the actual UUID of the chatbot you want to update:
https://app.floraai.me/en/chatbot/api/v1/chatbot/your_chatbot_uuid/This endpoint accepts PUT requests to update the chatbot.
Authentication & Headers
Include these headers in your request:
Content-Type: application/jsonAuthorization: Token <Your-API-Token>Content-Type: application/json– Required to send JSON data.Authorization: Token <Your-API-Token>– Replace<Your-API-Token>with your actual API token.
You may also include:
Accept: application/jsonto explicitly request a JSON response.
Request Body Parameters
Send the chatbot configuration as JSON in the request body.
Required Fields
name(String, Required)
Internal name of the chatbot.base_system_message(String, Required)
The core system prompt that defines the chatbot’s behavior and role.
Optional Fields
display_name(String, Optional)
Name shown to end users in the chat widget.chatgpt_model_key(Choice, Optional)
Primary LLM model key. Example choices include:GPT-3.5GPT-4GPT-4-TurboGPT_4_TURBO_2024_04_09GPT_4_O_2024_05_13GPT-4o-2024-11-20GPT-4O-miniGPT-4O-2024-08-06GPT-4.1-2025-04-14GPT-4.1-mini-2025-04-14GPT-4.1-nano-2025-04-14GPT-5-2025-08-07GPT-5-mini-2025-08-07GPT-5-nano-2025-08-07GPT-5.2-2025-12-11CLAUDE-3-OPUS-20240229CLAUDE-3-7-sonnet-20250219CLAUDE-3-5-haiku-20241022CLAUDE-SONNET-4-6CLAUDE-HAIKU-4-5-20251001GROK-2-1212GROK-3GROK-3-miniGROK-4-0709GROK-4-1-fast-reasoningGROK-4-1-fast-non-reasoningbackup_llm_model_key(Choice, Optional)
Backup LLM model key used if the primary model is unavailable. Same choices aschatgpt_model_key.temperature(Decimal, Optional)
Controls randomness of responses.Lower values (e.g.,
0.1) → more deterministicHigher values (e.g.,
1.0+) → more creative/unpredictablesupport_email(Email, Optional)
Overrides the default agency support email for this chatbot.knowledge_base_results_base_system_prompt(String, Optional)
System prompt used specifically when responding with knowledge base results.conversation_starter_message(String, Optional)
Starter messages shown at the beginning of the conversation.Separate multiple starters with new lines (
\n).initial_message(String, Optional)
Initial message(s) shown to the user when the chat opens.Separate multiple messages with new lines (
\n).show_data_sources(Boolean, Optional)true: Show data sources in the chat widget.false: Hide data sources.persistent_conversation_starter_message(Boolean, Optional)true: Keep conversation starters visible throughout the conversation.false: Show only at the beginning.debug_mode(Boolean, Optional)true: Show matched data/sources from Redisearch for each query (for debugging).false: Hide debug information.audio_io_enabled(Boolean, Optional)true: Enable audio input/output for the chatbot.false: Disable audio features.categories(ManyToMany, Optional)
List of category IDs the chatbot belongs to.
Example:[1, 2, 3].is_streaming_enabled(Boolean, Optional)true: Enable streaming responses.false: Disable streaming.top_k(Integer, Optional)
Number of knowledge base results to fetch as context for the chatbot.image_upload_enabled(Boolean, Optional)true: Allow users to upload images/documents.false: Disable uploads.llm_driven_conversation_titles(Boolean, Optional)true: Let the AI generate conversation titles based on context.false: Disable AI-generated titles.rate_limiting_enabled(Boolean, Optional)true: Enable message rate limiting.false: Disable rate limiting.time_period(Choice, Optional; used with rate limiting)
Time window for enforcing message limits:per_hourper_dayper_monthmessages_limit(Integer, Optional; used with rate limiting)
Maximum number of messages allowed within the selectedtime_period.cooldown_period(Integer, Optional; used with rate limiting)
Cooldown period in minutes after reaching the message limit before users can send messages again.cooldown_message(String, Optional; used with rate limiting)
Message shown to users when they hit the rate limit.is_pinned(Boolean, Optional)true: Pin the chatbot to the top of the chatbot list.false: Do not pin.
Example Request (Python)
Below is a complete example using Python’s requests library:
import requests# Define the API endpointurl = "https://app.floraai.me/en/chatbot/api/v1/chatbot/your_chatbot_uuid/"# Set up authentication and headersheaders = { 'Authorization': 'Token <YOUR-API-TOKEN>', 'Content-Type': 'application/json', 'Accept': 'application/json'}# Data is passed in the request body as JSONdata = { "name": "Your message/string here.", "display_name": "Your message/string here.", "chatgpt_model_key": "GPT-4", "backup_llm_model_key": "GPT-3.5", "temperature": "1.1", "support_email": "[email protected]", "base_system_message": "Your message/string here.", "knowledge_base_results_base_system_prompt": "Your message/string here.", "conversation_starter_message": "Your message/string here.", "initial_message": "Your message/string here.", "show_data_sources": True, "persistent_conversation_starter_message": True, "debug_mode": True, "audio_io_enabled": True, "categories": [1, 2, 3], "is_streaming_enabled": True, "top_k": 10, "image_upload_enabled": True, "llm_driven_conversation_titles": True, "rate_limiting_enabled": True, "time_period": "per_hour", "messages_limit": 10, "cooldown_period": 10, "cooldown_message": "Your message/string here.", "is_pinned": True}response = requests.put(url, headers=headers, json=data)# Process the responseif response.status_code in (200, 201, 202): result = response.json() print("Response data:", result)else: try: error_data = response.json() error_message = error_data.get('message') or error_data.get('error', 'Unknown error') print(f"Error: {error_message}") except ValueError: print(f"Error: Status code {response.status_code}")Notes:
Replace
your_chatbot_uuidwith the actual chatbot UUID.Replace
<YOUR-API-TOKEN>with your real API token.Adjust the field values to match your desired configuration.
For
categories, send a JSON array (e.g.,[1, 2, 3]), not a string.
Example Response
A successful update returns the updated chatbot object. For example:
{ "id": 6, "name": "AI Meeting Scheduler", "display_name": "AI Meeting Scheduler", "chatgpt_model_key": "GPT_4_O_2024_05_13", "temperature": "0.1", "support_email": "[email protected]", "base_system_message": "Bass system Prompt.", "conversation_starter_message": "", "initial_message": "Hi! What can I help you with?", "show_data_sources": false, "persistent_conversation_starter_message": false, "debug_mode": false, "audio_io_enabled": false, "image_upload_enabled": false}Key points:
status_codewill typically be200for a successful update.The response body contains the current configuration of the chatbot after the update.
Still need help?
Contact us