Skip to content

Update Widget

Endpoint used to update a widget.

Terminal window
curl --request PUT \
--url https://chat.api.toolzz.com.br/api/v1/widget/{widgetId} \
--header 'Authorization: Bearer TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data '
{
"botId": "uuid",
"unityId": "uuid",
"title": "<string>",
"subTitle": "<string>",
"headerIconFileId": "uuid",
"avatarIconFileId": "uuid",
"widgetIconFileId": "uuid",
"primaryColor": "<string>",
"secondaryColor": "<string>",
"aiFirstMessage": "<string>",
"primaryUserColor": "<string>",
"secondaryUserColor": "<string>",
"primaryAIColor": "<string>",
"secondaryAIColor": "<string>",
"audioVoice": "<string>",
"voiceActive": true,
"isPublic": true,
"isOpen": false,
"defaultMessages": [
{
"text": "<string>",
"position": 123
}
]
}'
{
"id": "uuid",
"institutionId": "uuid",
"title": "<string>",
"subTitle": "<string>",
"headerIconFileId": "uuid",
"primaryColor": "<string>",
"secondaryColor": "<string>",
"widgetIconFileId": "uuid",
"primaryAIColor": "<string>",
"secondaryAIColor": "<string>",
"avatarIconFileId": "uuid",
"aiFirstMessage": "<string>",
"primaryUserColor": "<string>",
"secondaryUserColor": "<string>",
"Bot": {
"id": "uuid",
"creativePrecision": 123,
"safeMode": false,
"isActivated": true,
"hasWhatsapp": true,
"hasMonetization": true,
"hasAnalytics": true,
"hasMulti": true,
"hasPlugins": true,
"hasTools": true,
"hasVoice": true,
"hasInstagram": true,
"hasMessenger": true,
"isAdvancedBot": true,
"creatorId": "uuid",
"institutionId": "uuid",
"unityId": "uuid",
"knowLedgeBaseId": "uuid",
"prompt": "<string>",
"tags": [
"<string>"
],
"description": "<string>",
"name": "<string>",
"assistantId": "uuid",
"iconFileId": "uuid",
"progressStatus": "<string>",
"botMonetizationId": "uuid",
"metaprompt": "<string>",
"botMonetization": {
"credentialId": "uuid",
"price": 123,
"timeTest": 123,
"featuredProduct": true,
"id": "uuid",
"priceId": "uuid",
"coin": "<string>",
"recurring": "<string>"
},
"botGenAI": [
{
"isDefault": true,
"messagesLimit": 123,
"charactersLimit": 123,
"temperature": 123,
"topP": 123,
"frequencyPenalty": 123,
"presencePenalty": 123,
"topK": 123,
"messagesQuery": 123,
"id": "uuid",
"botId": "uuid",
"genAIId": "uuid",
"genAIKey": "<string>",
"genAIOrganization": "<string>",
"genAIModelId": "uuid",
"assistantId": "uuid",
"credentialId": "uuid",
"analyticsCredentialId": "uuid",
"model": "<string>",
"tools": [
{
"type": "<string>",
"description": "<string>"
}
],
"credential": {
"status": false,
"id": "uuid",
"name": "<string>",
"userId": "uuid",
"unityId": "uuid",
"integrationId": "uuid",
"secretId": "uuid",
"createdAt": "<string>",
"updatedAt": "<string>",
"virtualKey": "<string>",
"integration": {
"status": true,
"id": "uuid",
"name": "<string>",
"type": "<string>",
"slug": "<string>",
"file": {
"id": "uuid",
"institutionId": "uuid",
"type": "<string>",
"fileName": "<string>",
"url": "<string>",
"size": 123
}
}
}
}
],
"botVoiceConfig": [
{
"visualType": "<string>",
"language": "<string>",
"primaryColor": "<string>",
"buttonColor": "<string>",
"theme": "<string>",
"textTitle": "<string>",
"textDescription": "<string>",
"waitTime": 123,
"callTime": 123,
"id": "uuid",
"botId": "uuid",
"voiceId": "<string>",
"voiceCredentialId": "uuid",
"visualIconId": "uuid",
"voiceModel": "<string>",
"visualIcon": {
"id": "uuid",
"institutionId": "uuid",
"fileName": "<string>",
"url": "<string>",
"size": 123
},
"voiceCredential": {
"id": "uuid",
"name": "<string>",
"userId": "uuid",
"integrationId": "uuid",
"secretId": "uuid"
}
}
]
},
"headerIcon": "uuid",
"widgetIcon": "uuid",
"avatarIcon": "uuid",
"defaultMessages": [
{
"id": "uuid",
"widgetId": "uuid",
"position": 123,
"text": "<string>"
}
],
"audioVoice": "<string>",
"voiceActive": true,
"isPublic": true,
"isOpen": false,
"isActivated": true,
"unity": {
"isActivated": true,
"id": "uuid",
"institutionId": "uuid",
"unityUuid": "uuid",
"name": "<string>",
"credentialProjectId": "uuid"
}
}

