Skip to main content

Modify a Chatbot

The app.neoagent.co API allows you to update the configuration of a specific chatbot by sending a POST request to the /chat/Chatbot/Edit endpoint.

Endpoint

Request URL: https://app.neoagent.co/chat/Chatbot/Edit
Method: POST

Required Headers

The API request must include the following headers:

  • Authorization: <Your-Secret-Key> - string, required - The secret key to authenticate the API request
  • Content-Type: application/json - string, required - The content type of the request payload (must be application/json)

Request Body

The request body must contain the following parameters:

{
// string, required - Unique identifier (ID) of the chatbot
"serialNumber": "3254a9d0424c4806b9ea3d0763ccfxxx",
// string, optional - New name for the chatbot
"Name": "NewName",
// string, optional - AI model ID, you can call the Get Model List interface to obtain it
"Model": "2",
// string, optional - System prompt for the chatbot
"SystemMessage": "new Prompt",
// integer, optional - Temperature setting for responses
"Temperature": 0,
// string, optional - Time zone setting
"TimeZone": "Asia/Shanghai",
// string, optional - Text to append to responses
"AnswerSuffix": "Asia/Shanghai",
// string, optional - File ID for profile picture
"ChatProfilePicture": "34327",
// string, optional - File ID for chat icon
"ChatIcon": "34327",
// integer, optional - Alignment of the chat bubble
"ChatBubbleAlign": 0,
// string, optional - Color of the chat bubble (RGB format)
"ChatBubbleColor": "rgb(37,99,235)",
// boolean, optional - If showing the popup only once
"ChatbotPopupOnce": true,
// string, optional - Privacy policy description
"ChatbotPrivacyPolicyDescription": "",
// string, optional - Privacy policy name
"ChatbotPrivacyPolicyName": "privacy policy",
// string, optional - Privacy policy URL
"ChatbotPrivacyPolicyUrl": "",
// boolean, optional - Enable push-to-talk feature
"EnablePushToTalk": false,
// boolean, optional - Enable image upload feature
"EnableUploadImage": false,
// string, optional - Facebook page URL
"FacebookUrl": "",
// string, optional - Instagram profile URL
"InstagramUrl": "",
// boolean, optional - Clear chat history upon browser close
"RemoveChatLogOnBrowserClose": false,
// string, optional - Suggested messages
"SuggestedMessage": "",
// string, optional - Email for handoff
"TalkToHumanEmail": "",
// string, optional - Message for handoff to a human
"TalkToHumanResponseMessage": "",
// string, optional - Placeholder text for the input field
"UserInputPlaceholder": "",
// string, optional - Color of user messages (RGB format)
"UserMessageColor": "rgb(59, 129, 246)",
// string, optional - Initial welcome message
"WelcomeMessage": "Hello, I am your AI assistant! How can I help you?",
// string, optional - WhatsApp contact URL
"WhatsappUrl": "",
// boolean, optional - Enable domain verification
"VerifyDomain": false,
// string, optional - Allowed domains for embedding
"Domains": "",
// integer, optional - Maximum number of allowed messages
"RateLimitCount": 20,
// string, optional - Message when rate limit is exceeded
"RateLimitMessage": "Too many consecutive messages",
// integer, optional - Duration of rate limit in seconds
"RateLimitTime": 240,
// string, optional - Custom domain for embedding
"CustomDomain": "",
// string, optional - Email for daily chat logs
"EmailForDailyChatLogs": "",
// string, optional - Email for daily leads
"EmailForDailyLeads": "",
// string, optional - Language for AI responses (use full name of the language, e.g., 'English', 'Spanish', 'French')
"AIResponseLanguage": "",
// integer, optional - Maximum number of allowed messages per month (default value is -1, which means unlimited)
"MessageLimit": -1
}

Parameters

  • serialNumber - string, required - Unique identifier (ID) of the chatbot
  • Name - string, optional - New name for the chatbot
  • Model - string, optional - AI model ID, you can call the Get Model List interface to obtain it
  • SystemMessage - string, optional - System prompt for the chatbot
  • Temperature - integer, optional - Temperature setting for responses
  • TimeZone - string, optional - Time zone setting
  • AnswerSuffix - string, optional - Text to append to responses
  • ChatProfilePicture - string, optional - File ID for profile picture
  • ChatIcon - string, optional - File ID for chat icon
  • ChatBubbleAlign - integer, optional - Alignment of the chat bubble
  • ChatBubbleColor - string, optional - Color of the chat bubble (RGB format)
  • ChatbotPopupOnce - boolean, optional - Indicates whether to show the popup only once
  • ChatbotPrivacyPolicyDescription - string, optional - Privacy policy description
  • ChatbotPrivacyPolicyName - string, optional - Privacy policy name
  • ChatbotPrivacyPolicyUrl - string, optional - Privacy policy URL
  • EnablePushToTalk - boolean, optional - Enable push-to-talk feature
  • EnableUploadImage - boolean, optional - Enable image upload feature
  • FacebookUrl - string, optional - Facebook page URL
  • InstagramUrl - string, optional - Instagram profile URL
  • RemoveChatLogOnBrowserClose - boolean, optional - Clear chat history upon browser close
  • SuggestedMessage - string, optional - Suggested messages
  • TalkToHumanEmail - string, optional - Email for handoff to a human
  • TalkToHumanResponseMessage - string, optional - Message for handoff to a human
  • UserInputPlaceholder - string, optional - Placeholder text for the input field
  • UserMessageColor - string, optional - Color of user messages (RGB format)
  • WelcomeMessage - string, optional - Initial welcome message
  • WhatsappUrl - string, optional - WhatsApp contact URL
  • VerifyDomain - boolean, optional - Enable domain verification
  • Domains - string, optional - Allowed domains for embedding
  • RateLimitCount - integer, optional - Maximum number of allowed messages
  • RateLimitMessage - string, optional - Message when rate limit is exceeded
  • RateLimitTime - integer, optional - Duration of rate limit in seconds
  • CustomDomain - string, optional - Custom domain for embedding
  • EmailForDailyChatLogs - string, optional - Email for daily chat logs
  • EmailForDailyLeads - string, optional - Email for daily leads
  • AIResponseLanguage - string, optional - Language for AI responses (use the full language name, such as "English", "Spanish", "French")
  • MessageLimit - integer, optional - Maximum number of allowed messages per month (default value is -1, which means unlimited)

Request Examples

const res = await fetch('https://app.neoagent.co/chat/Chatbot/Edit', {
method: 'POST',
headers: {
"Authorization": "<Your-Secret-Key>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"serialNumber": "3254a9d0424c4806b9ea3d0763ccfxxx",
"Name": "NewName"
})
});

const data = await res.json();
console.log(data);

Response

The API response will be a JSON object with the following structure:

{
// integer - Operation result (1 indicates success)
"Data": 1,
// string - API version
"Version": "1.0.0",
// boolean - Operation success status
"Success": true,
// integer - HTTP status code
"Code": 200,
// string - Error message if any
"Message": ""
}

Error Handling

If the request fails, you should:

  1. Check the HTTP status code for network-level errors
  2. Examine the Code and Message fields in the response for business-level errors
  3. The Message field will contain detailed information about the error