Update a Chatbot

Update a Chatbot

This page helps you update a Chatbot.

The Chatbot Data Update API allows you to update the data for a chatbot by providing the chatbot ID, new name, and source text for text content. This API can be used to replace the existing data of a chatbot with new information.

Endpoint

POST https://www.chatzuri.com/api/v1/update-chatbot-data

Request Headers

The API request must include the following headers.
  • Authorization: Bearer - The secret key for authenticating the API request.
  • Content-Type: application/json - The content type of the request payload.

Request Body

The request body should contain the following parameters:
  • chatbotId - (required): A unique identifier for the chatbot. It helps to identify the specific chatbot whose data needs to be updated.
  • chatbotName - (required): The new name for the chatbot. This parameter allows you to update the name of the chatbot.
  • sourceText - (optional): The new source text to update the chatbot. This parameter should contain the new text content that replaces the existing data. The source text should be less than the character limit allowed by your plan.

Example Request


const res = await fetch('https://www.chatzuri.com/api/v1/update-chatbot-data', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer ',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    chatbotId: 'example-123',
    chatbotName: 'new name',
    sourceText: 'Source text that is less than your plan character limit...'
  })
});

const data = await res.json();

console.log(data); // {chatbotId: 'exampleId-123'}


import requests
import json

url = 'https://www.chatzuri.com/api/v1/update-chatbot-data'
headers = {
    'Authorization': 'Bearer ',
    'Content-Type': 'application/json'
}
data = {
    'chatbotId': 'example-123',
    'chatbotName': 'new name',
    'sourceText': 'Source text that is less than your plan character limit...'
}

response = requests.post(url, headers=headers, data=json.dumps(data))
data = response.json()

print(data)  # {'chatbotId': 'exampleId-123'}





curl https://www.chatzuri.com/api/v1/update-chatbot-data \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ' \
  -d '{
    "chatbotId": "example-123",
    "chatbotName": "new name",
    "urlsToScrape": [
      "https://www.example.com",
      "https://www.example.com/blog"
    ]
  }'


POST /api/v1/update-chatbot-data HTTP/1.1
Host: www.chatzuri.com
Authorization: Bearer 
Content-Type: application/json

{
  "chatbotId": "example-123",
  "chatbotName": "new name",
  "sourceText": "Source text that is less than your plan character limit..."
}

Response

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

{
  "chatbotId": "exampleId-123"
}

The chatbotId field in the response contains the unique identifier assigned to the updated chatbot.

Error Handling

If there are any errors during the API request, appropriate HTTP status codes will be returned along with error messages in the response body. Make sure to handle these errors gracefully in your application.
That's it! You should now be able to update a chatbot using the create API.