ParameterTypeDescriptionRequired
AuthorizationStringAccess token (“Bearer” must be before the token)Yes
ParameterTypeDescriptionRequired
widgetIdUUIDUnique identifier of the widget to be updated.Yes
ParameterTypeDescriptionRequired
botIdUUIDUnique identifier of the Bot linked to the Widget.Yes
unityIdUUIDUnique identifier of the owning organizational unit.Yes
titleStringTitle displayed in the chat header.Yes
subTitleStringSubtitle or status displayed in the header.Yes
headerIconFileIdUUIDFile ID for the header icon.No
avatarIconFileIdUUIDFile ID for the AI avatar in messages.No
widgetIconFileIdUUIDFile ID for the floating button icon.No
primaryColorStringMain interface color (Hexadecimal).Yes
secondaryColorStringInterface contrast color (Hexadecimal).Yes
aiFirstMessageStringFirst automatic message sent by the AI.Yes
primaryUserColorStringColor of the user’s message bubble.Yes
secondaryUserColorStringColor of the user’s message text.Yes
primaryAIColorStringColor of the AI’s message bubble.Yes
secondaryAIColorStringColor of the AI’s message text.Yes
audioVoiceStringIdentifier of the voice model for text-to-speech conversion.No
voiceActiveBooleanEnables/Disables the voice feature by default.Yes
isPublicBooleanDefines if the widget is accessible via external link.Yes
isOpenBooleanDefines if the widget starts open on the screen.Yes
defaultMessagesArrayList of suggested questions to start the chat.No
defaultMessages[].textStringContent of the suggested message.Yes*
defaultMessages[].positionNumberDisplay order of the suggestion.Yes*

Note (*): If the defaultMessages array is sent, the internal text and position fields become mandatory for each item in the list.


KeyTypeDescription
idUUIDUnique identifier of the Widget configuration.
institutionIdUUIDUnique identifier of the owning institution.
titleStringMain title displayed in the Widget header.
subTitleStringSubtitle displayed below the main title.
headerIconFileIdUUIDHeader icon file ID.
primaryColorStringPrimary interface color (Hexadecimal).
secondaryColorStringSecondary/contrast interface color.
widgetIconFileIdUUIDFloating button icon ID.
primaryAIColorStringBackground color of the agent’s message bubble.
secondaryAIColorStringText color of the agent’s messages.
avatarIconFileIdUUIDAgent’s avatar image ID.
aiFirstMessageStringAutomatic initial greeting sent by the agent.
primaryUserColorStringBackground color of the user’s message bubble.
secondaryUserColorStringText color of the user’s messages.
BotObjectObject containing the logical and AI settings of the linked agent.
Bot.idUUIDUnique agent identifier.
Bot.creativePrecisionNumberPrecision/creativity level configured for the model.
Bot.promptStringComplete System Prompt (rules, personality, and context).
Bot.hasVoiceBooleanIndicates if voice functionality is enabled in the agent.
Bot.botGenAIArrayList of generative models and tools linked to the agent.
Bot.botVoiceConfigArraySpecific voice and provider settings for the agent.
defaultMessagesArrayList of suggested phrases for the user to start the chat.
defaultMessages[].textStringConversation starter content.
defaultMessages[].positionNumberDisplay order of the suggestion in the interface.
audioVoiceStringAudio profile identifier for text reading.
voiceActiveBooleanDefines if audio is on by default in the interface.
isPublicBooleanDefines if the Widget can be accessed externally.
isOpenBooleanDefines if the Widget starts expanded when loading the page.
unityObjectData of the organizational unit to which the agent is linked.
unity.nameStringUnit name linked to the agent.
unity.credentialProjectIdUUIDID of the credentials project associated with the unit.

To access this endpoint, it is necessary to send a valid access token through the authorization header (Authorization) of the request. Additionally, the API is protected by other security measures to safeguard user data.

To access your access token, follow these steps:

  1. Log in to the ToolzzAI platform
  2. Click on “Settings”
  3. Click on “Access Token”
  4. Copy the access token

Access token page