Skip to main content

Widget Settings

GET /settings/:id

Returns the config needed to model the widget. Theme colors, icons, form fields, required fields, and greeting messages are read from this response. JWT is not required.

The :id parameter is the chat application's UUID (appId).

Request

GET /settings/550e8400-e29b-41d4-a716-446655440000 HTTP/1.1
Host: widget-api.chatbot.aithinks.net
const settings = await fetch(`${BASE_URL}/settings/${APP_ID}`)
.then((r) => r.json());

Successful response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"botName": "Destek Botu",
"name": "Müşteri Destek",
"widgetConfigs": {
"requiredFields": ["email"],
"greetingMessages": [
{ "content": "Merhaba! Size nasıl yardımcı olabilirim?" }
],
"primaryBackgroundColor": "#007bff",
"primaryTextColor": "#FFFFFF",
"contentBackgroundColor": "#FFFFFF",
"sentMessageBubbleBgColor": "#007bff",
"sentMessageBubbleTextColor": "#FFFFFF",
"receivedMessageBubbleBgColor": "#f1f1f1",
"receivedMessageBubbleTextColor": "#000000",
"aiIconUrl": "https://cdn.example.com/bot-icon.png",
"widgetIconUrl": "https://cdn.example.com/widget-icon.png"
}
}

Fields

FieldTypeDescription
idstring (UUID)Chat application ID
botNamestringBot display name
namestringChat application title
widgetConfigsobjectConfig to model the widget (theme, form, greeting)

widgetConfigs keys

KeyTypeDescription
requiredFieldsstring[]Required field names in the Visitor Registration body
greetingMessages{ content: string }[]Greeting messages added to the chat after registration
formInputsstring[]Fields to show on the form (e.g. firstName, lastName, email)
primaryBackgroundColorstringPrimary color
primaryTextColorstringPrimary text color
inputTextColor / inputBackgroundColorstringInput field colors
footerBackgroundColor / contentBackgroundColorstringFooter and content background
sentMessageBubbleBgColor / sentMessageBubbleTextColorstringVisitor bubble colors
receivedMessageBubbleBgColor / receivedMessageBubbleTextColorstringBot/agent bubble colors
formBackgroundColorstringForm background
aiIconUrl / widgetIconUrl / userIconUrlstringIcon URLs

The contents of widgetConfigs may vary by application; ignore unknown keys.

Errors

StatusMeaning
404No chat application found for the given id