Skip to main content

Update AI Agent Widget

Used to update the AI-specific widget for an existing agent, including widget settings, appearance, and behavior configurations.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/agents/update-widget

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/agents/update-widget' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"regen_widget_id": false,
"project_key": "YOUR_PROJECT_KEY",
"widget": {
"Name": "Support Chat Widget",
"WidgetSettings": [
{
"WidgetType": "chat",
"FeStyle": ""
}
],
"LogoUrl": "https://example.com/logo.png",
"LogoId": "logo_123456",
"FeScript": "",
"ShowAgentName": true,
"Greeting": "Welcome! My name is [NAME]. If you need any assistance or have any questions, I am here to help.",
"SiteUrl": "https://example.com",
"BrandColor": "#4F46E5",
"PredefinedQuestions": [
"How can I reset my password?",
"What are your business hours?",
"How do I contact support?"
],
"EnablePredefinedQuestions": true
}
}'

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"agent_id": "string",
"regen_widget_id": false,
"project_key": "string",
"widget": {
"Name": "string",
"WidgetSettings": [
{
"WidgetType": "chat",
"FeStyle": ""
}
],
"LogoUrl": "string",
"LogoId": "string",
"FeScript": "string",
"ShowAgentName": false,
"Greeting": "Welcome! My name is [NAME]. If you need any assistance or have any questions, I'm here to help.",
"SiteUrl": "string",
"BrandColor": "string",
"PredefinedQuestions": ["string"],
"EnablePredefinedQuestions": false
}
}

Request Body Parameters

FieldTypeRequiredDescription
agent_idstringYesUnique identifier of the agent to be updated.
regen_widget_idbooleanNoWhether to regenerate the widget ID.
project_keystringYesThe project key for your project.
widgetobjectYesWidget configuration object.

Widget Configuration Parameters

FieldTypeDescription
NamestringName of the widget.
WidgetSettingsarrayArray of widget setting objects.
LogoUrlstringURL of the widget logo image.
LogoIdstringUnique identifier for the logo asset.
FeScriptstringFrontend script for widget customization.
ShowAgentNamebooleanWhether to display the agent's name in the widget.
GreetingstringInitial greeting message shown to users. Use [NAME] as a placeholder for the agent's name.
SiteUrlstringURL of the website where widget will be embedded.
BrandColorstringPrimary brand color for the widget (hex format).
PredefinedQuestionsarrayArray of predefined questions to show users.
EnablePredefinedQuestionsbooleanWhether to enable predefined questions feature.

Widget Settings Parameters

FieldTypeDescription
WidgetTypestringType of widget (e.g., chat, form).
FeStylestringCustom frontend styling configuration.

Response

Success Response (200 OK)

Returns an object containing the update status and details.

{
"is_success": true,
"item_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"detail": "Widget updated successfully",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the widget update was successful.
item_idstringUnique identifier for the updated agent.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"agent_id"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
422Validation Error - Invalid request parametersUnprocessable Entity