Update Widget
Endpoint used to update a widget.
Request Example
Section titled “Request Example”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 } ] }'Response Example
Section titled “Response Example”{ "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" }}Request description
Section titled “Request description”Access Token
Section titled “Access Token”| Parameter | Type | Description | Required |
|---|---|---|---|
Authorization | String | Access token (“Bearer” must be before the token) | Yes |
URL Parameters (Path)
Section titled “URL Parameters (Path)”| Parameter | Type | Description | Required |
|---|---|---|---|
widgetId | UUID | Unique identifier of the widget to be updated. | Yes |
Body Parameters
Section titled “Body Parameters”| Parameter | Type | Description | Required |
|---|---|---|---|
botId | UUID | Unique identifier of the Bot linked to the Widget. | Yes |
unityId | UUID | Unique identifier of the owning organizational unit. | Yes |
title | String | Title displayed in the chat header. | Yes |
subTitle | String | Subtitle or status displayed in the header. | Yes |
headerIconFileId | UUID | File ID for the header icon. | No |
avatarIconFileId | UUID | File ID for the AI avatar in messages. | No |
widgetIconFileId | UUID | File ID for the floating button icon. | No |
primaryColor | String | Main interface color (Hexadecimal). | Yes |
secondaryColor | String | Interface contrast color (Hexadecimal). | Yes |
aiFirstMessage | String | First automatic message sent by the AI. | Yes |
primaryUserColor | String | Color of the user’s message bubble. | Yes |
secondaryUserColor | String | Color of the user’s message text. | Yes |
primaryAIColor | String | Color of the AI’s message bubble. | Yes |
secondaryAIColor | String | Color of the AI’s message text. | Yes |
audioVoice | String | Identifier of the voice model for text-to-speech conversion. | No |
voiceActive | Boolean | Enables/Disables the voice feature by default. | Yes |
isPublic | Boolean | Defines if the widget is accessible via external link. | Yes |
isOpen | Boolean | Defines if the widget starts open on the screen. | Yes |
defaultMessages | Array | List of suggested questions to start the chat. | No |
defaultMessages[].text | String | Content of the suggested message. | Yes* |
defaultMessages[].position | Number | Display order of the suggestion. | Yes* |
Note (*): If the
defaultMessagesarray is sent, the internal text and position fields become mandatory for each item in the list.
Response description
Section titled “Response description”| Key | Type | Description |
|---|---|---|
id | UUID | Unique identifier of the Widget configuration. |
institutionId | UUID | Unique identifier of the owning institution. |
title | String | Main title displayed in the Widget header. |
subTitle | String | Subtitle displayed below the main title. |
headerIconFileId | UUID | Header icon file ID. |
primaryColor | String | Primary interface color (Hexadecimal). |
secondaryColor | String | Secondary/contrast interface color. |
widgetIconFileId | UUID | Floating button icon ID. |
primaryAIColor | String | Background color of the agent’s message bubble. |
secondaryAIColor | String | Text color of the agent’s messages. |
avatarIconFileId | UUID | Agent’s avatar image ID. |
aiFirstMessage | String | Automatic initial greeting sent by the agent. |
primaryUserColor | String | Background color of the user’s message bubble. |
secondaryUserColor | String | Text color of the user’s messages. |
Bot | Object | Object containing the logical and AI settings of the linked agent. |
Bot.id | UUID | Unique agent identifier. |
Bot.creativePrecision | Number | Precision/creativity level configured for the model. |
Bot.prompt | String | Complete System Prompt (rules, personality, and context). |
Bot.hasVoice | Boolean | Indicates if voice functionality is enabled in the agent. |
Bot.botGenAI | Array | List of generative models and tools linked to the agent. |
Bot.botVoiceConfig | Array | Specific voice and provider settings for the agent. |
defaultMessages | Array | List of suggested phrases for the user to start the chat. |
defaultMessages[].text | String | Conversation starter content. |
defaultMessages[].position | Number | Display order of the suggestion in the interface. |
audioVoice | String | Audio profile identifier for text reading. |
voiceActive | Boolean | Defines if audio is on by default in the interface. |
isPublic | Boolean | Defines if the Widget can be accessed externally. |
isOpen | Boolean | Defines if the Widget starts expanded when loading the page. |
unity | Object | Data of the organizational unit to which the agent is linked. |
unity.name | String | Unit name linked to the agent. |
unity.credentialProjectId | UUID | ID of the credentials project associated with the unit. |
Security
Section titled “Security”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:
- Log in to the ToolzzAI platform
- Click on “Settings”
- Click on “Access Token”
- Copy the access token
